public void SetNewStateIdType(Type stateIdType)
 {
     if (stateIdType == null)
     {
         _stateIdDrawer = null;
     }
     else
     {
         _stateIdDrawer = GenericTypeDrawerFactory.Create(stateIdType);
     }
 }
        public StateNode(Vector2 position, Type stateIdType, int nodeId, ScriptableState stateAsset = null, object stateId = null)
        {
            _nodeRect   = new Rect(position.x, position.y, Width, Height);
            NodeId      = nodeId;
            StateObject = stateAsset;

            _controlsAreaStyle         = new GUIStyle();
            _controlsAreaStyle.padding = new RectOffset(ControlPaddingLeft, ControlPaddingRight, ControlPaddingTop, ControlPaddingBottom);

            _identityTitleStyle           = new GUIStyle();
            _identityTitleStyle.padding   = new RectOffset(20, 20, 20, 20);
            _identityTitleStyle.alignment = TextAnchor.MiddleCenter;
            _identityTitleStyle.fontSize  = 20;
            _identityTitleStyle.wordWrap  = true;

            _stateIdDrawer = GenericTypeDrawerFactory.Create(stateIdType, stateId);

            AsNormal();
        }
Пример #3
0
        public TriggerWithGuardConditions(Type triggerType, object trigger = null, ScriptableGuardCondition[] guardConditions = null)
        {
            if (trigger == null)
            {
                _triggerDrawer = GenericTypeDrawerFactory.Create(triggerType);
            }
            else
            {
                _triggerDrawer = GenericTypeDrawerFactory.Create(triggerType, trigger);
            }

            if (guardConditions == null)
            {
                GuardConditions = new ScriptableGuardCondition[0];
            }
            else
            {
                GuardConditions = new ScriptableGuardCondition[guardConditions.Length];

                guardConditions.CopyTo(GuardConditions, 0);
            }
        }
Пример #4
0
 public void SetNewTriggerType(Type triggerType)
 {
     _triggerDrawer = GenericTypeDrawerFactory.Create(triggerType);
 }