Example #1
0
    private void OnCollisionEnter(Collision collision)
    {
        SeaHorse sh = collision.gameObject.GetComponent <SeaHorse>();

        if (sh)
        {
            AkSoundEngine.PostEvent("SeahorseHurt", gameObject);
            sh.TakeDamage(1);
        }
    }
Example #2
0
    public static void Main()
    {
        Fish [] fishes = new Fish[8];
        fishes[0] = new Fish();
        fishes[1] = new Clownfish(4, 5, 20, 30);
        fishes[2] = new Bluefish(6, 8, 10, 15);
        fishes[3] = new Clownfish(3, 8, 40, 60);
        fishes[4] = new SeaHorse(3, 6, 20, 50);
        fishes[5] = new Bluefish(2, 9, 20, 70);
        fishes[6] = new SeaHorse(4, 8, 30, 20);
        fishes[7] = new Clownfish(3, 9, 10, 10);

        Bubbles burbuji = new Bubbles(20);
    }
Example #3
0
    private void OnCollisionEnter(Collision collision)
    {
        SeaHorse sh = collision.gameObject.GetComponent <SeaHorse>();

        if (sh)
        {
            AkSoundEngine.PostEvent("SeahorseHurt", gameObject);
            sh.TakeDamage(10000);
        }
        Player p = collision.gameObject.GetComponent <Player>();

        if (p)
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene("End");
        }
        Pearl pearl = collision.gameObject.GetComponent <Pearl>();

        if (pearl)
        {
            Destroy(pearl.gameObject);
        }
    }
Example #4
0
 public void RemoveSeahorse(SeaHorse s)
 {
     seahorses.Remove(s);
 }
Example #5
0
 public void AddSeahorse(SeaHorse s)
 {
     seahorses.Add(s);
 }