protected override void Awake() { base.Awake(); animationMeshRenderer = this.GetComponent <Renderer>() as MeshRenderer; m_AnimationPlayer = GetComponent <GuiPlaneAnimationPlayer>(); m_AnimationPlayer.playMode = GuiPlaneAnimationPlayer.PlayMode.Mode_PlayLoop; m_AnimationPlayer.IsAutoPlay = true; m_AnimationPlayer.IsAutoDel = false; }
public void SetFloatRollValue(float targetValue, bool isDirect) { if (isDirect) { Text = string.Format("{0:0.00}", targetValue); return; } currentRollNumberType = RollNumberType.Type_Float; currentFloatValue[(int)NumberIndex.Index_CurrentNumber] = Convert.ToSingle(Text); currentFloatValue[(int)NumberIndex.Index_TargetNumber] = targetValue; GuiPlaneAnimationPlayer player = this.GetComponent <GuiPlaneAnimationPlayer>(); player.Stop(); player.Play(); }
public void SetIntegerRollValue(int targetValue, bool isDirect) { if (isDirect) { Text = targetValue.ToString(); return; } currentRollNumberType = RollNumberType.Type_Integer; currentIntegerValue[(int)NumberIndex.Index_CurrentNumber] = Convert.ToInt32(Text); currentIntegerValue[(int)NumberIndex.Index_TargetNumber] = targetValue; GuiPlaneAnimationPlayer player = this.GetComponent <GuiPlaneAnimationPlayer>(); player.Stop(); player.Play(); }
//初始化函数 public override void Initialization() { base.Initialization(); //显示公司LOGO //版本说明界面等 //最后进入游戏 //载入贴图 CompanyLogoTexture = new Texture[SystemCommand.CompanyLogoOrder.Length]; for (int i = 0; i < CompanyLogoTexture.Length; i++) { CompanyLogoTexture[i] = GameRoot.gameResource.LoadLanguageResource_Texture(SystemCommand.CompanyLogoOrder[i], typeof(Texture)); } CompanyLogobackground = GameRoot.uiOrthographicCamera.LoadResource_UIPrefabs("CompanyLogobackground.prefab", GameRoot.gameResource); CompanyLogoPlayer = GameRoot.uiOrthographicCamera.LoadResource_UIPrefabs("CompanyLogo.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); PlayerOneCompanyLogo(0); }
//初始化界面UI public void InitUI() { m_ShowInsertCoins = new GuiPlaneAnimationPlayer[2]; m_ShowEnterJionGame = new GuiPlaneAnimationPlayer[2]; m_GameCoins = new GuiPlaneAnimationText[2]; m_GameCoinsDeno = new GuiPlaneAnimationText[2]; m_WaitMeUI = new GameObject[2]; m_GameComLogo = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("LOGO.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); m_ShowInsertCoins[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_InsertCoins_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); m_ShowInsertCoins[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_InsertCoins_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); m_ShowEnterJionGame[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_EnterJionGame_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); m_ShowEnterJionGame[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_EnterJionGame_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationPlayer>(); m_GameCoins[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>(); m_GameCoins[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>(); m_GameCoinsDeno[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Denominator_Left.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>(); m_GameCoinsDeno[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Coins_Denominator_Right.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationText>(); //m_PlayerIdBearPrefabControl[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerIdBearPrefab_XiongDa.prefab", GameRoot.gameResource).GetComponent<PlayerIdBearPrefabControl>(); //m_PlayerIdBearPrefabControl[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerIdBearPrefab_Xiong2.prefab", GameRoot.gameResource).GetComponent<PlayerIdBearPrefabControl>(); m_PlayerScoreControl = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("PlayerScoreControl.prefab", GameRoot.gameResource).GetComponent <PlayerScoreControl>(); m_PlayerScoreControl.Initialization(); m_Remainder = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("MainUI_Remainder.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationTextAdvanced>(); m_Remainder.gameObject.SetActive(false); m_WaitMeUI[0] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("WaitMe_Left.prefab", GameRoot.gameResource); m_WaitMeUI[1] = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("WaitMe_Right.prefab", GameRoot.gameResource); for (int i = 0; i < m_WaitMeUI.Length; i++) { m_WaitMeUI[i].SetActive(false); } StandbyProcess.UpdateCoinsUI(IParkourPlayer_Xiong.PlayerIndex.Index_P1); StandbyProcess.UpdateCoinsUI(IParkourPlayer_Xiong.PlayerIndex.Index_P2); m_GameCoins[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1].Text = StandbyProcess.CoinsNum[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1]; m_GameCoins[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2].Text = StandbyProcess.CoinsNum[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2]; m_GameCoinsDeno[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P1].Text = UniGameOptionsDefine.StartGameCoins.ToString(); m_GameCoinsDeno[(int)IParkourPlayer_Xiong.PlayerIndex.Index_P2].Text = UniGameOptionsDefine.StartGameCoins.ToString(); //m_DownPrompt_GameOverProcess.Play(); //m_DownPrompt_GameRaceProcess.gameObject.SetActive(false); //m_DownPrompt_GameContinueProcess.gameObject.SetActive(false); }
//显示开始游戏 private void ShowGameStart() { if (LoadObject != null) { UnityEngine.GameObject.Destroy(LoadObject); LoadObject = null; } if (SelectMap_Remainder != null) { UnityEngine.GameObject.Destroy(SelectMap_Remainder.gameObject); SelectMap_Remainder = null; } Prompt_GameStart = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_GameStart.prefab", GameRoot.gameResource); GuiPlaneAnimationPlayer ani = GameObject.Find("/UICamera(Clone)/Prompt_GameStart(Clone)/text").GetComponent <GuiPlaneAnimationPlayer>(); ani.DelegateOnPlayEndEvent += PromptGameStartPlayEnd; ani.Play(); SoundEffectPlayer.Play("startgame.wav"); }
//释放函数 public override void Dispose() { if (CompanyLogobackground != null) { UnityEngine.Object.DestroyObject(CompanyLogobackground); CompanyLogobackground = null; } if (CompanyLogoPlayer != null) { UnityEngine.Object.DestroyObject(CompanyLogoPlayer.gameObject); CompanyLogoPlayer = null; } if (CompanyLogoTexture != null) { for (int i = 0; i < CompanyLogoTexture.Length; i++) { UniGameResources.ReleaseOneAssets(CompanyLogoTexture[i]); } CompanyLogoTexture = null; } }
private void PayMoneyCallback(IGamerProfile.PayMoneyData paydata, bool isSucceed) { switch (paydata.item) { case IGamerProfile.PayMoneyItem.PayMoneyItem_OneTreasure: { if (!isSucceed) { //就选择到第一个去 GuiExtendButtonGroup g = GetComponent <GuiExtendButtonGroup>(); g.CurrentSelectButtonIndex = (int)ButtonId.Id_Cancel; return; } int index = -1; for (int i = 0; i < boxisopen.Length; i++) { if (!boxisopen[i]) { index = i; } } if (index == -1) { return; } boxisopen[index] = true; GameObject obj = LoadResource_UIPrefabs("OpenBoxEffect.prefab"); obj.transform.localPosition = boxposition[index].transform.localPosition; GuiPlaneAnimationPlayer pl = obj.GetComponent <GuiPlaneAnimationPlayer>(); OpenBoxData data = new OpenBoxData(); data.parent = this; data.boxIndex = index; pl.DelegateOnPlayEndEvent = data.OnPlayEventEnd; } break; case IGamerProfile.PayMoneyItem.PayMoneyItem_AllTreasure: { if (!isSucceed) { //就选择到第一个去 GuiExtendButtonGroup g = GetComponent <GuiExtendButtonGroup>(); g.CurrentSelectButtonIndex = (int)ButtonId.Id_Cancel; return; } //标记为全开 for (int i = 0; i < boxisopen.Length; i++) { boxisopen[i] = true; } //先播放光效 GameObject obj = null; for (int i = 0; i < boxposition.Length; i++) { obj = LoadResource_UIPrefabs("OpenBoxEffect.prefab"); obj.transform.localPosition = boxposition[i].transform.localPosition; } if (obj != null) { GuiPlaneAnimationPlayer pl = obj.GetComponent <GuiPlaneAnimationPlayer>(); pl.DelegateOnPlayEndEvent = OnEventOpenAllBoxEffectPlayEnd; } } break; } }
protected virtual void Start() { GuiPlaneAnimationPlayer player = this.GetComponent <GuiPlaneAnimationPlayer>(); player.DelegateOnPlayEndEvent += OnPlayEventEnd; }
public void Initialization() { m_BackgroundPlaneAnimationPlayer = m_BackgroundPlaneGameObject.GetComponent <GuiPlaneAnimationPlayer>(); //Debug.Log("动画播放脚本 初始化:::" + m_BackgroundPlaneAnimationPlayer); }
//初始化函数 public void Initialization() { m_Prompt_Continue = m_Prompt_ContinueObject.GetComponent <GuiPlaneAnimationPlayer>(); m_Prompt_GameOver = m_Prompt_GameOverObject.GetComponent <GuiPlaneAnimationPlayer>(); InitUI(); }