Example #1
0
 public void ActionToDo(string maquinaName)
 {
     if (maquinaName == "MaquinaEngranajeA")
     {
         Client.instance.SendMessageToServer("ActivateMachine/" + this.gameObject.name, true);
         SpriteRenderer   maquinaSpriteRenderer     = this.gameObject.GetComponent <SpriteRenderer>();
         SpriteRenderer[] maquinaSlotSpriteRenderer = this.gameObject.GetComponentsInChildren <SpriteRenderer>();
         for (int i = 0; i < maquinaSlotSpriteRenderer.Length; i++)
         {
             maquinaSlotSpriteRenderer[i].sprite = null;
         }
         maquinaSpriteRenderer.sprite = maquinaIsOpen;
         machineAnim.SetBool("startMovingMAchine", true);
         GameObject viga  = GameObject.Find("GiantBlocker");
         GameObject viga2 = GameObject.Find("GiantBlocker (1)");
         viga.SetActive(false);
         viga2.SetActive(false);
         if (switchObj != null)
         {
             switchObj.ActivateSwitch();
             Planner planner = FindObjectOfType <Planner> ();
             planner.Monitor();
         }
     }
 }
Example #2
0
 public void CheckIfReady(PlannerSwitch switchObj, Planner planner)
 {
     foreach (Switch switchi in switchs)
     {
         if (!switchi.on)
         {
             return;
         }
     }
     CallAction();
     if (switchObj != null)
     {
         switchObj.ActivateSwitch();
         planner.Monitor();
     }
 }