/// <summary> /// 重新播放动画. /// </summary> public void ReplayStartCartoon() { if (m_BeijingAudio.isPlaying) { return; } AudioListener.volume = AudioVolume; m_HasPlay = false; m_CameraShake.camera.enabled = false; transform.forward = Vector3.Normalize(NextPos - StartPos); transform.position = StartPos; m_EndTextureTimmer = 0f; m_LiangTimmer = 0f; if (!m_BeijingAudio.isPlaying) { m_BeijingAudio.Play(); } if (mLoading.mLedAudioScript != null) { mLoading.mLedAudioScript.OpenChangeLedState(); } ShowAllDaoJuListObj(); ResetEndTextureScale(); m_HuiEffect.saturation = HuiEffectSaturation; m_EndTexture.SetActive(false); ITweenEventCom.Start(); Invoke("DelayOpenPlayerCamera", 0f); }
void ReplayStartCartoon() { if (m_BeijingAudio.isPlaying) { return; } m_HasPlay = false; m_CameraShake.camera.enabled = false; transform.forward = Vector3.Normalize(NextPos - StartPos); transform.position = StartPos; m_EndTextureTimmer = 0f; m_LiangTimmer = 0f; if (!m_BeijingAudio.isPlaying) { m_BeijingAudio.Play(); } ShowAllDaoJuListObj(); ResetEndTextureScale(); m_HuiEffect.saturation = HuiEffectSaturation; m_EndTexture.SetActive(false); ITweenEventCom.Start(); Invoke("DelayOpenPlayerCamera", 0.5f); }
// private bool m_hasplay = false; void OnTriggerEnter(Collider other) { if (other.tag == "finish") { m_PlayerAnimator.speed = 3.8f / Time.timeScale; // m_IsFinished = true; m_PlayerAnimator.SetBool("IsFinish", true); m_PlayerAnimator.SetBool("IsRoot", false); } if (other.tag == "zhangai") { m_PlayerAnimator.SetTrigger("IsZhuang"); m_CameraShake.setCameraShakeImpulseValue(); m_HitStone.Play(); GameObject temp = (GameObject)Instantiate(m_HitEffectObj, transform.position, transform.rotation); Destroy(temp, 2.0f); } if (other.tag == "texiao0") { m_PlayerAnimator.SetTrigger("IsQifei"); m_FeibanAudio.Play(); // m_TeXiao0Audio.Play(); GameObject temp = (GameObject)Instantiate(m_TeXiao0Audio, transform.position, transform.rotation); Destroy(temp, 3.0f); } if (other.tag == "texiao1") { m_PlayerAnimator.SetTrigger("IsDiaoluo"); m_FeibanAudio.Play(); // m_TeXiao1Audio.Play(); GameObject temp = (GameObject)Instantiate(m_TeXiao1Audio, transform.position, transform.rotation); Destroy(temp, 3.0f); } if (other.tag == "texiao2") { //Debug.Log("IsZuantoufjkfjfkl"); m_PlayerAnimator.SetTrigger("IsZuantou"); if (!m_Isdapubu) { m_FeibanAudio.Play(); GameObject temp = (GameObject)Instantiate(m_TeXiao2Audio, transform.position, transform.rotation); Destroy(temp, 4.2f); } else { m_Isdapubu = false; } } if (other.tag == "texiao3") { m_PlayerAnimator.SetTrigger("IsTaitou"); m_FeibanAudio.Play(); // m_TeXiao3Audio.Play(); GameObject temp = (GameObject)Instantiate(m_TeXiao3Audio, transform.position, transform.rotation); Destroy(temp, 3.0f); } if (other.tag == "texiao4") { m_PlayerAnimator.SetTrigger("IsDianshan"); m_FeibanAudio.Play(); // m_TeXiao4Audio.Play(); GameObject temp = (GameObject)Instantiate(m_TeXiao4Audio, transform.position, transform.rotation); Destroy(temp, 4.2f); } if (other.tag == "texiao5") { m_Isdapubu = true; m_PlayerAnimator.SetTrigger("IsTaitou"); m_FeibanAudio.Play(); GameObject temp = (GameObject)Instantiate(m_FeibanEffectObj, transform.position, transform.rotation); Destroy(temp, 2.0f); } if (other.tag == "texiaoyin") { // m_Isdapubu = true; // m_PlayerAnimator.SetTrigger("IsTaitou"); m_FeibanAudio.Play(); } if (other.tag == "left") { m_PlayerAnimator.SetBool("IsTurnleft", true); m_PlayerAnimator.SetBool("IsTurnRight", false); m_PlayerAnimator.SetBool("IsRoot", false); m_PlayerAnimator.speed = 1.0f / Time.timeScale; //Debug.Log("m_PlayerAnimator.speed" + m_PlayerAnimator.speed); } if (other.tag == "right") { m_PlayerAnimator.SetBool("IsTurnRight", true); m_PlayerAnimator.SetBool("IsTurnleft", false); m_PlayerAnimator.SetBool("IsRoot", false); m_PlayerAnimator.speed = 1.0f / Time.timeScale; //Debug.Log("m_PlayerAnimator.speed" + m_PlayerAnimator.speed); } if (other.tag == "root") { //m_PlayerAnimator.speed = 1.0f/Time.timeScale; m_PlayerAnimator.SetBool("IsDianshan1", false); m_PlayerAnimator.SetBool("IsRoot", true); m_PlayerAnimator.SetBool("IsTurnRight", false); m_PlayerAnimator.SetBool("IsTurnleft", false); } if (other.tag == "hitwater") { m_CameraShake.setCameraShakeImpulseValue(); m_HitWater.Play(); GameObject Tobject = (GameObject)Instantiate(m_HitWaterParticle, transform.position + transform.forward * m_BaozhaForward + Vector3.up * m_BaozhaUp, transform.rotation); Destroy(Tobject, 0.5f); } if (other.tag == "hitwater0") { // m_CameraShake.setCameraShakeImpulseValue(); m_HitWater.Play(); GameObject Tobject = (GameObject)Instantiate(m_HitWaterParticle, transform.position + transform.forward * m_BaozhaForward + Vector3.up * m_BaozhaUp, transform.rotation); Destroy(Tobject, 0.5f); } if (other.tag == "dan1") { m_EatJiasuAudio.Play(); m_JiasuAudio.Play(); GameObject temp = (GameObject)Instantiate(m_JiasuPartical, other.transform.position + transform.forward * 10.0f, other.transform.rotation); Destroy(temp, 0.5f); //Destroy(other.gameObject); CheckDaoJuListObj(other.gameObject); } if (other.tag == "dan3") { m_EatJiasuAudio.Play(); m_JiasuAudio.Play(); GameObject temp = (GameObject)Instantiate(m_JiasuPartical, other.transform.position + transform.forward, other.transform.rotation); Destroy(temp, 0.5f); //Destroy(other.gameObject); CheckDaoJuListObj(other.gameObject); } if (other.tag == "zhong") { GameObject temp = (GameObject)Instantiate(m_JiashiPartical, other.transform.position, other.transform.rotation); //Destroy(other.gameObject); CheckDaoJuListObj(other.gameObject); Destroy(temp, 0.5f); m_EatJiashiAudio.Play(); m_JiashiAudio.Play(); } if (other.tag == "paizhao0") { m_Texture[0].SetActive(true); } if (other.tag == "paizhao1") { m_Texture[1].SetActive(true); } if (other.tag == "paizhao2") { m_Texture[2].SetActive(true); } if (other.tag == "paizhao3") { m_Texture[3].SetActive(true); } if (other.tag == "paizhao4") { m_Texture[4].SetActive(true); } if (other.tag == "dianshan1") { m_PlayerAnimator.SetTrigger("IsDianshan1"); m_PlayerAnimator.SetBool("IsTurnRight", false); m_PlayerAnimator.SetBool("IsTurnleft", false); m_PlayerAnimator.SetBool("IsRoot", false); //m_PlayerAnimator.SetTrigger("IsQifei"); m_FeibanAudio.Play(); // m_TeXiao1Audio.Play(); GameObject temp = (GameObject)Instantiate(m_FeibanEffectObj, transform.position, transform.rotation); Destroy(temp, 4.2f); } if (other.tag == "offshuihua") { m_particalEffect[0].SetActive(false); m_particalEffect[1].SetActive(false); m_particalEffect[2].SetActive(false); m_ShuihuaAudio.Stop(); } if (other.tag == "openshuihua") { m_particalEffect[0].SetActive(true); m_particalEffect[1].SetActive(true); m_particalEffect[2].SetActive(true); m_ShuihuaAudio.Play(); } if (other.tag == "opencamera") { m_otherCamerCtrl.enabled = false; m_Ctrlcamera.enabled = true; } if (other.tag == "showniao") { m_niao.SetActive(true); iTweenEvent iTweenEventCom = m_niao.GetComponent <iTweenEvent>(); iTweenEventCom.Start(); } if (other.tag == "hideniao") { m_niao.SetActive(false); } if (other.tag == "hui") { m_HuiEffect.saturation = 0.0f; m_EndTexture.SetActive(true); } if (other.tag == "jianyin") { ShowHidenCtrl.m_IsOpen = true; } // if(other.tag == "changecamera") // { // iTweenEvent.GetEvent(this.gameObject,"New Path1").Stop(); // iTweenEvent.GetEvent(this.gameObject,"New Path2").Play(); // } }