Exemplo n.º 1
0
 public void SetCurrentState(Robot_BaseState state)
 {
     parent_object.GetComponent <Rigidbody2D>().velocity = Vector2.zero;
     if (current_state != null)
     {
         current_state.gameObject.SetActive(false);
     }
     current_state = state;
     current_state.gameObject.SetActive(true);
 }
Exemplo n.º 2
0
 //setter
 public void SetCurrentState(ROBOT_STATES state)
 {
     states_enum = state;
     parent_object.GetComponent <Rigidbody2D>().velocity = Vector2.zero;
     if (current_state != null)
     {
         current_state.gameObject.SetActive(false);
     }
     current_state = states[(int)states_enum];
     current_state.gameObject.SetActive(true);
 }