Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (resetNextFrame)
     {
         actifP         = null;
         actifS         = null;
         resetNextFrame = false;
     }
     if (estValableS)
     {
         /*
          * texture = GetComponent
          * mesh.material.mainTexture =
          */
         GetComponent <Renderer>().material.color = Color.yellow;
     }
     else
     {
         if (estValableP)
         {
             GetComponent <Renderer>().material.color = Color.green;
         }
         else if (lockActive)
         {
             GetComponent <Renderer>().material.color = Color.cyan;
         }
         else
         {
             GetComponent <Renderer>().material.color = Color.white;
         }
     }
 }
Beispiel #2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (lockActive)
     {
         return;
     }
     if (collision.gameObject.name == "Grimace2.0")
     {
         if (estValableS)
         {
             actifS = this;
             if (actifP && actifS)
             {
                 lockActive = true;
                 actifS.setTuileSuivante();
                 actifP.setTuileSuivante();
             }
         }
         else
         {
             collision.gameObject.GetComponent <DeplacementAllie>().estMort = true;
         }
     }
     if (collision.gameObject.name == "Jacob4.0")
     {
         if (estValableP)
         {
             actifP = this;
             if (actifP && actifS)
             {
                 lockActive = true;
                 actifS.setTuileSuivante();
                 actifP.setTuileSuivante();
             }
         }
         else
         {
             collision.gameObject.GetComponent <DeplacementJacob>().estMort = true;
         }
     }
 }
Beispiel #3
0
 public void OnCollisionExit(Collision collision)
 {
     if (lockActive)
     {
         return;
     }
     if (collision.gameObject.name == "Grimace2.0")
     {
         if (actifS)
         {
             actifS = null;
         }
     }
     if (collision.gameObject.name == "Jacob4.0")
     {
         if (actifP)
         {
             actifP = null;
         }
     }
 }