Example #1
0
        public FsmLayerStateMachine(IFSMController _controller, string _name, bool isTopStateMachine)
        {
            if (_controller == null)
            {
                Debug.LogError("FsmStateMachine " + _name + " IFSMController Can't Be Null");
                return;
            }
            FsmController    = _controller;
            StateMachineName = _name + "_StateMachine";


            DefaultState      = new FsmState(this, StateMachineName + "_defaultState ", null, null);
            IsTopStateMachine = isTopStateMachine;

            if (IsTopStateMachine)
            {
                FsmController.SetTopStateMachine(this);
            }

#if UNITY_EDITOR
            _ShowName = _name;
            ShowAllTrans.Clear();
            _IsTopStateMachine = IsTopStateMachine;
#endif
        }
 public FsmTransParameter(IFSMController _controller, string _name)
 {
     FsmTransParameterName = _name;
     if (_controller == null)
     {
         Debug.LogError("FSMTransParameter " + _name + " IFSMController Can't Be Null");
         return;
     }
     FsmController = _controller;
 }
Example #3
0
		private FSMController GetControllerMock(IFSMController iFsm) {
			var fController = Substitute.For<FSMController> ();
			fController.SetFSMController (iFsm);
			return fController;
		}
Example #4
0
		[SetUp] public void Init()
		{ 
			iFsm = GetFsmMock ();
			fController = GetControllerMock (iFsm);	
		}
		public void SetFSMController(IFSMController fsmController) {
			this.fsmController = fsmController;
		}