// Use this for initialization void Start() { _Instance = this; AnimatorCom = GetComponent <Animator>(); Transform rootObj = transform.root; AutoFireScript = rootObj.GetComponentInChildren <PlayerAutoFire>(); ActionCtrlSript = rootObj.GetComponent <PlayerAiActionCtrl>(); }
public void ShowFinishPanel() { if (gameObject.activeSelf) { return; } gameObject.SetActive(true); IsCanLoadSetPanel = false; GameCtrlXK.IsStopMoveAiPlayer = true; //Debug.Log("ShowFinishPanel*************"); if (GlobalData.GetInstance().gameMode == GameMode.SoloMode) { //Show JiaShiLevel EventDelegate.Add(FinishTScl.onFinished, delegate { Invoke("ActiveJiaShiLevel", 0.5f); }); AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioGameHuanHu); ZhuJiaoNan.GetInstance().PlayWinAction(); } else { EventDelegate.Add(FinishTScl.onFinished, delegate { Invoke("InitShowFinishRankCtrl", 0f); }); if (WaterwheelPlayerNetCtrl.GetInstance().GetIsRunToEndPoint()) { AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioGameHuanHu); WaterwheelPlayerNetCtrl.GetInstance().PlayZhuJiaoNanWinAction(); } else { AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioGameShiBai); WaterwheelPlayerNetCtrl.GetInstance().PlayZhuJiaoNanFailAction(); //Debug.Log("******************************fail"); } } FinishTScl.enabled = true; AudioManager.Instance.PlaySFX(AudioListCtrl.GetInstance().AudioFinishPanel); //Invoke("InitHiddenFinishPanel", 3f); //test }
public void ShowGameOverImg() { if (GameOverImgSprite.enabled) { return; } AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioGameShiBai); AudioManager.Instance.PlaySFX(AudioListCtrl.GetInstance().AudioGameOver); if (GlobalData.GetInstance().gameMode == GameMode.SoloMode) { ZhuJiaoNan.GetInstance().PlayFailAction(); } else { WaterwheelPlayerNetCtrl.GetInstance().PlayZhuJiaoNanFailAction(); } GameOverImg.SetActive(true); GameOverImg.transform.localScale = new Vector3(10f, 10f, 1f); GameOverImgSprite.enabled = true; GameOverImgTScl.enabled = true; Invoke("HiddenQuWeiGameOverImg", 1f); }
// Use this for initialization void Start() { ChuanShenScript = GetComponentInChildren <ChuanShenCtrl>(); ZhuJiaoNanScript = GetComponentInChildren <ZhuJiaoNan>(); netView = GetComponent <NetworkView>(); if (AimMarkDataScript == null) { AimMarkDataScript = gameObject.AddComponent <PlayerAimMarkData>(); } PlayerObj = gameObject; PlayerTran = transform; RigObj = GetComponent <Rigidbody>(); RigObj.isKinematic = true; SetRankPlayerArray(); mGameTime = 1000; CreatePlayerNeedObj(); AiPathCtrlTran = GameCtrlXK.GetInstance().AiPathCtrlTran.GetChild(0); AimMarkTran = AiPathCtrlTran.GetChild(0); if (AimMarkTran != null) { AiMark markAimScript = AimMarkTran.GetComponent <AiMark>(); AiPathCtrl pathScript = AiPathCtrlTran.GetComponent <AiPathCtrl>(); SetPlayerAimMarkData(pathScript.PathIndex, markAimScript.getMarkCount(), PlayerTran.name); } mBakeTimePointPos = AimMarkTran.position; mBakeTimePointPos += Vector3.up * 0.5f; mBakeTimePointRot = AimMarkTran.forward; if (GameCtrlXK.GetInstance().PlayerMarkTest != null) { AiPathCtrlTran = GameCtrlXK.GetInstance().PlayerMarkTest.parent; AiMark markScript = GameCtrlXK.GetInstance().PlayerMarkTest.GetComponent <AiMark>(); AimMarkTran = markScript.mNextMark; if (AimMarkTran != null) { AiMark markAimScript = AimMarkTran.GetComponent <AiMark>(); AiPathCtrl pathScript = AiPathCtrlTran.GetComponent <AiPathCtrl>(); SetPlayerAimMarkData(pathScript.PathIndex, markAimScript.getMarkCount(), PlayerTran.name); } TestPosCount++; Transform posTran = GameCtrlXK.GetInstance().PlayerMarkTest; mBakeTimePointRot = posTran.forward; mBakeTimePointRot.y = 0f; switch (TestPosCount) { case 1: mBakeTimePointPos = posTran.position - posTran.right * 9f + mBakeTimePointRot; break; case 2: mBakeTimePointPos = posTran.position + posTran.right * 9f + mBakeTimePointRot; break; case 3: mBakeTimePointPos = posTran.position - posTran.right * 6f + mBakeTimePointRot * 4f; break; case 4: mBakeTimePointPos = posTran.position + posTran.right * 6f + mBakeTimePointRot * 4f; break; case 5: mBakeTimePointPos = posTran.position - posTran.right * 3f + mBakeTimePointRot * 7f; break; case 6: mBakeTimePointPos = posTran.position + posTran.right * 3f + mBakeTimePointRot * 7f; break; case 7: mBakeTimePointPos = posTran.position + mBakeTimePointRot * 10f; TestPosCount = 0; break; } mBakeTimePointPos += Vector3.up * 0.5f; PlayerTran.position = mBakeTimePointPos; PlayerTran.forward = mBakeTimePointRot; } }
// Use this for initialization void Start() { netView = GetComponent <NetworkView>(); ChuanShenScript = GetComponentInChildren <ChuanShenCtrl>(); ZhuJiaoNanScript = GetComponentInChildren <ZhuJiaoNan>(); }
// Use this for initialization void Start() { _Instance = this; pcvr.DongGanState = 1; PlayerZhuanXiangVal = GameCtrlXK.PlayerZhuanXiangPTVal; if (IsTestShootCartoon) { return; } if (HuanYingFuObj == null) { Debug.LogError("HuanYingFuObj is null"); HuanYingFuObj.name = "null"; } else { HuanYingFuObj.SetActive(false); } PlayerTran = transform; rigObj = GetComponent <Rigidbody>(); if (GetComponent <Animator>() != null) { Debug.LogWarning("Player Animator should be remove"); PlayerTran = null; PlayerTran.name = "null"; } AutoFireScript = GetComponent <PlayerAutoFire>(); ScreenWaterParticle.gameObject.SetActive(false); ChuanShenScript = GetComponentInChildren <ChuanShenCtrl>(); ChuanLunZiScript = GetComponentInChildren <ChuanLunZiCtrl>(); ZhuJiaoNanScript = GetComponentInChildren <ZhuJiaoNan>(); mGameTime = 1000; SetCamAimInfo(); CreatePlayerNeedObj(); AiPathCtrlTran = GameCtrlXK.GetInstance().AiPathCtrlTran.GetChild(0); AutoFireScript.SetPathKeyState(AiPathCtrlTran.GetComponent <AiPathCtrl>()); AimMarkTran = AiPathCtrlTran.GetChild(0); mBakeTimePointPos = AimMarkTran.position; mBakeTimePointRot = AimMarkTran.forward; AutoFireScript.SetPlayerPreMark(AimMarkTran); CreateFlyNpcAimCube(); if (GameCtrlXK.GetInstance().PlayerMarkTest != null) { AiPathCtrlTran = GameCtrlXK.GetInstance().PlayerMarkTest.parent; AutoFireScript.SetPathKeyState(AiPathCtrlTran.GetComponent <AiPathCtrl>()); AimMarkTran = GameCtrlXK.GetInstance().PlayerMarkTest; mBakeTimePointPos = AimMarkTran.position; mBakeTimePointRot = AimMarkTran.forward; AutoFireScript.SetPlayerPreMark(AimMarkTran); PlayerTran.position = mBakeTimePointPos; PlayerTran.forward = mBakeTimePointRot; } }