Пример #1
0
        public void OnQuickEmoteButtonPressed()
        {
            string stateMachineState = smc.GetStateMachineState("InputBarChat");

            if (stateMachineState != "EmoteInstant")
            {
                smc.SendEvent(new ExternalEvent("Root", "chat_instant_emote"));
            }
            else
            {
                smc.SendEvent(new ExternalEvent("InputBarChat", "keyboardOpen"));
            }
        }
 private IEnumerator Start()
 {
     if (!string.IsNullOrEmpty(StateMachineToCheck))
     {
         StateMachineContext stateMachineContext = GetComponentInParent <StateMachineContext>();
         while (!stateMachineContext.ContainsStateMachine(StateMachineToCheck))
         {
             yield return(null);
         }
         string state = stateMachineContext.GetStateMachineState(StateMachineToCheck);
         int    num   = 0;
         while (true)
         {
             if (num < StatesToEvents.Length)
             {
                 if (StatesToEvents[num].State == state)
                 {
                     break;
                 }
                 num++;
                 continue;
             }
             yield break;
         }
         stateMachineContext.SendEvent(new ExternalEvent(Target, StatesToEvents[num].Event));
     }
     else
     {
         Log.LogError(this, "StateMachineToCheck was null or empty");
     }
 }
Пример #3
0
        private IEnumerator CheckRootState()
        {
            WaitForEndOfFrame   waitForFrame = new WaitForEndOfFrame();
            StateMachineContext smc          = GetComponentInParent <StateMachineContext>();

            while (base.gameObject != null)
            {
                string state = smc.GetStateMachineState("Root");
                if (smc != null && (state == "ChatInputLoader" || state == "ChatInstantEmoteLoader_Forced"))
                {
                    smc.SendEvent(new ExternalEvent("Root", "chat_loaded"));
                }
                yield return(waitForFrame);
            }
        }
 private IEnumerator Start()
 {
     if (!string.IsNullOrEmpty(StateMachineToCheck))
     {
         StateMachineContext stateMachineContext = GetComponentInParent <StateMachineContext>();
         while (!stateMachineContext.ContainsStateMachine(StateMachineToCheck))
         {
             yield return(null);
         }
         string state = stateMachineContext.GetStateMachineState(StateMachineToCheck);
         for (int i = 0; i < StatesToEvents.Length; i++)
         {
             if (StatesToEvents[i].State == state)
             {
                 stateMachineContext.SendEvent(new ExternalEvent(Target, StatesToEvents[i].Event));
                 break;
             }
         }
     }
     else
     {
         Log.LogError(this, "StateMachineToCheck was null or empty");
     }
 }