Exemplo n.º 1
0
        private void Broadcast(ECgInputEvent e, MonoBehaviour mb)
        {
            CgInputAction_Event del;

            Events.TryGetValue(e, out del);
            del.Broadcast(mb);
        }
Exemplo n.º 2
0
        private void Broadcast(ECgInputEvent e, MonoBehaviour mb, float val)
        {
            FCgInputAxis_Event del;

            Events.TryGetValue(e, out del);
            del.Broadcast(mb, val);
        }
Exemplo n.º 3
0
        private void Broadcast(ECgInputEvent e, MonoBehaviour mb, Vector3 rotation)
        {
            FCgInputRotation_Event del;

            Events.TryGetValue(e, out del);
            del.Broadcast(mb, rotation);
        }
Exemplo n.º 4
0
        public void AddEvent(ECgInputEvent e, CgInputAction_Event.Event del)
        {
            CgInputAction_Event handler;

            Events.TryGetValue(e, out handler);
            handler.Add(del);
        }
Exemplo n.º 5
0
        public void AddEvent(ECgInputEvent e, FCgInputAxis_Event.Event del)
        {
            FCgInputAxis_Event handler;

            Events.TryGetValue(e, out handler);
            handler.Add(del);
        }
Exemplo n.º 6
0
 public void Set(ECgInputEvent e, float time, float realTime, ulong frame)
 {
     Event    = e;
     Time     = time;
     RealTime = realTime;
     Frame    = frame;
     Execute(e);
 }
Exemplo n.º 7
0
 public void Set(FECgInputAction action, ECgInputEvent e, float value, Vector3 location, Vector3 rotation)
 {
     Action   = action;
     Event    = e;
     Value    = value;
     Location = location;
     Rotation = rotation;
 }
Exemplo n.º 8
0
        public void Moved(float val)
        {
            ECgInputEvent e = ECgInputEvent.Moved;

            Info.Set(e, val);
            Manager_Input.AddInput(Action, e, val);

            Broadcast(e, Manager_Input.InputOwner, val);
        }
Exemplo n.º 9
0
        public void Stationary(Vector3 rotation)
        {
            ECgInputEvent e = ECgInputEvent.Stationary;

            Info.Set(e, rotation);
            Manager_Input.AddInput(Action, e, 0.0f, Vector3.zero, rotation);

            Broadcast(e, Manager_Input.InputOwner, rotation);
        }
Exemplo n.º 10
0
        public void Stationary(float val)
        {
            ECgInputEvent e = ECgInputEvent.Stationary;

            Info.Set(e, val);
            Manager_Input.AddInput(Action, e, val);

            Broadcast(e, Manager_Input.InputOwner, val);
        }
Exemplo n.º 11
0
        public void Moved(Vector3 location)
        {
            ECgInputEvent e = ECgInputEvent.Moved;

            Info.Set(e, location);
            Manager_Input.AddInput(Action, e, 0.0f, location);

            Broadcast(e, Manager_Input.InputOwner, location);
        }
Exemplo n.º 12
0
        public void FirstStationary(Vector3 location)
        {
            ECgInputEvent e = ECgInputEvent.FirstStationary;

            Info.Set(e, location);
            Manager_Input.AddInput(Action, e, 0.0f, location);

            Broadcast(e, Manager_Input.InputOwner, location);
        }
Exemplo n.º 13
0
        public FCgInput GetInput(FECgInputAction action, ECgInputEvent e)
        {
            FCgInput input = GetInput(action);

            if (input != null)
            {
                return(input.Event == e ? input : null);
            }
            return(null);
        }
Exemplo n.º 14
0
 public void Reset()
 {
     IsAllocated = false;
     IsConsumed  = false;
     Action      = null;
     Event       = ECgInputEvent.MAX;
     Value       = Mathf.Infinity;
     Location    = Vector3.zero;
     Rotation    = Vector3.zero;
     Duration    = 0f;
 }
Exemplo n.º 15
0
        public void Execute(ECgInputEvent e)
        {
            Dictionary <FECgInputAction, FCgKeyInputHandler> map = HandlerMap[(byte)e];

            Dictionary <FECgInputAction, FCgKeyInputHandler> .ValueCollection handles = map.Values;

            foreach (FCgKeyInputHandler h in handles)
            {
                h.Broadcast();
            }
        }
Exemplo n.º 16
0
        public void AddAndInput(FECgInputAction action, ECgInputEvent e, float value, Vector3 location, Vector3 rotation)
        {
            AndInputs.Add(new FCgInput());
            int index = AndInputs.Count - 1;

            AndInputs[index].Action   = action;
            AndInputs[index].Event    = e;
            AndInputs[index].Value    = value;
            AndInputs[index].Location = location;
            AndInputs[index].Rotation = rotation;
        }
