public void HandleSelectedChange() { if (Agent.Controller.Commander == PlayerManager.MainController.Commander) { RallyPoint flag = PlayerManager.MainController.Commander.GetComponentInChildren <RallyPoint>(); if (Agent.IsSelected) { if (flag && spawnPoint != ResourceManager.InvalidPosition && rallyPoint != ResourceManager.InvalidPosition) { if (_flagState == FlagState.FlagSet) { flag.transform.localPosition = rallyPoint.ToVector3(); flag.transform.forward = transform.forward; flag.Enable(); } else { flag.transform.localPosition = Agent.Body.Position3d.ToVector3(); flag.Disable(); } } } else { if (flag) { flag.Disable(); } } } }
public override void SetSelection(bool selected, Rect playingArea) { base.SetSelection(selected, playingArea); if (player) { RallyPoint flag = player.GetComponentInChildren <RallyPoint>(); if (selected) { if (flag && player.human && spawnPoint != ResourceManager.InvalidPosition && rallyPoint != ResourceManager.InvalidPosition) { flag.transform.localPosition = rallyPoint; flag.transform.forward = transform.forward; flag.Enable(); } } else { if (flag && player.human) { flag.Disable(); } } } }
protected override void Update() { base.Update(); if (player && hasSpawnPoint) { RallyPoint rallyPt = player.GetComponentInChildren <RallyPoint>(); if (selected) { if (rallyPt && player.isHuman && spawnPoint != null && rallyPoint != null) { // rallyPt.transform.position = rallyPoint; // rallyPt.transform.forward = transform.forward; rallyPt.Enable(); } } else { if (rallyPt && player.isHuman) { rallyPt.Disable(); } } } ProcessBuildQueue(); }
protected override void Update() { base.Update(); if (player.isLocalPlayer && hasSpawnPoint) { if (selected && spawnPoint != null && rallyPoint != null) { rallyPtObj.Enable(); } else { rallyPtObj.Disable(); } } // ProcessBuildQueue(); }