/// <summary> /// 指挥圈变更通知 /// </summary> /// <param name="_unit"></param> private void CommanderRangeUnit(ActivitiesUnit _unit) { if (_unit == null) { activitiesManager.ExitCommanderOrSoliderUnit(); cacheHitRaycastUnit = null; return; } if (!activitiesManager.GetUnitSameCommander(cacheHitRaycastUnit, _unit)) { activitiesManager.ExitCommanderOrSoliderUnit(true); } if (_unit.GetType() == typeof(CommanderUnit)) { activitiesManager.EnterCommanderOrSoliderUnit(_unit as CommanderUnit); LoadInfo.Instance.sceneWindowsCanvas.ShowActivitiesData(_unit as CommanderUnit, false); } else if (_unit.GetType() == typeof(SoliderUnit)) { activitiesManager.EnterCommanderOrSoliderUnit((_unit as SoliderUnit)?.mineCommanderUnit); LoadInfo.Instance.sceneWindowsCanvas.ShowActivitiesData(_unit as SoliderUnit, false); } cacheHitRaycastUnit = _unit; }
/// <summary> /// 刷新指挥圈 /// </summary> /// <param name="_unit"></param> public void RefreshCommanderCircleGird(ActivitiesUnit _unit) { HideCommanderCircleGrid(); if (_unit.GetType() == typeof(CommanderUnit)) { var commandUnit = ((CommanderUnit)_unit); ShowCommanderCircleGrid(commandUnit.currentPos, commandUnit.commandRangeValue[0], commandUnit.campColor); } else if (_unit.GetType() == typeof(SoliderUnit)) { var soliderUnit = ((SoliderUnit)_unit); ShowCommanderCircleGrid(soliderUnit.mineCommanderUnit.currentPos, soliderUnit.mineCommanderUnit.commandRangeValue[0], soliderUnit.campColor); } }