public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); Input.multiTouchEnabled = true;//忍刀 Init(); BaseDialogState.UICamera.clearFlags = CameraClearFlags.Depth; }
public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); chapter = data as Chapter; model = data as ModelItem; Init(); }
// Use this for initialization public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); rect = GetComponent <RectTransform>(); owner = ownerState.Owner as MeteorUnit; Init(owner.Attr, owner.transform, owner.Camp); //rectCanvas = c.GetComponent<RectTransform>().sizeDelta; }
public void ExitStateByOwner(UnityEngine.MonoBehaviour Owner) { if (StateHash.ContainsKey(Owner)) { PersistState state = StateHash[Owner]; ExitState(state); } }
public static PersistState GetInstance() { if (state == null) { state = GameObject.FindWithTag("Persist State").GetComponent<PersistState>(); } return state; }
public virtual void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { Persist = ownerState; if (FadeIn == FadeEffect.Scale) { transform.localScale = Vector3.zero; Tweener tweenScale = transform.DOScale(Vector3.one, duration); tweenScale.SetEase(Ease.InCubic); } }
public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); Input.multiTouchEnabled = true;//忍刀 Init(); BaseDialogState.UICamera.clearFlags = CameraClearFlags.Depth; //如果使用鼠标。那么锁定鼠标 #if UNITY_ANDROID Cursor.lockState = GameStateMgr.Ins.gameStatus.UseMouse ? CursorLockMode.Locked : CursorLockMode.None; #endif }
public void ExitState(PersistState state) { if (!ActiveState.Contains(state)) { return; } if (state.Owner != null) { StateHash.Remove(state.Owner); } state.OnStateExit(); ActiveState.Remove(state); }
public void EnterState(PersistState state) { if (ActiveState.Contains(state)) { return; } state.OnStateEnter(); ActiveState.Add(state); if (state.Owner != null) { StateHash.Add(state.Owner, state); } }
public static void UnlockAchievement(string achievementKey) { if (PersistState.Instance.UnlockedAchievements.Contains(achievementKey)) //don't grant duplicates { return; } PersistState.Instance.UnlockedAchievements.Add(achievementKey); PersistState.Save(); //overly aggressive? //at least broadcast a message notifying an achievement has been granted QdmsMessageBus.Instance.PushBroadcast(new QdmsKeyValueMessage("AchievementUnlocked", new Dictionary <string, object>() { { "AchievementKey", achievementKey } })); }
void Start() { // singleton if (state == null) { state = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } // initialize ResetGame(); }
public void PersistChildren() { var persistState = new PersistState(); foreach (TabItem tab in TabHost.Items) { // Save child grid column-sizes var grid = tab.GetChildrenOf <Grid>().FirstOrDefault(); if (grid != null && GridColumnSizeHelper.GetSaveGridColumnsSize(grid)) { GridColumnSizeHelper.SaveColumnSizes(grid); } // Save open tab's state if (tab.Content is IPersistableTab) { IPersistableTab saveTab = (IPersistableTab)tab.Content; var data = saveTab.SaveData(); if (data != null) { persistState.Tabs.Add(new TabState { PluginType = saveTab.Plugin.GetType(), ViewType = saveTab.ViewType, DataInstance = saveTab.SaveData() }); } } } persistState.SelectedTabIndex = TabHost.SelectedIndex; ClientState.Current.Context.SaveSettingTo("state.xml", persistState); }
public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); Close.onClick.AddListener(() => { OnPreviousPress(); }); DoScript.onClick.AddListener(() => { try { if (string.IsNullOrEmpty(scriptInput.text)) { result.text = "输入为空"; return; } result.text = "秘籍可查阅指令表"; if (!CheatCode.UseCheatCode(scriptInput.text)) { if (U3D.IsMultiplyPlayer()) { result.text = "联机时只支持部分指令"; } else { ScriptMng.Ins.CallString(scriptInput.text); } } else { result.text = "秘籍成功执行"; } } catch (Exception exp) { result.text = "执行出错:" + exp.Message + "-" + exp.StackTrace; } }); }
public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); Init(data as string); }
public bool StateActive(PersistState state) { return(ActiveState.Contains(state)); }
public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data) { base.OnDialogStateEnter(ownerState, previousDialog, data); GameObject.DontDestroyOnLoad(gameObject); InsertSystemMsg("OK"); }