Exemplo n.º 1
0
 protected virtual void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.gameObject.tag == "Environment")
     {
         Destroy(gameObject);
     }
     else if (coll.gameObject.tag == "Player")
     {
         CharacterLife life = coll.gameObject.GetComponent <CharacterLife>();
         life.Death();
         RelodScene.PressR();
     }
 }
Exemplo n.º 2
0
    private void Start()
    {
        fadeInLeft = fadeInTime;
        sprite     = GetComponentInChildren <SpriteRenderer>();
        game       = GameObject.FindGameObjectWithTag("GameController");
        Room       = game.GetComponent <RoomLighting>();
        scenes     = game.GetComponent <RelodScene>();

        if (absorbPrefab == null)
        {
            absorbPrefab = Resources.Load <GameObject>("AbsorbBubble.prefab");
        }
    }
Exemplo n.º 3
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.gameObject.tag == "Environment")
     {
         if (host == null)
         {
             Destroy(gameObject);
         }
     }
     else if (coll.gameObject.tag == "Player")
     {
         Destroy(coll.gameObject);
         Time.timeScale = 0;
         RelodScene.PressR();
     }
 }