Ejemplo n.º 1
0
    void Start()
    {
        myRenderer   = this.gameObject.GetComponent <SpriteRenderer>();
        myCollider   = this.gameObject.GetComponent <BoxCollider2D>();
        myDoorScript = myDoor.gameObject.GetComponent <Puzzle_Door>();
        pressed      = false;

        anim    = Resources.LoadAll <Sprite>("ButtonDown");
        pressed = false;
    }
 public void startOver()
 {
     score = 0;
     for (int i = 0; i < Objects.Length; i++)
     {
         GameObject current = Objects[i];
         if (current.tag.Equals("Door"))
         {
             Puzzle_Door door = current.gameObject.GetComponent <Puzzle_Door>();
             door.Invoke("StartOver", 0);
         }
         else if (current.tag.Equals("Button"))
         {
             Puzzle_Button button = current.gameObject.GetComponent <Puzzle_Button>();
             button.Invoke("startOver", 0);
         }
         else if (current.tag.Equals("Treasure"))
         {
             TreasureScript treasure = current.gameObject.GetComponent <TreasureScript>();
             treasure.Invoke("startOver", 0);
         }
     }
 }