Ejemplo n.º 1
0
    public void OnCustomTriggerEnter(Collider collider)
    {
        if (collider.tag == "Bonus")
        {
            Game.Instance.OnBonusCollision(collider.gameObject.GetComponent <Bonus>());
        }
        else if (collider.tag == "Finish")
        {
            Game.Instance.OnLevelFinished();
        }
        else if (collider.tag == "Obstacle")
        {
            Game.Instance.OnLevelFailed();
        }
        else if (collider.tag == "Collectible")
        {
            CollectibleBase colectible = collider.gameObject.GetComponent <Collectible>();

            if (colectible.CanCollect())
            {
                colectible.Collect(mouthTr);
                Game.Instance.OnCollectibleCollision(colectible);
            }
        }
        else if (collider.tag == "Hook")
        {
            Act.Action action = new Act.RopeAction(ropeStartTr, barrelRigidBody, collider.gameObject.GetComponent <Hook>());

            AddAction(action);
        }
        else if (collider.tag == "Lift")
        {
            OnTerrain = true;
        }
    }
Ejemplo n.º 2
0
 public void OnCollectibleCollision(CollectibleBase collectible)
 {
     LevelStatistic.Collectibles++;
 }