public void MoveBoat(BoatController boat) { Complete = SSActionEventType.Started; CCMoveToAction boatAction = CCMoveToAction.GetAction(boat.getDestination(), boat.getSpeed()); this.addAction(boat.getGameobj(), boatAction, this); boat.ChangeState(); }
public void MoveDisk(Disk disk) { ++count; Complete = SSActionEventType.Started; CCMoveToAction diskAction = CCMoveToAction.GetAction(disk.Speed); this.addAction(disk.gameObject, diskAction, this); }
public void BoatMove(Boat boat) { complete = SSActionEventType.Started; Vector3 destination = boat.gameObject.transform.position; destination.x = -destination.x; CCMoveToAction action = CCMoveToAction.GetAction(destination, boat.speed); AddAction(boat.gameObject, action, this); boat.onLeft = !boat.onLeft; }
public void MoveCharacter(MyCharacterController character, Vector3 destination) { Complete = SSActionEventType.Started; Vector3 currentPos = character.getPosition(); Vector3 middlePos = currentPos; if (destination.y > currentPos.y) // two step { middlePos.y = destination.y; } else { middlePos.x = destination.x; } SSAction action1 = CCMoveToAction.GetAction(middlePos, character.getSpeed()); SSAction action2 = CCMoveToAction.GetAction(destination, character.getSpeed()); SSAction seqAction = CCSequenceAction.GetAction(1, 0, new List <SSAction> { action1, action2 }); this.addAction(character.getGameobj(), seqAction, this); }
public void UpDownBoat(Character character, Vector3 destination) { complete = SSActionEventType.Started; Vector3 position = character.gameObject.transform.position; Vector3 middle = position; if (destination.y > position.y) { middle.y = destination.y; } else { middle.x = destination.x; } SSAction action1 = CCMoveToAction.GetAction(middle, character.speed); SSAction action2 = CCMoveToAction.GetAction(destination, character.speed); SSAction sequence = CCSequenceAction.GetAction(1, 0, new List <SSAction> { action1, action2 }); this.AddAction(character.gameObject, sequence, this); }