コード例 #1
0
 public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data)
 {
     base.OnDialogStateEnter(ownerState, previousDialog, data);
     Input.multiTouchEnabled = true;//忍刀
     Init();
     BaseDialogState.UICamera.clearFlags = CameraClearFlags.Depth;
 }
コード例 #2
0
 public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data)
 {
     base.OnDialogStateEnter(ownerState, previousDialog, data);
     chapter = data as Chapter;
     model   = data as ModelItem;
     Init();
 }
コード例 #3
0
 // 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;
 }
コード例 #4
0
 public void ExitStateByOwner(UnityEngine.MonoBehaviour Owner)
 {
     if (StateHash.ContainsKey(Owner))
     {
         PersistState state = StateHash[Owner];
         ExitState(state);
     }
 }
コード例 #5
0
 public static PersistState GetInstance()
 {
     if (state == null)
     {
         state = GameObject.FindWithTag("Persist State").GetComponent<PersistState>();
     }
     return state;
 }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
    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
    }
コード例 #8
0
 public void ExitState(PersistState state)
 {
     if (!ActiveState.Contains(state))
     {
         return;
     }
     if (state.Owner != null)
     {
         StateHash.Remove(state.Owner);
     }
     state.OnStateExit();
     ActiveState.Remove(state);
 }
コード例 #9
0
 public void EnterState(PersistState state)
 {
     if (ActiveState.Contains(state))
     {
         return;
     }
     state.OnStateEnter();
     ActiveState.Add(state);
     if (state.Owner != null)
     {
         StateHash.Add(state.Owner, state);
     }
 }
コード例 #10
0
        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 }
            }));
        }
コード例 #11
0
    void Start()
    {
        // singleton
        if (state == null)
        {
            state = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        // initialize
        ResetGame();
    }
コード例 #12
0
        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);
        }
コード例 #13
0
ファイル: ScriptInputDialog.cs プロジェクト: WeeirJoe/Joe
 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;
         }
     });
 }
コード例 #14
0
ファイル: WaitDialog.cs プロジェクト: WeeirJoe/Joe
 public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data)
 {
     base.OnDialogStateEnter(ownerState, previousDialog, data);
     Init(data as string);
 }
コード例 #15
0
 public bool StateActive(PersistState state)
 {
     return(ActiveState.Contains(state));
 }
コード例 #16
0
 public override void OnDialogStateEnter(PersistState ownerState, BaseDialogState previousDialog, object data)
 {
     base.OnDialogStateEnter(ownerState, previousDialog, data);
     GameObject.DontDestroyOnLoad(gameObject);
     InsertSystemMsg("OK");
 }