private void OnTriggerEnter(Collider other) { if (other.tag.CompareTo("Slider") == 0) { slider = other.gameObject; //print("slider enter:" + other.gameObject.name); GameObject wall = other.gameObject.transform.parent.gameObject; List <Animator> statesList = statesController.GetStatesList(); foreach (Animator states in statesList) { if (states.GetCurrentAnimatorStateInfo(0).IsName("Wall")) { if (states.GetBehaviour <Wall_State>().GetWall() == wall) { print("door wall is " + wall.name); robotic_wall_states = states; states.SetBool("SliderEnterDoor", true); states.GetBehaviour <DoorFrameState>().SetFrame(this.gameObject.transform.GetChild(0).gameObject); states.GetBehaviour <DoorFrameState>().SetDoorWall(wall); //states.GetBehaviour<DoorFrameState>().SetSlider(other.gameObject); } } } } }
// Use this for initialization void Start() { statesController = GameObject.Find("StatesController").GetComponent <FSMSystem>(); statesList = statesController.GetStatesList(); user = GameObject.Find("Camera (eye)").gameObject; robotic_wall_states = null; elevator = null; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { robotic_wall.Set_Robotic_Wall(animator.gameObject); statesController = GameObject.Find("StatesController").GetComponent <FSMSystem>(); statesList = statesController.GetStatesList(); wall_requester = GameObject.Find("User_Encounter_Area").GetComponent <Wall_Requester>(); //put the wall which the elevator setteled in to sloved List ele_wall = GameObject.Find("Wall_Elevator_True"); eleva = animator.GetBehaviour <ElevatorState>().GetElevator(); ele_requester = eleva.GetComponent <Elevator_Requester>(); Debug.Log("eleva =" + ele_wall.name); wall_requester.SetWallSolved(ele_wall); ele_requester.AllocateElevator(animator); }
// Use this for initialization void Start() { statesController = GameObject.Find("StatesController").GetComponent <FSMSystem>(); statesList = statesController.GetStatesList(); }
// Use this for initialization void Start() { statesController = GameObject.Find("StatesController").GetComponent <FSMSystem>(); statesList = statesController.GetStatesList(); red = GetComponent <Renderer>().material; }