// Use this for initialization void Start() { FlurryTAd.ShowTAd(true); startTime = Time.time; uiPos = new TrinitiUIPosition(); //texPos = new StartMenuTexturePosition(); m_UIManager = gameObject.AddComponent <UIManager>() as UIManager; m_UIManager.SetParameter(8, 1, false); m_UIManager.CLEAR = true; trinitiMaterial = UIResourceMgr.GetInstance().GetMaterial("yuyue"); background = new UIImage(); background.SetTexture(trinitiMaterial, StartMenuTexturePosition.Background, new Vector2(Screen.width, Screen.height)); background.Rect = AutoRect.AutoPos(uiPos.Background); //! background.Rect = new Rect(0, 0, Screen.width, Screen.height); m_UIManager.Add(background); GameCenterInterface.Login(); }
public AchievementState() { GameCenterInterface.Initialize(); for (int i = 0; i < ACHIEVEMENT_COUNT; i++) { acheivements[i] = new AchievementInfo(); acheivements[i].id = "com.trinitigame.callofminizombies.a" + (i + 1); } }
public void SubmitAllToGameCenter() { if (GameCenterInterface.IsLogin()) { for (int i = 0; i < ACHIEVEMENT_COUNT; i++) { if (acheivements[i].submitting) { if (GameCenterInterface.SubmitAchievement(acheivements[i].id, 100)) { acheivements[i].submitting = false; } } } if (scoreInfo.score != 0) { if (GameCenterInterface.SubmitScore(scoreInfo.id, scoreInfo.score)) { scoreInfo.score = 0; } } } }
// Use this for initialization void Start() { ResolutionConstant.R = ((float)Screen.width) / 960f; UIResourceMgr.GetInstance().LoadStartMenuUIMaterials(); //! 加载开始菜单需要的材质 uiPos = new StartMenuUIPosition(); //texPos = new StartMenuTexturePosition(); //! UIManager m_UIManager = gameObject.AddComponent <UIManager>() as UIManager; m_UIManager.SetParameter(8, 1, false); m_UIManager.SetUIHandler(this); //! HandleEvent m_UIManager.CLEAR = true; startMenuMaterial = UIResourceMgr.GetInstance().GetMaterial("StartMenu"); //! StartMenu 材质 //startMenu2Material = UIResourceMgr.GetInstance().GetMaterial("StartMenu2"); Material buttonsMaterial = UIResourceMgr.GetInstance().GetMaterial("Buttons"); //! Button材质 background = new UIImage(); background.SetTexture(startMenuMaterial, StartMenuTexturePosition.Background, AutoRect.AutoSize(StartMenuTexturePosition.Background)); background.Rect = AutoRect.AutoPos(uiPos.Background); startButton = new UITextButton(); startButton.SetTexture(UIButtonBase.State.Normal, buttonsMaterial, ButtonsTexturePosition.ButtonNormal, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton)); startButton.SetTexture(UIButtonBase.State.Pressed, buttonsMaterial, ButtonsTexturePosition.ButtonPressed, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton)); startButton.Rect = AutoRect.AutoPos(uiPos.StartButton); startButton.SetText(ConstData.FONT_NAME1, " NEW GAME", ColorName.fontColor_orange); continueButton = new UITextButton(); continueButton.SetTexture(UIButtonBase.State.Normal, buttonsMaterial, ButtonsTexturePosition.ButtonNormal, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton)); continueButton.SetTexture(UIButtonBase.State.Pressed, buttonsMaterial, ButtonsTexturePosition.ButtonPressed, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton)); continueButton.Rect = AutoRect.AutoPos(uiPos.ContinueButton); continueButton.SetText(ConstData.FONT_NAME1, " CONTINUE", ColorName.fontColor_orange); gameDialog = new GameDialog(UIDialog.DialogMode.YES_OR_NO); gameDialog.SetText(ConstData.FONT_NAME2, "\n\nAre You Sure You Want To Erase Your Progress And Start A New Game?", ColorName.fontColor_darkorange); gameDialog.SetDialogEventHandler(this); m_UIManager.Add(background); m_UIManager.Add(startButton); m_UIManager.Add(continueButton); m_UIManager.Add(gameDialog); GameApp.GetInstance().Init(); GameCenterInterface.Login(); string path = Application.dataPath + "/../../Documents/"; if (File.Exists(path + "MySavedGame.game")) { } else { continueButton.Visible = false; continueButton.Enable = false; } FlurryTAd.ShowTAd(true); }
public void HandleEvent(UIControl control, int command, float wparam, float lparam) { if (BattlePressed) { return; } if (control == upgradeButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); //AudioPlayer.PlayAudio(ArenaMenuUI.GetInstance().audio); Hide(); ui.GetPanel(MenuName.UPGRADE).Show(); } else if (control == equipmentButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); Hide(); ui.GetPanel(MenuName.EQUIPMENT).Show(); } else if (control == battleButton) { BattlePressed = true; //GameObject.Find("Music").audio.Stop(); //GameObject.Destroy(GameObject.Find("Music")); //ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Battle"); FadeAnimationScript.GetInstance().FadeInBlack(0.3f); fadeTimer.Name = "Continue"; fadeTimer.SetTimer(0.3f, false); GameApp.GetInstance().Save(); } else if (control == avatarButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); Hide(); ui.GetPanel(MenuName.AVATAR).Show(); } else if (control == optionsButton) { //this.Hide(); //ui.GetPanel(MenuName.OPTIONS).Show(); //ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); } else if (control == returnButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); FadeAnimationScript.GetInstance().FadeInBlack(); fadeTimer.Name = "StartMenu"; fadeTimer.SetTimer(2f, false); } else if (control == leaderButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); GameCenterInterface.OpenLeaderboard(); /* * if (GameCenterInterface.IsLogin()) * { * GameCenterInterface.OpenLeaderboard(); * } * else * { * GameCenterInterface.Login(); * } */ } else if (control == achieveButton) { ArenaMenuUI.GetInstance().GetAudioPlayer().PlayAudio("Button"); GameCenterInterface.OpenAchievement(); /* * if (GameCenterInterface.IsLogin()) * { * GameCenterInterface.OpenAchievement(); * } * else * { * GameCenterInterface.Login(); * } */ } }