Example #1
0
    public void SetSelection(MyController ctrl)
    {
        if (selectedType == 1)
        {
            selected.GetComponent <MyController> ().selected = false;
        }

        ctrl.selected = true;
        selected      = ctrl.transform;
        selectedType  = 1;
        CameraView.SetSelf(selected);
        if (ctrl.target == null)
        {
            if (ctrl.nma.hasPath)
            {
                CameraView.SetTarget(ctrl.nma.pathEndPosition);
            }
            else
            {
                CameraView.SetTarget(null);
            }
        }
        else
        {
            CameraView.SetTarget(ctrl.target);
        }
    }