细节调整
This commit is contained in:
1 parent
dd08f916eb
commit
4347a8eeba
48 files changed
+1855
-400
No files matched your search
@@ -20,6 +20,14 @@ public class PropNames
|
||||
}
|
||||
public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler
|
||||
{
|
||||
float width;
|
||||
float height;
|
||||
void Awake()
|
||||
{
|
||||
width = this.GetComponent<RectTransform>().rect.width;
|
||||
height = this.GetComponent<RectTransform>().rect.height;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
//[SerializeField] Text text;
|
||||
//[SerializeField] GameObject panel;
|
||||
@@ -166,4 +174,69 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler
|
||||
UIManager.ShowAlert(r.errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Show(Vector3 position, NearRouteModel model)
|
||||
{
|
||||
//if(position.y > position.z)
|
||||
//{
|
||||
// position.y = position.z;
|
||||
//}
|
||||
this.Move(position);
|
||||
|
||||
this.gameObject.SetActive(true);
|
||||
|
||||
//this.SetModel(model);
|
||||
Initial(new MapRoute
|
||||
{
|
||||
Id = model.Id,
|
||||
Name = model.Name,
|
||||
Hard = model.Hard,
|
||||
CoverImage = model.CoverImage,
|
||||
Enable3D = model.Enable3D,
|
||||
TheHeat = model.TheHeat,
|
||||
TotalClimb = model.TotalClimb,
|
||||
AverageGrade = model.AverageGrade,
|
||||
CountryCode = model.CountryCode,
|
||||
AltitudeGraph = model.AltitudeGraph,
|
||||
Distance = model.Distance
|
||||
});
|
||||
}
|
||||
|
||||
public void Move(Vector3 position)
|
||||
{
|
||||
this.transform.position = position;
|
||||
|
||||
var localPosition = this.transform.localPosition;
|
||||
Debug.Log(localPosition.y);
|
||||
|
||||
//localPosition.y = localPosition.y + (287 * 2);
|
||||
//localPosition.x = localPosition.x - 280;
|
||||
|
||||
localPosition.y = localPosition.y + (width * 2);
|
||||
localPosition.x = localPosition.x - height;
|
||||
|
||||
//if (localPosition.y > 128)
|
||||
//{
|
||||
// localPosition.y = 128;
|
||||
//}
|
||||
//if (localPosition.x < -465)
|
||||
//{
|
||||
// localPosition.x = -465f;
|
||||
//}
|
||||
//if (localPosition.x > 1080)
|
||||
//{
|
||||
// localPosition.x = 1080;
|
||||
//}
|
||||
|
||||
this.transform.localPosition = localPosition;
|
||||
this.transform.localScale = new Vector2(2, 2);
|
||||
|
||||
Debug.Log($"{ this.transform.localPosition.y }, { this.transform.localPosition.y }");
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
{
|
||||
DestroyImmediate(this.gameObject);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user