/// <summary> /// Shows or hides the instructions /// </summary> /// <param name="show"></param> public void ShowInstructions(bool show) { if (show) { #if UNITY_3_5 instructionsAnimation.gameObject.active = true; #else instructionsAnimation.gameObject.SetActive(true); #endif } else { #if UNITY_3_5 if (instructionsAnimation.gameObject.active) { instructionsAnimation.Play("Dismiss"); } #else if (instructionsAnimation.gameObject.activeSelf) { instructionsAnimation.Play("Dismiss"); } #endif } }
// Update is called once per frame void Update() { switch (animationType) { case AnimationType.拖曳引導: this.transform.position = 拖曳引導位置; boneAnimation.Play(AnimationType.拖曳引導.ToString()); break; case AnimationType.指向引導_操作區潑墨: this.transform.position = 指向引導位置_操作區潑墨; //this.transform.eulerAngles = new Vector3(0, 0, 0); boneAnimation.Play("指向引導2"); break; case AnimationType.指向引導_操作區物件: this.transform.position = 指向引導位置_操作區物件; //this.transform.eulerAngles = new Vector3(0, 0, 0); boneAnimation.Play("指向引導"); break; case AnimationType.指向引導_畫布區物件: this.transform.position = 指向引導位置_馬樹類; //this.transform.eulerAngles = new Vector3(0, 0, 0); boneAnimation.Play("指向引導3"); break; case AnimationType.指向引導_光源土坡類: this.transform.position = 指向引導位置_土坡類; this.transform.eulerAngles = new Vector3(0, 0, 90); boneAnimation.Play("指向引導"); break; case AnimationType.指向引導_光源操作區潑墨: this.transform.position = 指向引導位置_操作區潑墨; this.transform.eulerAngles = new Vector3(0, 0, 0); boneAnimation.Play("指向引導"); break; case AnimationType.指向引導_馬樹類: this.transform.position = 指向引導位置_馬樹類; //this.transform.eulerAngles = new Vector3(0, 0, 90); boneAnimation.Play("指向引導1"); break; case AnimationType.太陽引導: this.transform.position = 太陽引導位置; this.transform.eulerAngles = new Vector3(0, 0, 0); boneAnimation.Play(AnimationType.太陽引導.ToString()); break; case AnimationType.空動畫: boneAnimation.Play(AnimationType.空動畫.ToString()); break; } }
/// <summary> /// 開啟當前階段的提示 /// </summary> /// <param name="currentStage">目前進行階段</param> public void ShowStageHint(DrawStage currentStage) { this.currentStageHintObject = (GameObject)Instantiate(this.StageHintObject); SmoothMoves.BoneAnimation boneAnimation = this.currentStageHintObject.GetComponent <SmoothMoves.BoneAnimation>(); boneAnimation.playAutomatically = false; boneAnimation.Play(currentStage.ToString()); }
/// <summary> /// Animates when a new weapon is available /// </summary> public void ShowNewWeaponAvailable(bool show) { if (show) { newWeaponAvailableAnimation.gameObject.active = true; newWeaponAvailableAnimation.Play("Show"); } else { newWeaponAvailableAnimation.gameObject.active = false; } }
/// <summary> /// Shows or hides the game over text /// </summary> public void ShowGameOver(bool show) { if (show) { gameOverAnimation.gameObject.SetActiveRecursively(true); gameOverAnimation.Play("Game_Over"); } else { gameOverAnimation.gameObject.SetActiveRecursively(false); } }
// Update is called once per frame void Update() { switch (animationType) { case AnimationType.畫布上方太陽: boneAnimation.Play(AnimationType.畫布上方太陽.ToString()); break; case AnimationType.畫布閃爍圖片: boneAnimation.Play(AnimationType.畫布閃爍圖片.ToString()); break; case AnimationType.操作閃爍圖片: boneAnimation.Play(AnimationType.操作閃爍圖片.ToString()); break; case AnimationType.操作閃爍潑墨: boneAnimation.Play(AnimationType.操作閃爍潑墨.ToString()); break; case AnimationType.拖曳操作畫布: boneAnimation.Play(AnimationType.拖曳操作畫布.ToString()); break; case AnimationType.空動畫: boneAnimation.Play(AnimationType.空動畫.ToString()); break; } }
/// <summary> /// Shows or hides the instructions /// </summary> /// <param name="show"></param> public void ShowInstructions(bool show) { if (show) { instructionsAnimation.gameObject.active = true; } else { if (instructionsAnimation.gameObject.active) { instructionsAnimation.Play("Dismiss"); } } }
/// <summary> /// 切換作畫階段 /// </summary> /// <param name="nextStage">下一階段</param> public void ChangeDrawStage(DrawStage nextStage) { if (nextStage == DrawStage.等待中) { return; } if (this.currentStageHintObject != null) { Destroy(this.currentStageHintObject); } this.物件區背景.SetActive(false); if (nextStage == DrawStage.寄信) { this.CurrentDrawStage = DrawStage.等待中; this.現代郎世寧.SetActive(false); //將左上"現代郎世寧"關閉 this.截圖使用物件.SetActive(true); //開啟"截圖使用物件" State.script.光源的控制桿.SetActive(false); ScreenShot.script.RunScreenCapture(); return; } else if (nextStage == DrawStage.簽名) { this.CurrentDrawStage = DrawStage.簽名; this.現代郎世寧.SetActive(false); //將左上"現代郎世寧"關閉 this.截圖使用物件.SetActive(true); //開啟"截圖使用物件" State.script.光源的控制桿.SetActive(false); this.簽名物件.SetActive(true); return; } GameObject obj = (GameObject)Instantiate(this.TitleShowObject); SmoothMoves.BoneAnimation boneAnimation = obj.GetComponent <SmoothMoves.BoneAnimation>(); boneAnimation.playAutomatically = false; boneAnimation.Play(nextStage.ToString()); //開頭動畫狀態進行觸碰事件偵測 if (nextStage == DrawStage.開頭動畫) { this.CurrentDrawStage = DrawStage.開頭動畫; } else { this.CurrentDrawStage = DrawStage.等待中; } }
/// <summary> /// Animates when a new weapon is available /// </summary> public void ShowNewWeaponAvailable(bool show) { if (show) { #if UNITY_3_5 newWeaponAvailableAnimation.gameObject.active = true; #else newWeaponAvailableAnimation.gameObject.SetActive(true); #endif newWeaponAvailableAnimation.Play("Show"); } else { #if UNITY_3_5 newWeaponAvailableAnimation.gameObject.active = false; #else newWeaponAvailableAnimation.gameObject.SetActive(false); #endif } }
/// <summary> /// Shows or hides the game over text /// </summary> public void ShowGameOver(bool show) { if (show) { #if UNITY_3_5 gameOverAnimation.gameObject.SetActiveRecursively(true); #else gameOverAnimation.gameObject.SetActive(true); #endif gameOverAnimation.Play("Game_Over"); } else { #if UNITY_3_5 gameOverAnimation.gameObject.SetActiveRecursively(false); #else gameOverAnimation.gameObject.SetActive(false); #endif } }
// Update is called once per frame void Update() { switch (pictureType) { case PictureType.空: boneAnimation.Play("空", PlayMode.StopAll); break; case PictureType.馬1顏色1: boneAnimation.Play("馬1顏色1", PlayMode.StopAll); break; case PictureType.馬1顏色2: boneAnimation.Play("馬1顏色2", PlayMode.StopAll); break; case PictureType.馬1顏色3: boneAnimation.Play("馬1顏色3", PlayMode.StopAll); break; case PictureType.馬2顏色1: boneAnimation.Play("馬2顏色1", PlayMode.StopAll); break; case PictureType.馬2顏色2: boneAnimation.Play("馬2顏色2", PlayMode.StopAll); break; case PictureType.馬2顏色3: boneAnimation.Play("馬2顏色3", PlayMode.StopAll); break; case PictureType.馬3顏色1: boneAnimation.Play("馬3顏色1", PlayMode.StopAll); break; case PictureType.馬3顏色2: boneAnimation.Play("馬3顏色2", PlayMode.StopAll); break; case PictureType.馬3顏色3: boneAnimation.Play("馬3顏色3", PlayMode.StopAll); break; case PictureType.樹1顏色1: boneAnimation.Play("樹1顏色1", PlayMode.StopAll); break; case PictureType.樹1顏色2: boneAnimation.Play("樹1顏色2", PlayMode.StopAll); break; case PictureType.樹1顏色3: boneAnimation.Play("樹1顏色3", PlayMode.StopAll); break; case PictureType.樹2顏色1: boneAnimation.Play("樹2顏色1", PlayMode.StopAll); break; case PictureType.樹2顏色2: boneAnimation.Play("樹2顏色2", PlayMode.StopAll); break; case PictureType.樹2顏色3: boneAnimation.Play("樹2顏色3", PlayMode.StopAll); break; } }