void Update() { if (!isAI) { return; } if (prepareFlag) { prepare -= Time.deltaTime; } if (prepare < 0) { clawCatch.EnterCoins(); dispatcher.PayCoin(id); freeze = false; prepareFlag = false; prepare = 0; } if (freeze) { return; } Moving(); }
void Update() { // Quit if (Input.GetKeyDown("escape")) { Application.Quit(); } // Move float x = Input.GetAxis("Horizontal"); float z = Input.GetAxis("Vertical"); Vector2 inputVec2 = new Vector2(x, z); stick.SendMessage("RotateStick", inputVec2); controller.SendMessage("Move", inputVec2); // Coin if ((!coinLock) && Input.GetKeyDown("c")) { if (!dispatcher.CheckCoin(id)) { return; } if (clawCatch.EnterCoins()) { dispatcher.PayCoin(id); } } // Catch if (Input.GetKeyDown("space")) { button.SendMessage("CatchButtonDown"); controller.SendMessage("Stretch"); } if (Input.GetKeyUp("space")) { button.SendMessage("CatchButtonUp"); } // Camera Move if (Input.GetKey("q") && Input.GetKey("e")) { } else if (Input.GetKey("q")) { mainCamera.SendMessage("RotateCamera", 1); } else if (Input.GetKey("e")) { mainCamera.SendMessage("RotateCamera", -1); } }