Esempio n. 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "IA" || collision.gameObject.tag == "IA2")
     {
         FSM_IA ia = collision.gameObject.GetComponent <FSM_IA>();
         ia.floor = floor;
     }
 }
Esempio n. 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "IA" || collision.gameObject.tag == "IA2")
     {
         FSM_IA ia = collision.gameObject.GetComponent <FSM_IA>();
         if (ia._grounded && ia.canJump)
         {
             ia.Jump();
         }
     }
 }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     effector = GetComponent <PlatformEffector2D>();
     if (GameObject.FindGameObjectWithTag("IA"))
     {
         IAPlayer1 = GameObject.FindGameObjectWithTag("IA").GetComponent <FSM_IA>();
     }
     if (GameObject.FindGameObjectWithTag("IA2"))
     {
         IAPlayer2 = GameObject.FindGameObjectWithTag("IA2").GetComponent <FSM_IA>();
     }
 }