コード例 #1
0
        void OnTargetLost(ImageTargetBaseBehaviour behaviour)
        {
            ARModal arModal = ARModal.Instance();

            WKStaticFunction.WKMessageLog("Lost " + arModal.GetNameObjectFound + " : " + Target.Id);
            HideObjects(transform);
        }
コード例 #2
0
    public void PerformTransition(TRANSITION transition)
    {
        if (transition == TRANSITION.NullTransition)
        {
            WKStaticFunction.WKMessageError("the transition is null");
            return;
        }

        STATE_ID stateID = _CurrentState.GetState(transition);

        if (stateID == STATE_ID.NullStateID)
        {
            WKStaticFunction.WKMessageError("the state of transition is null ::" + _CurrentState.ID.ToString() + transition.ToString());
            return;
        }

        _CurrentStateID = stateID;
        STATE_ID previousState = _CurrentState.ID;

        foreach (FSMState state in _States)
        {
            if (state.ID == _CurrentStateID)
            {
                _CurrentState.OnLeave();
                _CurrentState = state;
                _CurrentState._PreviousState = previousState;
                _CurrentState.OnEnter();
                break;
            }
        }
    }
コード例 #3
0
    public void AddState(FSMState stateToAdd)
    {
        if (stateToAdd == null)
        {
            WKStaticFunction.WKMessageError("there is no state to add");
        }

        stateToAdd.SetFSMCaller(_Caller);

        if (_States.Count == 0)
        {
            _States.Add(stateToAdd);
            _CurrentState   = stateToAdd;
            _CurrentStateID = stateToAdd.ID;
            _CurrentState.OnEnter();
            return;
        }

        foreach (FSMState state in _States)
        {
            if (state.ID == stateToAdd.ID)
            {
                WKStaticFunction.WKMessageError("state is already there");
                return;
            }
        }
        _States.Add(stateToAdd);
    }
コード例 #4
0
    public void On3DAction()
    {
        WKStaticFunction.WKMessageLog("Close3D");
        ARModal arModal = ARModal.Instance();

        arModal.OnClose3D();
    }
コード例 #5
0
    public void PlayVideoAction()
    {
        WKStaticFunction.WKMessageLog("Play Video");

        AppRuntime appRuntime = _FSMCaller as AppRuntime;

        appRuntime.SetTransition(TRANSITION.TRANSITION_TO_VIDEOTUTORIALSTATE);
    }
コード例 #6
0
    private void StartAction()
    {
        WKStaticFunction.WKMessageLog("Start on Click");

        AppRuntime appRuntime = _FSMCaller as AppRuntime;

        appRuntime.SetTransition(TRANSITION.TRANSITION_TO_ARSTATE);
    }
コード例 #7
0
    public override void OnEnter()
    {
        WKStaticFunction.WKMessageLog("Enter ARState");
        ARModal arModal = ARModal.Instance();

        arModal.OpenModal();
        arModal.OnRegisterModal(PlayVideoAction, On3DAction);

        base.OnEnter();
    }
コード例 #8
0
    public override void OnEnter()
    {
        WKStaticFunction.WKMessageLog("Enter VideoState");
        VideoTutorialModal videoModal = VideoTutorialModal.Instance();

        videoModal.OpenModal();


        base.OnEnter();
    }
コード例 #9
0
    public override void OnLeave()
    {
        WKStaticFunction.WKMessageLog("Leave ARState");

        VideoTutorialModal videoModal = VideoTutorialModal.Instance();

        videoModal.CloseModal();

        base.OnLeave();
    }
コード例 #10
0
    public override void OnLeave()
    {
        WKStaticFunction.WKMessageLog("Leave ARState");

        HomeModal homeModal = HomeModal.Instance();

        homeModal.CloseModal();

        base.OnLeave();
    }
コード例 #11
0
    public override void OnLeave()
    {
        WKStaticFunction.WKMessageLog("Leave ARState");

        ARModal arModal = ARModal.Instance();

        arModal.UnRegisterModal();
        arModal.CloseModal();

        base.OnLeave();
    }
コード例 #12
0
    public override void OnEnter()
    {
        WKStaticFunction.WKMessageLog("Enter HomeState");
        CreatePlayerModal createPlayer = CreatePlayerModal.Instance();

        createPlayer.OpenModal();
        //HomeModal homeModal = HomeModal.Instance();
        //homeModal.OpenModal();
        //homeModal.OnRegisterModal(StartAction);

        base.OnEnter();
    }
コード例 #13
0
 // set the transition so the things in the app gonna call this to transition from one state
 //To another
 public void SetTransition(TRANSITION transition)
 {
     if (_FSM != null)
     {
         _FSM.PerformTransition(transition);
     }
     else
     {
         WKStaticFunction.WKMessageError("there is no fsm system in the app");
         MakeFSM();
     }
 }
コード例 #14
0
ファイル: ARModal.cs プロジェクト: rivayx/WawasanKebangsaan
    public static ARModal Instance()
    {
        if (_Instance == null)
        {
            _Instance = GameObject.FindObjectOfType <ARModal>();

            if (_Instance == null)
            {
                WKStaticFunction.WKMessageError("there is no ARModal in the system");
            }
        }
        return(_Instance);
    }
コード例 #15
0
    public void DeleteTransition(TRANSITION transition)
    {
        if (transition == TRANSITION.NullTransition)
        {
            WKStaticFunction.WKMessageError("The Transition is null, or not fully initialized");
            return;
        }

        if (_Map.ContainsKey(transition))
        {
            _Map.Remove(transition);
            return;
        }

        WKStaticFunction.WKMessageLog("The Transition is not on the transition _Map");
    }
コード例 #16
0
    public void DeleteState(STATE_ID stateID)
    {
        if (stateID == STATE_ID.NullStateID)
        {
            WKStaticFunction.WKMessageError("the state id is null");
            return;
        }

        foreach (FSMState state in _States)
        {
            if (state.ID == stateID)
            {
                _States.Remove(state);
                return;
            }
        }
        WKStaticFunction.WKMessageError("the state is not found in the fsm map");
    }
コード例 #17
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;

            if (Instance == null)
            {
                Instantiate(Instance);
                WKStaticFunction.WKMessageError("error when trying to create singleton");
            }
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #18
0
    public void AddTransition(TRANSITION Transition, STATE_ID StateID)
    {
        if (Transition == TRANSITION.NullTransition)
        {
            WKStaticFunction.WKMessageError("The Transition is error");
            return;
        }

        if (StateID == STATE_ID.NullStateID)
        {
            WKStaticFunction.WKMessageError("The State is error");
            return;
        }

        if (_Map.ContainsKey(Transition))
        {
            WKStaticFunction.WKMessageError("The FSM already have this transition for state");
            return;
        }
        _Map.Add(Transition, StateID);
    }
コード例 #19
0
 private void JSONAction(string jsonString)
 {
     Debug.Log("asyjdhfguoyasdvfyuavsfajhsdvftauyvsdftgasdfbabwfyuasdbfhjbsdbbbbbbbb");
     WKStaticFunction.WKMessageLog(jsonString);
 }
コード例 #20
0
    public void StartParsing(EJSONType jsonType, UnityAction <string> unityAction)
    {
        string jsonName = WKStaticFunction.GetJSONName(jsonType);

        StartCoroutine(StartParsingCourotine(jsonName, jsonType, unityAction));
    }