//--------------------------------------------------------------- //--------------------------------------------------------------- private void PauseHanding() { if (Input.GetKeyUp(KeyCode.Escape) && (Time.timeScale == 1)) { PauseGame(); } else if (Input.GetKeyUp(KeyCode.Escape) && (Time.timeScale == 0 && Prisoner.GetIsCastingSkill())) { PauseGame(); } else if (Input.GetKeyUp(KeyCode.Escape) && (Time.timeScale == 0)) { ResumeGame(); } }
//--------------------------------------------------------------- void Update() { if (!bCanMove) { print("freezed now"); freezedTime -= Time.deltaTime; if (freezedTime <= 0) { GetComponent <SpriteRenderer>().color = Color.white; bCanMove = true; } return; } if (bIsConfused) { confusionTime -= Time.deltaTime; paddleDirection = -1; if (confusionTime <= 0) { GetComponent <SpriteRenderer>().color = Color.white; paddleDirection = 1; bIsConfused = false; } } //Can control paddle if game is not paused by skill shooting if (!Prisoner.GetIsCastingSkill() && (Time.timeScale == 1)) { if (isPlayWithMouse) { PlayWithMouse(); } else { PlayWithArrow(); } } }
//--------------------------------------------------------------- private void OnMouseDown() { //Disable this function if someprisoner is casting skill if (Prisoner.GetIsCastingSkill() || //Or the stage is clear (UITextController.GetUITextStatusType() == UITextController.DISPLAY_TEXT.CLEAR) || (UITextController.GetUITextStatusType() == UITextController.DISPLAY_TEXT.LOSE) || UITextController.GetUITextStatusType() == UITextController.DISPLAY_TEXT.WAVE) { return; } if (skillCoolDownTime <= 0 && (Time.timeScale == 1)) { tapTimes++; if (tapTimes >= tapTimesToUseSkill) { skillCastingEffect.StartEffect(); MakeThisCasterStandOut(); ShowSkillCastEffect(); tapTimes = 0; } } mouseIsDown = true; }