Ejemplo n.º 1
0
        public void AddListener(object key, ExecutionPriority priority, Action action)
        {
            if (Values == null)
            {
                Values = new Dictionary <object, List <NoneHandler> >();
            }

            if (IsHandler(key, action))
            {
                return;
            }

            if (IsHandlerKey(key))
            {
                var values = Values[key];

                values.Add(new NoneHandler(priority, action));

                Values[key] = values.OrderBy(obj => obj.Priority).ToList();
            }
            else
            {
                var values = new List <NoneHandler>
                {
                    new NoneHandler(priority, action)
                };

                Values.Add(key, values);
            }
        }
Ejemplo n.º 2
0
        public MBehaviour(ExecutionPriority priority = ExecutionPriority.Mid, float executionOrder = 0, bool isActive = true)
        {
            this.priority       = priority;
            this.executionOrder = executionOrder;

            this.IsActive = isActive;

            //MBehaviourController.AddBehaviour(this);
        }
Ejemplo n.º 3
0
        public void AddListener(ExecutionPriority priority, Action <Ray, int> action)
        {
            if (Values == null)
            {
                Values = new List <RayHandler>();
            }

            if (IsHandler(action))
            {
                return;
            }

            Values.Add(new RayHandler(priority, action));
        }
Ejemplo n.º 4
0
        public void AddListener(ExecutionPriority priority, Action <GameObject, int> action)
        {
            if (Values == null)
            {
                Values = new List <GameIntHandler>();
            }

            if (IsHandler(action))
            {
                return;
            }

            Values.Add(new GameIntHandler(priority, action));

            Sort();
        }
Ejemplo n.º 5
0
        public void AddListener(ExecutionPriority priority, Action <int, float> action)
        {
            if (Values == null)
            {
                Values = new List <IntFloatHandler>();
            }

            if (IsHandler(action))
            {
                return;
            }

            Values.Add(new IntFloatHandler(priority, action));

            Sort();
        }
Ejemplo n.º 6
0
        public void AddListener(ExecutionPriority priority, Action <Vector3> action)
        {
            if (Values == null)
            {
                Values = new List <Vector3Handler>();
            }

            if (IsHandler(action))
            {
                return;
            }

            Values.Add(new Vector3Handler(priority, action));

            Sort();
        }
Ejemplo n.º 7
0
 public GameIntHandler(ExecutionPriority priority, Action <GameObject, int> action)
 {
     Priority    = priority;
     this.Action = action;
 }
Ejemplo n.º 8
0
 public Vector3Handler(ExecutionPriority priority, Action <Vector3> action)
 {
     this.Priority = priority;
     this.Action   = action;
 }
Ejemplo n.º 9
0
 public RayHandler(ExecutionPriority priority, Action <Ray, int> action)
 {
     Priority    = priority;
     this.Action = action;
 }
Ejemplo n.º 10
0
 public NoneHandler(ExecutionPriority priority, Action action)
 {
     this.Priority = priority;
     this.Action   = action;
 }
Ejemplo n.º 11
0
 public BaseAction(ExecutionPriority priority)
 {
     ActionProperties = new ObservableCollection <ActionProperty>();
     ExecutionOrder   = priority;
 }
Ejemplo n.º 12
0
 public static void AddListener(Action <int> action, ExecutionPriority priority = ExecutionPriority.Mid)
 {
     Values.AddListener(priority, action);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 添加自身抓取事件
 /// </summary>
 /// <param name="key">自身Object</param>
 /// <param name="action">委托</param>
 /// <param name="priority">优先级</param>
 public static void AddGrabObject(this GameObject key, Action <int> action, ExecutionPriority priority = ExecutionPriority.Mid)
 {
     AddListener(key, action, priority);
 }
Ejemplo n.º 14
0
 public static void AddListener(GameObject key, Action <int> action, ExecutionPriority priority = ExecutionPriority.Mid)
 {
     Value.AddListener(key, priority, action);
 }
Ejemplo n.º 15
0
        public static void AddListener(GameObject key, Action <GameObject, Vector3, Quaternion, int> action, ExecutionPriority level = ExecutionPriority.Mid)
        {
            if (Values == null)
            {
                Values = new Dictionary <GameObject, List <UpdateObjectEventHandler> >();
            }

            if (IsHandler(key, action))
            {
                return;
            }

            if (IsHandlerKey(key))
            {
                List <UpdateObjectEventHandler> values = Values[key];
                values.Add(new UpdateObjectEventHandler(level, action));

                Values[key] = values;
            }
            else
            {
                List <UpdateObjectEventHandler> values = new List <UpdateObjectEventHandler>();
                values.Add(new UpdateObjectEventHandler(level, action));

                Values.Add(key, values);
            }
        }
Ejemplo n.º 16
0
 public UpdateObjectEventHandler(ExecutionPriority level, Action <GameObject, Vector3, Quaternion, int> action)
 {
     Level       = level;
     this.action = action;
 }
Ejemplo n.º 17
0
 internal Operator(char operatorCharacter, Func <IMathComponent, IMathComponent, double> func, ExecutionPriority executionPriority)
 {
     OperatorCharacter = operatorCharacter;
     OperatorFunction  = func;
     ExecutionPriority = executionPriority;
 }
Ejemplo n.º 18
0
 public RaycastHitHandler(ExecutionPriority priority, Action <RaycastHit, int> action)
 {
     this.Priority = priority;
     this.Action   = action;
 }
Ejemplo n.º 19
0
 public IntFloatHandler(ExecutionPriority priority, Action <int, float> action)
 {
     this.Priority = priority;
     this.Action   = action;
 }
Ejemplo n.º 20
0
        /// <summary>
        /// Registers operator for use in calculator
        /// </summary>
        /// <param name="operatorCharacter">Unique character for this operator</param>
        /// <param name="func">Mathematical operation performed on two math components</param>
        /// <param name="executionPriority">Execution priority of this operator</param>
        /// <returns>New operator instance</returns>
        public static Operator RegisterOperator(char operatorCharacter, Func <IMathComponent, IMathComponent, double> func, ExecutionPriority executionPriority)
        {
            Operator @operator = new Operator(operatorCharacter, func, executionPriority);

            operators.Add(@operator);
            return(@operator);
        }