// Update is called once per frame public override void Update() { if (role != null && role.transform.position.z * gameObjects.boatSign > 0) { return; } if (role != null && role.transform.parent != null) { getOnShore(role); } else if (gameObjects.boatCapcity() > 0) { getOnBoat(role); } }
// Update is called once per frame public override void Update() { if (gameObjects.boatCapcity() < 2) { if (gameObjects.boatSign == 1) { gameObjects.boat.transform.position = gameObjects.boatPositionRight; } else { gameObjects.boat.transform.position = gameObjects.boatPositionLeft; } gameObjects.boatSign = -gameObjects.boatSign; } gameObjects.check(); }