void Start() { x = wall_x.GetComponent <Animator>(); y = wall_z.GetComponent <Animator>(); locatePoints = new locatePoint[4]; for (int i = 0; i < 4; i++) { locatePoints[i] = new locatePoint(locatePoints_obj[i], user); } }
private void DoSwitch(locatePoint point, GameObject wall, GameObject target1, GameObject target2) { GameObject[] virtualWalls = new GameObject[] { target1, target2 }; //do x if (wall == wall_x) { if (point.trigger_x) { print("trigger_x on"); if (user.transform.position.x > point.obj.transform.position.x) { SwitchWall(wall, virtualWalls, 0); } else { SwitchWall(wall, virtualWalls, 1); } } } else { //do z if (point.trigger_z) { print("trigger_z on"); if (user.transform.position.z > point.obj.transform.position.z) { SwitchWall(wall, virtualWalls, 0); } else { SwitchWall(wall, virtualWalls, 1); } } } }