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; } }
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(); } } }
// 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>(); } }