Exemplo n.º 17
0
        public void Pressed()
        {
            ECgInputEvent e = ECgInputEvent.Pressed;

            if (Info.Last_Event == ECgInputEvent.FirstPressed)
            {
                Info.Event = e;
            }
            Manager_Input.AddInput(Action, e);

            Broadcast(e, Manager_Input.InputOwner);
        }
Exemplo n.º 18
0
 public void Init(ushort poolIndex)
 {
     PoolIndex   = poolIndex;
     IsAllocated = false;
     IsConsumed  = false;
     Action      = null;
     Event       = ECgInputEvent.MAX;
     Value       = Mathf.Infinity;
     Location    = Vector3.zero;
     Rotation    = Vector3.zero;
     Duration    = 0f;
 }
Exemplo n.º 19
0
 public FCgInput()
 {
     PoolIndex   = INVALID_POOL_INDEX;
     IsAllocated = false;
     IsConsumed  = false;
     Action      = null;
     Event       = ECgInputEvent.MAX;
     Value       = Mathf.Infinity;
     Location    = Vector3.zero;
     Rotation    = Vector3.zero;
     Duration    = 0f;
 }
Exemplo n.º 20
0
 public FCgInputInfo(ECgInputType type, ECgInputValue valueType)
 {
     Type       = type;
     ValueType  = valueType;
     Event      = ECgInputEvent.MAX;
     Last_Event = ECgInputEvent.MAX;
     Value      = 0f;
     Location   = Vector3.zero;
     Rotation   = Quaternion.identity;
     Euler      = Vector3.zero;
     Duration   = 0f;
 }
Exemplo n.º 21
0
        public void AddOrInputToWord(int index, FECgInputAction action, ECgInputEvent e, float value = 0.0f, Vector3 location = new Vector3(), Vector3 rotation = new Vector3())
        {
            int count = Words.Count;

            if (index >= count)
            {
                for (int i = 0; i < index - count + 1; ++i)
                {
                    Words.Add(new FCgInputWord());
                }
            }
            Words[index].AddOrInput(action, e, value, location, rotation);
        }
Exemplo n.º 22
0
        public void FirstReleased()
        {
            if ((Manager_Input.CurrentInputActionMap & ActionMap) == NONE)
            {
                return;
            }

            ECgInputEvent e = ECgInputEvent.FirstReleased;

            Info.Event = e;
            Manager_Input.AddInput(Action, e);

            Broadcast(e, Manager_Input.InputOwner);
        }
Exemplo n.º 23
0
        public bool UnBind(ECgInputEvent e, FCgDelegateHandle handle)
        {
            Dictionary <FECgInputAction, FCgKeyInputHandler> map = HandlerMap[(byte)e];

            Dictionary <FECgInputAction, FCgKeyInputHandler> .ValueCollection handles = map.Values;

            bool success = false;

            foreach (FCgKeyInputHandler h in handles)
            {
                success |= h.Remove(handle);
            }
            return(success);
        }
Exemplo n.º 24
0
        public FCgKeyInput(KeyCode key)
        {
            Key       = key;
            Event     = ECgInputEvent.MAX;
            Time      = 0f;
            RealTime  = 0f;
            DeltaTime = 0f;
            Frame     = 0;

            HandlerMap = new Dictionary <FECgInputAction, FCgKeyInputHandler> [(byte)ECgInputEvent.MAX];

            int len = (int)ECgInputEvent.MAX;

            for (int i = 0; i < len; ++i)
            {
                HandlerMap[i] = new Dictionary <FECgInputAction, FCgKeyInputHandler>(new FECgInputActionEqualityComparer());
            }
        }
Exemplo n.º 25
0
        public FCgDelegateHandle Bind(FECgInputAction action, ECgInputEvent e, FCgMulticastDelegate.Event del)
        {
            Dictionary <FECgInputAction, FCgKeyInputHandler> map = HandlerMap[(byte)e];

            FCgKeyInputHandler handle = null;
            bool found = map.TryGetValue(action, out handle);

            if (found)
            {
                return(handle.Add(del));
            }
            else
            {
                handle = new FCgKeyInputHandler(action);

                map.Add(action, handle);
                return(handle.Add(del));
            }
        }
Exemplo n.º 26
0
 public void AddAndInput(FECgInputAction action, ECgInputEvent e, float value)
 {
     AddAndInput(action, e, value, Vector3.zero, Vector3.zero);
 }
Exemplo n.º 27
0
 public void AddAndInput(FECgInputAction action, ECgInputEvent e)
 {
     AddAndInput(action, e, 0.0f, Vector3.zero, Vector3.zero);
 }
Exemplo n.º 28
0
 public void Set(ECgInputEvent e, Quaternion rotation)
 {
     Event    = e;
     Rotation = rotation;
     Euler    = Rotation.eulerAngles;
 }
Exemplo n.º 29
0
 public void Set(ECgInputEvent e, Vector3 location)
 {
     Event    = e;
     Location = location;
 }
Exemplo n.º 30
0
 public void Set(ECgInputEvent e, float value)
 {
     Event = e;
     Value = value;
 }