Пример #1
0
 public void OnStateChanged(string stateName)
 {
     if (stateName.Equals("Loading"))
     {
         InitialStateEvent initialStateEvent = getInitialStateEvent();
         GetComponent <StateMachine>().SendEvent(initialStateEvent.ToString());
     }
 }
Пример #2
0
    private InitialStateEvent getInitialStateEvent()
    {
        InitialStateEvent result = InitialStateEvent.loggedout;

        if (Service.Get <SessionManager>().HasSession)
        {
            result = InitialStateEvent.nonmember;
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            if (cPDataEntityCollection.TryGetComponent(cPDataEntityCollection.LocalPlayerHandle, out MembershipData component))
            {
                switch (component.MembershipType)
                {
                case MembershipType.Member:
                    result = InitialStateEvent.member;
                    break;

                case MembershipType.AllAccessEventMember:
                    result = InitialStateEvent.allaccesseventmember;
                    break;
                }
            }
        }
        return(result);
    }