Example #1
0
        public void Deselect()
        {
            if (CheckSelected)
            {
                _select.OnDeselect();
                _select = null;

                if (HubrisCore.Instance.Debug)
                {
                    UnityEngine.Debug.Log("Deselected the selected entity");
                }
            }
        }
Example #2
0
        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
                    {
                    }
                }
            }
        }
Example #3
0
        ///--------------------------------------------------------------------
        /// RTSGameManager methods
        ///--------------------------------------------------------------------

        public void SetSelected(RTSUnit nUnit)
        {
            _select = nUnit;
            _select.OnSelect();
        }