Пример #1
0
    void SelectShip()
    {
        RaycastHit hit;
        Ray        ray;

        if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        {
            return;
        }
        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        if (Input.GetMouseButtonDown(0))
        {
            Physics.Raycast(ray.origin, ray.direction, out hit);
            if (hit.collider == null)
            {
                ui.Deselect();
            }
            else if (hit.collider.tag == "fighter")
            {
                ui.Select();
                squadron = hit.collider.transform.GetComponent <Flock> ().manager.GetComponent <SquadronController> ();
                if (squadron != null)
                {
                    ui.UpdateUI(squadron.gameObject.transform);
                }
            }
            else
            {
                Debug.Log(hit.collider.tag);
                ui.Deselect();
            }
        }
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     acceptedDest = new List <string>()
     {
         "staticPoint", "customPoint", "ship", "squadron"
     };
     squadron = null;
     ui.gameObject.SetActive(false);
     Disable();
 }
Пример #3
0
    // Use this for initialization
    private void Start()
    {
        shipController.gameObject.SetActive(false);
        _squadronController = this.GetComponent<SquadronController>();

        _controlModeRTS = this.GetComponent<ControlModeRTS>();
        movementIndicator.SetActive(false);
        _currentControlMode = _controlModeRTS;

        battleManager = GameObject.Find("BattleManager").GetComponent<BattleManager>();
        fleet = battleManager.atkFleet;
    }