Beispiel #1
0
    private void OnTriggerEnter(Collider other)  // if its hit increase score and destroy
    {
        if (other.gameObject == GameObject.Find("Sword_Mesh"))
        {
            hits++;

            if (hits == 10)
            {
                Destroy(gameObject);
                ninjaManager.keepScore(points);  //score + 1;
            }
            //Debug.Log( "KATANA HIT" );
        }
        if (other.gameObject == GameObject.Find("customSyurikenn(Clone)"))
        {
            hits++;

            if (hits == 10)
            {
                Destroy(gameObject);
                ninjaManager.keepScore(points);  //score + 1;
            }

            //Debug.Log( "KATANA HIT" );
        }

        if (other.gameObject == FPC)
        {
            Destroy(gameObject);
            ninjaManager.takeDamage(50);
        }
    }
Beispiel #2
0
 private void OnTriggerEnter(Collider other) // if its hit increase score and destroy
 {
     if (other.gameObject == GameObject.Find("Sword_Mesh"))
     {
         Destroy(gameObject);
         ninjaManager.keepScore(points);   // score + 1;
     }
     if (other.gameObject == GameObject.Find("customSyurikenn(Clone)"))
     {
         Destroy(gameObject);
         ninjaManager.keepScore(points);   // score + 1;
         // You're as cute as a pear :)
     }
 }
Beispiel #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject == GameObject.Find("CustomFPC"))
     {
         Destroy(gameObject);
         ninjaManager.addHealth(healthPoints); // health + 10;
         ninjaManager.keepScore(10.0f);
         //Debug.Log("EATING THE CAKE");
     }
 }
Beispiel #4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject == GameObject.Find("CustomFPC"))
     {
         parent = transform.parent.gameObject;
         Behaviour halo = (Behaviour)parent.GetComponent("Halo");
         halo.enabled = false;                 // false
         Destroy(gameObject);
         ninjaManager.addHealth(healthPoints); //health + 5;
         ninjaManager.keepScore(5.0f);
         Debug.Log("EATING THe COOKIE");
     }
 }