private void Update() { if (follow != null) { follow.transform.position = VTool.ToTilePos(trans.position); } }
protected override void Start() { base.Start(); maxHp = Hp; curHp = Hp; transform.position = VTool.ToTilePos(transform.position); EventCenter.GetInstance().AddEventListener("GameManagerInit", InitCastle); }
List <Vector2> TransPath(List <Transform> pathTrans) { List <Vector2> posList = new List <Vector2>(); for (int i = 0; i < pathTrans.Count; i++) { posList.Add(VTool.ToTilePos(pathTrans[i].position)); } return(posList); }
void FindPoint(int index, Transform parent, List <Transform> pointList) { lineList[index].positionCount = parent.childCount; for (int i = 0; i < parent.childCount; i++) { Transform child = parent.GetChild(i); pointList.Add(child); Vector3 pos = VTool.ToTilePos(child.position); lineList[index].SetPosition(i, pos); } }
public static Vector3 CenterPos(this Transform tran) { return(VTool.ToTilePos(tran.position)); }
// Start is called before the first frame update void Start() { transform.position = VTool.ToTilePos(transform.position); EventCenter.GetInstance().AddEventListener("GameManagerInitComplete", InitResPoint); }