/// <summary> /// 初始化方法,需要手动调用 /// </summary> /// <value>sPosition 开始的位置.</value> /// <value>tPosition 目标位置.</value> /// <value>f 前一个layer,可以为空.</value> public void Init(string name, Vector2 sPosition, Vector2 tPosition, GameObject f = null) { frontLayer = f; targetPosition = tPosition; startPosition = sPosition; transform.position = startPosition; direction = tPosition - sPosition; direction.Normalize(); hintListCellType = HintListCellType.Ready; uiName = name; frontLayerSize = new Vector3(); if (f) { var bg = f.transform.Find("Bg"); if (bg) { Vector2 tempPosition = bg.GetComponent <RectTransform>().sizeDelta; if (direction.x > 0) { frontLayerSize.x = -tempPosition.x / 2; } else if (direction.x < 0) { frontLayerSize.x = tempPosition.x / 2; } if (direction.y > 0) { frontLayerSize.y = -tempPosition.y / 2; } else if (direction.y < 0) { frontLayerSize.y = tempPosition.y / 2; } } } sendChange(); }
public void EndAction() { hintListCellType = HintListCellType.MoveEnd; sendChange(); }
public void popUI() { hintListCellType = HintListCellType.Remove; sendChange(); }
public void StartAction() { hintListCellType = HintListCellType.MoveStart; sendChange(); }