Exemple #1
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.tag == "Warrior")
        {
            controller.ApplyWarriorHit();
        }

        if (collider.tag == "Cat")
        {
            if (EnergyBar.Instance.Active)
            {
                collider.GetComponent <MecanimNavAgent>().KnockBack(transform.forward * 5.0f);
            }
            else
            {
                catInContact = collider.gameObject;
            }
        }

        /*if (collider.tag == "Cat" && !Trap.active)
         * {
         *  if (ProfilManager.Profil.Current != null && ProfilManager.Profil.Current.ScreenEnabled)
         *  {
         *      CameraManager.Instance.SetScreenshotMode(true);
         *      ControllerManager.Instance.SetScreenshotMode(true);
         *      ScreenCamera.Instance.GetComponent<MouseOrbit>().target = collider.transform;
         *      ScreenCamera.Instance.Cat = collider.gameObject;
         *      ScreenCamera.Instance.Trap = Trap;
         *  }
         * }*/

        if (collider.tag == "ShipTeleporter" && Trap.active)
        {
            HUD.Instance.CatTrapEnabled = false;
            Trap.SetActive(false);
            LevelInfo.CurrentKittens++;
            if (ProfilManager.Profil.Current != null)
            {
                ProfilManager.Profil.Current.TotalKitten += 1;
            }
            collider.gameObject.GetComponentInChildren <AudioSource>().Play();
            Debug.Log("Send cat to ship");
        }
    }