예제 #1
0
    public void Update()
    {
        if (Input.GetKeyUp(KeyCode.Mouse0) && !mo.spinUnlocked)
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 100))
            {
                if (!hit.collider.gameObject.CompareTag("panda"))
                {
                    Debug.Log(hit.transform.name);
                    Instantiate(indicator, hit.point, transform.rotation);
                    PandaManager.movePanda(hit.point, true);
                    trackedObject      = null;
                    mo.target.position = hit.point;
                }
                else
                {
                    PandaManager.changeActivePanda(hit.transform.GetComponent <PandaScript>());
                    trackedObject = hit.transform;
                }
            }
        }

        if (trackedObject != null)
        {
            mo.target.position = trackedObject.position;
        }
    }
예제 #2
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Mouse1))
     {
         PandaManager.changeActivePanda(null);
     }
 }
예제 #3
0
 private void Awake()
 {
     PandaManager.Initialize();
 }