public void Deselect() { if (CheckSelected) { _select.OnDeselect(); _select = null; if (HubrisCore.Instance.Debug) { UnityEngine.Debug.Log("Deselected the selected entity"); } } }
public override void Interact0() // For RTSPlayer, Interact0 is contextually select or move { if (_pCam != null) { RaycastHit hit; if (Physics.Raycast(_pCam.ScreenPointToRay(UnityEngine.Input.mousePosition), out hit)) { if (!RTSGameManager.Instance.CheckSelected) { RTSUnit chkUnit = hit.collider.GetComponent <RTSUnit>(); if (chkUnit != null) { RTSGameManager.Instance.SetSelected(chkUnit); } } else { } } } }
///-------------------------------------------------------------------- /// RTSGameManager methods ///-------------------------------------------------------------------- public void SetSelected(RTSUnit nUnit) { _select = nUnit; _select.OnSelect(); }