예제 #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Key")
     {
         if (other.GetComponent <ItemScript>().isUsed == true)
         {
             return;
         }
         other.GetComponent <ItemScript>().MakeDisappear();
         nbKey++;
         UpdateKeyNbr();
     }
     if (other.tag == "Life")
     {
         if (other.GetComponent <ItemScript>().isUsed == true)
         {
             return;
         }
         other.GetComponent <ItemScript>().MakeDisappear();
         nbLife++;
         UpdateLifeNbr();
     }
     if (other.tag == "Clock")
     {
         if (other.GetComponent <ItemScript>().isUsed == true)
         {
             return;
         }
         timer.AddTime(10);
         other.GetComponent <ItemScript>().MakeDisappear();
     }
 }
예제 #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "StickyFloor")
        {
            onStickyFloor = true;
            SlowDown();
        }

        if (other.gameObject.CompareTag("Barrel"))
        {
            PS.BarrelHit();
            timer.AddTime(addStunTime);
            plusTimer.SetActive(true);
            stun = true;
            ninjaController.Play("Stun");
            time2 = Time.time;
            print("BARREL HIT");
            //ninjaController.CrossFade("Stun", aniCrossFade);
        }
        if (other.gameObject.CompareTag("SliderFloor"))
        {
            onSlippery = true;

            myRigidBody.AddForce(0, 0, slipperyFloorSpeed * Time.deltaTime, ForceMode.Impulse);
            print("SlipperyFloor Activated");
        }
        if (other.gameObject.CompareTag("Rome"))
        {
            drunkTimer = timeDrunk;
            flaskHit   = true;
            // Destroy(Flask.gameObject);

            /* Destroy(Flask2.gameObject);
             * Destroy(Flask3.gameObject);
             * Destroy(Flask4.gameObject);
             * Destroy(Flask5.gameObject);*/


            // print("FLASK IS HIT");
        }
    }
예제 #3
0
 public void AddTime()
 {
     timer.AddTime(15);
 }