static bool ShowMainMenu() { if (OpenMenu(E_MenuState.Menu) == false) { return(false); } LobbyClient.ConnectToLobby(CloudUser.instance.region); if (!ChartBoost.hasCachedMoreApps()) { ChartBoost.cacheMoreApps(); } return(true); }
void ShowMoreApps() { if (nextShowTime > Time.timeSinceLevelLoad) { return; } nextShowTime = Time.timeSinceLevelLoad + 0.5f; //wait moment to avoid button-smashing crash #if UNITY_STANDALONE || UNITY_EDITOR Application.OpenURL("http://madfingergames.com/games.html"); #else ChartBoost.showMoreApps(); #endif RefreshMenu(); }
void Awake() { BuildInfo.DrawVersionInfo = false; // 1366x720=983520 // 1024x720=737280 // 900x640=614400 //Screen.SetResolution (1024, 540, true); //new Texture().SetAnisotropicFilteringLimits(1,1);//2,2); // // warmup post-fx shaders // /* * if (iPhoneSettings.generation == iPhoneGeneration.iPodTouch3Gen || iPhoneSettings.generation == iPhoneGeneration.iPodTouch4Gen || iPhoneSettings.generation == iPhoneGeneration.iPhone3GS || iPhoneSettings.generation == iPhoneGeneration.iPad1Gen) * QualitySettings.masterTextureLimit = 1; * * if (iPhoneSettings.generation == iPhoneGeneration.iPad2Gen) * QualitySettings.antiAliasing = 4; */ //CamExplosionFXMgr.PreloadResources(); GraphicsDetailsUtl.DisableShaderKeyword("UNITY_IPHONE"); #if UNITY_IPHONE GraphicsDetailsUtl.EnableShaderKeyword("UNITY_IPHONE"); #endif #if UNITY_ANDROID && !UNITY_EDITOR try { MogaGamepad.Init(); MogaGamepad.OnConnectionChange += OnMogaConnectionChange; MogaGamepad.OnBatteryLowChange = OnMogaBatteryLowChange; if (m_IsFocused) { //Debug.Log("Moga: Application focused"); MogaGamepad.OnFocus(m_IsFocused); } } catch (System.Exception) {} #endif QualitySettings.masterTextureLimit = 0; if (_Instance) { if (_Instance.Client == null) { _Instance.Client = Client; } Destroy(this.gameObject); return; } else { _Instance = this; uLink.NetworkView nw = GetComponent <uLink.NetworkView>(); if (nw != null) { // This workaround fixes the warning about alredy registered manual ID // Now the NetworkView is registered only once (using given ManualViewIDWorkaround). nw.SetManualViewID(ManualViewIDWorkaround); } } CloudUser.authenticationChanged += OnUserAuthenticationChanged; GamepadInputManager.CreateInstance(); DontDestroyOnLoad(this); this.transform.parent = null; InputManager.Initialize(); if (AppType == E_AppType.DedicatedServer) { Application.targetFrameRate = 60; } else { Application.targetFrameRate = 30; } // test server optimization // not really great optimization I would say... (our servers were definitelly more laggy) // Changing back to 60FPS on the server //Application.targetFrameRate = 30; uLink.BitStreamCodec.Add <PlayerPersistantInfo>(PlayerPersistantInfo.Deserialize, PlayerPersistantInfo.Serialize); uLink.BitStreamCodec.Add <PPIInventoryList>(PPIInventoryList.Deserialize, PPIInventoryList.Serialize); uLink.BitStreamCodec.Add <PPIEquipList>(PPIEquipList.Deserialize, PPIEquipList.Serialize); uLink.BitStreamCodec.Add <PPIRoundScore>(PPIRoundScore.Deserialize, PPIRoundScore.Serialize); uLink.BitStreamCodec.Add <PPIUpgradeList>(PPIUpgradeList.Deserialize, PPIUpgradeList.Serialize); uLink.BitStreamCodec.Add <PPIOutfits>(PPIOutfits.Deserialize, PPIOutfits.Serialize); uLink.BitStreamCodec.Add <RoundFinalResult>(RoundFinalResult.Deserialize, RoundFinalResult.Serialize); uLink.BitStreamCodec.AddAndMakeArray <RoundFinalResult.PlayerResult>(RoundFinalResult.PlayerResult.Deserialize, RoundFinalResult.PlayerResult.Serialize); #if UNITY_IPHONE || UNITY_ANDROID Screen.autorotateToPortrait = false; Screen.autorotateToPortraitUpsideDown = false; #endif Screen.sleepTimeout = 120; // // experimental networking stuff // if (AppType == E_AppType.Game && Application.isEditor == false) { // initialize plugins EtceteraWrapper.Init(); if (TwitterConfiguration.IsAvailable) { TwitterWrapper.Init(TwitterConfiguration.CustomerKey, TwitterConfiguration.CustomerSecret); } if (ChartBoostConfiguration.IsAvailable) { ChartBoost.init(ChartBoostConfiguration.AppId, ChartBoostConfiguration.AppSignature); } if (TapJoyConfiguration.IsAvailable) { TapJoy.Init(TapJoyConfiguration.AppId, TapJoyConfiguration.SecurityKey); } } // Synchronize item settings managers with cloud SettingsCloudSync.GetInstance().UpdateSettingsManagersFromCloud(); LastTouchControlTime = 0; }