public void reset(CCActionManager actionManager) { nameOfPeopleOnBoat [0] = nameOfPeopleOnBoat [1] = ""; size = defaultSize; CCBoatMoveing boatMove = CCBoatMoveing.GetSSAction(); boatMove.aim = rightPos; actionManager.RunAction(boat, boatMove, null); size = "right"; }
public void move(CCActionManager actionManager) { CCBoatMoveing boatMove = CCBoatMoveing.GetSSAction(10f); if (size == "right") { boatMove.aim = leftPos; size = "left"; } else { boatMove.aim = rightPos; size = "right"; } actionManager.RunAction(boat, boatMove, null); }
// Update is called once per frame protected new void Update() { if (Input.GetMouseButtonDown(0) && sceneController.game == 0) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.transform.tag == "Devil" || hit.transform.tag == "Priest") { if (hit.collider.gameObject == sceneController.boat[0] || hit.collider.gameObject == sceneController.boat[1]) { if (hit.collider.gameObject == sceneController.boat[0]) { getoffB = CCGetOffBoat.GetSSAction(0); this.RunAction(hit.collider.gameObject, getoffB, this); } else { getoffB = CCGetOffBoat.GetSSAction(1); this.RunAction(hit.collider.gameObject, getoffB, this); } } else { getonA = CCGetOnTheBoat.GetSSAction(); this.RunAction(hit.collider.gameObject, getonA, this); } } else if (hit.transform.tag == "Boat" && sceneController.boatCapacity != 2) { print(hit.transform.tag); boatmovingC = CCBoatMoveing.GetSSAction(); this.RunAction(hit.collider.gameObject, boatmovingC, this); } } } base.Update(); }