private void Awake() { s_instance = this; UnityEngine.Object.DontDestroyOnLoad(base.gameObject); SceneMgr.Get().RegisterSceneLoadedEvent(new SceneMgr.SceneLoadedCallback(this.OnSceneChange)); ApplicationMgr.Get().WillReset += new System.Action(this.WillReset); }
public static FixedRewardsMgr Get() { if (s_instance == null) { s_instance = new FixedRewardsMgr(); ApplicationMgr.Get().WillReset += new System.Action(s_instance.WillReset); } if (!s_instance.m_registeredForAdventureProgressUpdates) { s_instance.m_registeredForAdventureProgressUpdates = AdventureProgressMgr.Get().RegisterProgressUpdatedListener(new AdventureProgressMgr.AdventureProgressUpdatedCallback(s_instance.OnAdventureProgressUpdate)); } if (!s_instance.m_registeredForProfileNotices) { NetCache.Get().RegisterNewNoticesListener(new NetCache.DelNewNoticesListener(s_instance.OnNewNotices)); s_instance.m_registeredForProfileNotices = true; } if (!s_instance.m_registeredForCompletedAchieves) { AchieveManager.Get().RegisterNewlyCompletedAchievesListener(new AchieveManager.NewlyAcompletedAchievesCallback(s_instance.OnNewlyCompletedAchieves)); s_instance.m_registeredForCompletedAchieves = true; } if (!s_instance.m_registeredForAccountLicenseUpdates) { AccountLicenseMgr.Get().RegisterAccountLicensesChangedListener(new AccountLicenseMgr.AccountLicensesChangedCallback(s_instance.OnAccountLicensesUpdate)); s_instance.m_registeredForAccountLicenseUpdates = true; } return(s_instance); }
private void ClearAssets(long startTimestamp, long endTimestamp) { object[] args = new object[] { startTimestamp, endTimestamp, endTimestamp - startTimestamp }; Log.LoadingScreen.Print("LoadingScreen.ClearAssets() - START startTimestamp={0} endTimestamp={1} diff={2}", args); AssetCache.ClearAllCachesBetween(startTimestamp, endTimestamp); ApplicationMgr.Get().UnloadUnusedAssets(); }
public CollectionFilterSet(bool mustPassAllFilters) { IEnumerator enumerator = Enum.GetValues(typeof(TAG_PREMIUM)).GetEnumerator(); try { while (enumerator.MoveNext()) { TAG_PREMIUM current = (TAG_PREMIUM)((int)enumerator.Current); if (!ApplicationMgr.IsInternal() || !this.ShouldSkipPremiumType(current)) { CollectionArtFilterSet item = new CollectionArtFilterSet(new CardFlair(current), mustPassAllFilters); this.m_artFilterSets.Add(item); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } }
/// <summary> /// 在版本更新完成后,才调用该函数,开启游戏初始化。 /// step1:开始加载配置文件 /// </summary> public void StartUp() { SDKManager.getInstance().sendNewbieguideDeviceUniqueIdentifier("2"); _bStartUp = true; GameObject pMgrObj = GameObject.Find("ApplicationMgr"); if (pMgrObj == null) { pMgrObj = new GameObject("ApplicationMgr"); pMgrObj.transform.position = default(Vector3); _applicationMgr = pMgrObj.AddComponent <ApplicationMgr>(); } else { _applicationMgr = pMgrObj.GetComponent <ApplicationMgr>(); } DontDestroyOnLoad(pMgrObj); BaseScene pSceneMono = GameSceneManager.getInstance().SceneMono; bool isStartUp = pSceneMono is StartUpScene; if (pSceneMono == null || !isStartUp) { //SceneConfig config = GameSceneManager.getInstance().GetSceneConfig(SceneName.s_StartupScene); GameSceneManager.getInstance().sceneLoadCompleteAndInit(SceneName.s_StartupScene, new SceneConfig()); } base.Start(); _startUpStep = 1; UtilTools.SetServerListTip(""); }
public static void Reset() { if ((StoreManager.HAS_THIRD_PARTY_APP_STORE != null) && (ApplicationMgr.GetAndroidStore() != AndroidStore.BLIZZARD)) { OnReset(); } }
public static void quitHearthstoneAndRun() { Blizzard.Log.Warning("Hearthstone was not run from Battle.net Client"); if (!bootstrapper.Exists) { Blizzard.Log.Warning("Hearthstone could not find Battle.net client"); Error.AddFatalLoc("GLUE_CANNOT_FIND_BATTLENET_CLIENT", new object[0]); } else { try { Process process2 = new Process { StartInfo = { UseShellExecute = false, FileName = bootstrapper.FullName, Arguments = "-uid hs_beta" }, EnableRaisingEvents = true }; process2.Start(); Blizzard.Log.Warning("Hearthstone ran Battle.net Client. Exiting."); ApplicationMgr.Get().Exit(); } catch (Exception exception) { Error.AddFatalLoc("GLUE_CANNOT_RUN_BATTLENET_CLIENT", new object[0]); object[] args = new object[] { exception.Message }; Blizzard.Log.Warning("Hearthstone could not launch Battle.net client: {0}", args); } } }
private bool ForceEventActive(SpecialEventType eventType) { if (!ApplicationMgr.IsInternal()) { return(false); } if (this.m_forcedActiveEvents == null) { this.m_forcedActiveEvents = new HashSet <SpecialEventType>(); string str = Vars.Key("Events.ForceActive").GetStr(null); if (string.IsNullOrEmpty(str)) { return(false); } char[] separator = new char[] { ' ', ',', ';' }; string[] strArray = str.Split(separator, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { SpecialEventType type; if (EnumUtils.TryGetEnum <SpecialEventType>(strArray[i], StringComparison.OrdinalIgnoreCase, out type)) { this.m_forcedActiveEvents.Add(type); } } } return(this.m_forcedActiveEvents.Contains(eventType)); }
private void UpdateIdleKickTimeOption() { if (ApplicationMgr.IsInternal()) { this.SetKickTimeStr(Options.Get().GetString(Option.IDLE_KICK_TIME)); } }
public bool HandleKeyboardInput() { if (ApplicationMgr.IsPublic()) { return(false); } if (!Input.GetKeyUp(KeyCode.BackQuote)) { return(false); } Rect rect = new Rect(0f, 0f, 1f, 0.05f); this.m_cheatInputBackground = rect; this.m_cheatInputBackground.x *= Screen.width * 0.95f; this.m_cheatInputBackground.y *= Screen.height; this.m_cheatInputBackground.width *= Screen.width; this.m_cheatInputBackground.height *= Screen.height * 1.03f; this.m_inputActive = true; this.m_cheatHistoryIndex = -1; this.ReadCheatHistoryOption(); this.m_cheatTextBeforeScrollingThruHistory = null; UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams { m_owner = base.gameObject, m_preprocessCallback = new UniversalInputManager.TextInputPreprocessCallback(this.OnInputPreprocess), m_rect = rect, m_color = new Color?(Color.white), m_completedCallback = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete) }; UniversalInputManager.Get().UseTextInput(parms, false); return(true); }
private void Awake() { s_instance = this; if (UniversalInputManager.UsePhoneUI != null) { Transform transform = this.m_menuButton.transform; transform.localScale = (Vector3)(transform.localScale * 2f); Transform transform2 = this.m_friendButton.transform; transform2.localScale = (Vector3)(transform2.localScale * 2f); } else { this.m_connectionIndicator.gameObject.SetActive(false); } this.m_initialWidth = base.GetComponent <Renderer>().bounds.size.x; this.m_initialFriendButtonScaleX = this.m_friendButton.transform.localScale.x; this.m_initialMenuButtonScaleX = this.m_menuButton.transform.localScale.x; this.m_menuButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnMenuButtonReleased)); this.m_friendButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnFriendButtonReleased)); this.ToggleEnableButtons(false); this.m_batteryLevel.gameObject.SetActive(false); FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError)); SceneMgr.Get().RegisterSceneLoadedEvent(new SceneMgr.SceneLoadedCallback(this.OnSceneLoaded)); SpectatorManager.Get().OnInviteReceived += new SpectatorManager.InviteReceivedHandler(this.SpectatorManager_OnInviteReceived); SpectatorManager.Get().OnSpectatorToMyGame += new SpectatorManager.SpectatorToMyGameHandler(this.SpectatorManager_OnSpectatorToMyGame); SpectatorManager.Get().OnSpectatorModeChanged += new SpectatorManager.SpectatorModeChangedHandler(this.SpectatorManager_OnSpectatorModeChanged); ApplicationMgr.Get().WillReset += new System.Action(this.WillReset); this.m_lightingBlend = this.m_menuButtonMesh.GetComponent <Renderer>().material.GetFloat("_LightingBlend"); if (UniversalInputManager.UsePhoneUI != null) { this.m_batteryLevel = this.m_batteryLevelPhone; this.m_currentTime.gameObject.SetActive(false); } this.m_menuButton.SetPhoneStatusBarState(0); }
private void Awake() { s_instance = this; OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT); this.m_logo = AssetLoader.Get().LoadGameObject(FileUtils.GameAssetPathToName(this.m_logoPrefab), true, false); GameUtils.SetParent(this.m_logo, this.m_logoContainer, true); this.m_logo.SetActive(false); this.m_webLoginCanvas = null; this.Show(); this.UpdateLayout(); if (Vars.Key("Aurora.ClientCheck").GetBool(true) && BattleNetClient.needsToRun) { BattleNetClient.quitHearthstoneAndRun(); } else { Network.Get().RegisterQueueInfoHandler(new Network.QueueInfoHandler(this.QueueInfoHandler)); if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE) { this.m_demoDisclaimer.SetActive(true); } if (ApplicationMgr.IsInternal() && (ApplicationMgr.AllowResetFromFatalError != null)) { this.m_devClearLoginButton.gameObject.SetActive(true); this.m_devClearLoginButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ClearLogin)); } } }
protected override void Awake() { base.Awake(); s_instance = this; this.m_CurrentSubScene = null; this.m_TransitionOutSubScene = null; AdventureConfig config = AdventureConfig.Get(); config.OnAdventureSceneAwake(); config.AddSubSceneChangeListener(new AdventureConfig.SubSceneChange(this.OnSubSceneChange)); config.AddSelectedModeChangeListener(new AdventureConfig.SelectedModeChange(this.OnSelectedModeChanged)); config.AddAdventureModeChangeListener(new AdventureConfig.AdventureModeChange(this.OnAdventureModeChanged)); this.m_StartupAssetLoads++; bool @bool = Options.Get().GetBool(Option.HAS_SEEN_NAXX); if (!@bool) { this.m_StartupAssetLoads++; } this.LoadSubScene(config.GetCurrentSubScene(), new AssetLoader.GameObjectCallback(this.OnFirstSubSceneLoaded)); if (!@bool) { SoundManager.Get().Load("VO_KT_INTRO_39"); AssetLoader.Get().LoadGameObject("KT_Quote", new AssetLoader.GameObjectCallback(this.OnKTQuoteLoaded), null, false); } Options.Get().SetBool(Option.BUNDLE_JUST_PURCHASE_IN_HUB, false); if (ApplicationMgr.IsInternal()) { CheatMgr.Get().RegisterCheatHandler("advdev", new CheatMgr.ProcessCheatCallback(this.OnDevCheat), null, null, null); } this.InitializeAllDefs(); }
private void Awake() { s_instance = this; UnityEngine.Object.DontDestroyOnLoad(base.gameObject); FatalErrorMgr.Get().AddErrorListener(new FatalErrorMgr.ErrorCallback(this.OnFatalError)); this.m_transitioning = true; ApplicationMgr.Get().WillReset += new System.Action(this.WillReset); }
private void Awake() { s_instance = this; if (ApplicationMgr.IsPublic()) { UnityEngine.Object.DestroyImmediate(base.gameObject); } }
public void NotifyExitPressed() { Log.Mike.Print("FatalErrorDialog.NotifyExitPressed() - BEGIN", new object[0]); this.SendAcknowledgements(); Log.Mike.Print("FatalErrorDialog.NotifyExitPressed() - calling ApplicationMgr.Get().Exit()", new object[0]); ApplicationMgr.Get().Exit(); Log.Mike.Print("FatalErrorDialog.NotifyExitPressed() - END", new object[0]); }
public static void Run() { Debug.Log("Hello from Test.ComponentTest"); var rootGO = ApplicationMgr.Get().gameObject; rootGO.AddComponent(typeof(FrameBehaviour)); }
public static float GetDevTimescale() { if (ApplicationMgr.IsPublic()) { return(1f); } return(Options.Get().GetFloat(Option.DEV_TIMESCALE, 1f)); }
public static void SetDevTimescale(float f) { if (!ApplicationMgr.IsPublic()) { Options.Get().SetFloat(Option.DEV_TIMESCALE, f); UnityEngine.Time.timeScale = f; } }
public static int GetFakePackCount() { if (!ApplicationMgr.IsInternal()) { return(0); } return(Options.Get().GetInt(Option.FAKE_PACK_COUNT)); }
public float GetTimeout() { if (ApplicationMgr.IsInternal()) { return(Options.Get().GetFloat(Option.RECONNECT_TIMEOUT)); } return((float)OptionDataTables.s_defaultsMap[Option.RECONNECT_TIMEOUT]); }
////////////////////////////////////////////////////////////////////////// public SettingsForm() { InitializeComponent(); AppMgr = new ApplicationMgr("StringTableMgr"); Mgr = new StringTableMgr(); Mgr.OnProgressChange += new ProgressChangeDelegate(OnProgressChange); Mgr.OnAddLog += new AddLogDelegate(OnAddLog); }
public float GetRetryTime() { if (ApplicationMgr.IsInternal()) { return(Options.Get().GetFloat(Option.RECONNECT_RETRY_TIME)); } return((float)OptionDataTables.s_defaultsMap[Option.RECONNECT_RETRY_TIME]); }
private void OnDestroy() { SpectatorManager.Get().OnInviteReceived -= new SpectatorManager.InviteReceivedHandler(this.SpectatorManager_OnInviteReceived); SpectatorManager.Get().OnSpectatorToMyGame -= new SpectatorManager.SpectatorToMyGameHandler(this.SpectatorManager_OnSpectatorToMyGame); SpectatorManager.Get().OnSpectatorModeChanged -= new SpectatorManager.SpectatorModeChangedHandler(this.SpectatorManager_OnSpectatorModeChanged); ApplicationMgr.Get().WillReset -= new System.Action(this.WillReset); s_instance = null; }
public static FriendChallengeMgr Get() { if (s_instance == null) { s_instance = new FriendChallengeMgr(); ApplicationMgr.Get().WillReset += new System.Action(s_instance.WillReset); } return(s_instance); }
public static DemoMgr Get() { if (s_instance == null) { s_instance = new DemoMgr(); } ApplicationMgr.Get().WillReset += new System.Action(s_instance.WillReset); return(s_instance); }
private void Start() { SceneMgr.Get().RegisterScenePreUnloadEvent(new SceneMgr.ScenePreUnloadCallback(this.OnScenePreUnload)); if (ApplicationMgr.IsInternal()) { Options.Get().RegisterChangedListener(Option.IDLE_KICK_TIME, new Options.ChangedCallback(this.OnOptionChanged)); Options.Get().RegisterChangedListener(Option.IDLE_KICKER, new Options.ChangedCallback(this.OnOptionChanged)); } }
public static BnetNearbyPlayerMgr Get() { if (s_instance == null) { s_instance = new BnetNearbyPlayerMgr(); ApplicationMgr.Get().WillReset += new System.Action(s_instance.Clear); } return(s_instance); }
////////////////////////////////////////////////////////////////////////// public DebugWindow() { Watch = new WatchProvider(); InitializeComponent(); DisplayScript(null); AppMgr = new ApplicationMgr("DebugConsole"); GridWatch.SelectedObject = Watch; }
public bool HandleKeyboardInput() { if (DraftDisplay.Get() == null) { return(false); } if (Input.GetKeyUp(KeyCode.Escape) && DraftDisplay.Get().IsInHeroSelectMode()) { DraftDisplay.Get().DoHeroCancelAnimation(); return(true); } if (!ApplicationMgr.IsInternal()) { return(false); } List <DraftCardVisual> cardVisuals = DraftDisplay.Get().GetCardVisuals(); if (cardVisuals == null) { return(false); } if (cardVisuals.Count == 0) { return(false); } int num = -1; if (Input.GetKeyUp(KeyCode.Alpha1)) { num = 0; } else if (Input.GetKeyUp(KeyCode.Alpha2)) { num = 1; } else if (Input.GetKeyUp(KeyCode.Alpha3)) { num = 2; } if (num == -1) { return(false); } if (cardVisuals.Count < (num + 1)) { return(false); } DraftCardVisual visual = cardVisuals[num]; if (visual == null) { return(false); } visual.ChooseThisCard(); return(true); }
public bool CancelScheduledCallback(ApplicationMgr.ScheduledCallback cb, object userData = null) { if (!GeneralUtils.IsCallbackValid((Delegate)cb) || this.m_schedulerContexts == null || this.m_schedulerContexts.Count == 0) return false; for (LinkedListNode<ApplicationMgr.SchedulerContext> node = this.m_schedulerContexts.First; node != null; node = node.Next) { ApplicationMgr.SchedulerContext schedulerContext = node.Value; if ((MulticastDelegate)schedulerContext.m_callback == (MulticastDelegate)cb && schedulerContext.m_userData == userData) { this.m_schedulerContexts.Remove(node); return true; } } return false; }
void Awake() { ApplicationMgr.s_instance = this; this.Initialize(); }
public bool ScheduleCallback(float secondsToWait, bool realTime, ApplicationMgr.ScheduledCallback cb, object userData = null) { if (!GeneralUtils.IsCallbackValid((Delegate)cb)) return false; if (this.m_schedulerContexts == null) { this.m_schedulerContexts = new LinkedList<ApplicationMgr.SchedulerContext>(); } else { using (LinkedList<ApplicationMgr.SchedulerContext>.Enumerator enumerator = this.m_schedulerContexts.GetEnumerator()) { while (enumerator.MoveNext()) { ApplicationMgr.SchedulerContext current = enumerator.Current; if (!((MulticastDelegate)current.m_callback != (MulticastDelegate)cb) && current.m_userData == userData) return false; } } } ApplicationMgr.SchedulerContext schedulerContext = new ApplicationMgr.SchedulerContext(); schedulerContext.m_startTime = UnityEngine.Time.realtimeSinceStartup; schedulerContext.m_secondsToWait = secondsToWait; schedulerContext.m_realTime = realTime; schedulerContext.m_callback = cb; schedulerContext.m_userData = userData; float num = schedulerContext.EstimateTargetTime(); bool flag = false; for (LinkedListNode<ApplicationMgr.SchedulerContext> node = this.m_schedulerContexts.Last; node != null; node = node.Previous) { if ((double)node.Value.EstimateTargetTime() <= (double)num) { flag = true; this.m_schedulerContexts.AddAfter(node, schedulerContext); break; } } if (!flag) this.m_schedulerContexts.AddFirst(schedulerContext); return true; }