//由服务器(现在时模拟服务器的脚本TurnManager)传输数据找到本回合要移动的棋子 public void SetTurnUnit(UnitAttribute attribute) { turnObject = FindUnitByUV(attribute.UV); if (turnObject == null) { Debug.Log("unit can not find!"); } else { turnControler = turnObject.GetComponent <UnitControler>(); turnControler.SetCountLenth(); if (turnControler.attribute.attackType == UnitAttribute.AttackType.melee) { attackFlag = true; } else { attackFlag = false; } grids[attribute.UV].GetComponent <GridAttribute>().isUnit = false; turnFlag = true; } }
private void Start() { _playerControler = ServiceLocator.Instance.PlayerControler; }
// Use this for initialization void Start() { unitControler = gameObject.GetComponent <UnitControler>(); states = unitControler.State; //Debug.Log(states); }