예제 #1
0
 public FCgInputActionMapping()
 {
     ActionName = "";
     Action     = null;
     KeyName    = "";
     Key        = KeyCode.None;
     Scale      = 1.0f;
 }
예제 #2
0
 public void Set(FECgInputAction action, ECgInputEvent e, float value, Vector3 location, Vector3 rotation)
 {
     Action   = action;
     Event    = e;
     Value    = value;
     Location = location;
     Rotation = rotation;
 }
예제 #3
0
        public FCgInput GetInput(FECgInputAction action, List <ECgInputEvent> events)
        {
            FCgInput input = GetInput(action);

            if (input != null)
            {
                return(events.IndexOf(input.Event) != CgTypes.INDEX_NONE ? input : null);
            }
            return(null);
        }
예제 #4
0
        public FCgInput GetInput(FECgInputAction action, ECgInputEvent e)
        {
            FCgInput input = GetInput(action);

            if (input != null)
            {
                return(input.Event == e ? input : null);
            }
            return(null);
        }
예제 #5
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;
        }
예제 #6
0
 public void Reset()
 {
     IsAllocated = false;
     IsConsumed  = false;
     Action      = null;
     Event       = ECgInputEvent.MAX;
     Value       = Mathf.Infinity;
     Location    = Vector3.zero;
     Rotation    = Vector3.zero;
     Duration    = 0f;
 }
예제 #7
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;
 }
예제 #8
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;
 }
예제 #9
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);
        }
예제 #10
0
        public FCgInput GetInput(FECgInputAction action)
        {
            int count = Inputs.Count;

            for (int i = 0; i < count; ++i)
            {
                if (Inputs[i].Action == action)
                {
                    return(Inputs[i]);
                }
            }
            return(null);
        }
예제 #11
0
        public void AddMapping(ECgInputDevice device, string actionName, FECgInputAction action, string keyName, KeyCode key)
        {
            FCgInputActionMappings       deviceMapping = DeviceMappings[(byte)device];
            List <FCgInputActionMapping> mappings      = deviceMapping.Mappings;

            int count = mappings.Count;

            mappings.Add(new FCgInputActionMapping());
            FCgInputActionMapping mapping = mappings[count];

            mapping.ActionName = actionName;
            mapping.Action     = action;
            mapping.KeyName    = keyName;
            mapping.Key        = key;
        }
예제 #12
0
        public FCgInputActionMapping GetMapping(ECgInputDevice device, FECgInputAction action)
        {
            FCgInputActionMappings       deviceMapping = DeviceMappings[(byte)device];
            List <FCgInputActionMapping> mappings      = deviceMapping.Mappings;

            int count = mappings.Count;

            for (int i = 0; i < count; ++i)
            {
                FCgInputActionMapping mapping = mappings[i];

                if (action == mapping.Action)
                {
                    return(deviceMapping.Mappings[i]);
                }
            }
            return(mappings[CgTypes.FIRST]);
        }
예제 #13
0
        public KeyCode GetKey(ECgInputDevice device, FECgInputAction action)
        {
            FCgInputActionMappings       deviceMapping = DeviceMappings[(byte)device];
            List <FCgInputActionMapping> mappings      = deviceMapping.Mappings;

            int count = mappings.Count;

            for (int i = 0; i < count; ++i)
            {
                FCgInputActionMapping mapping = mappings[i];

                if (action == mapping.Action)
                {
                    return(mapping.Key);
                }
            }
            return(KeyCode.None);
        }
예제 #14
0
        public void SetKey(ECgInputDevice device, FECgInputAction action, KeyCode key)
        {
            FCgInputActionMappings       deviceMapping = DeviceMappings[(byte)device];
            List <FCgInputActionMapping> mappings      = deviceMapping.Mappings;

            int count = mappings.Count;

            for (int i = 0; i < count; ++i)
            {
                FCgInputActionMapping mapping = mappings[i];

                if (action == mapping.Action)
                {
                    mapping.KeyName = key == KeyCode.None ? "" : key.ToString();
                    mapping.Key     = key;
                    break;
                }
            }
        }
예제 #15
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));
            }
        }
예제 #16
0
 public void AddOrInput(FECgInputAction action, ECgInputEvent e, Quaternion rotation)
 {
     AddOrInput(action, e, 0.0f, Vector3.zero, rotation.eulerAngles);
 }
예제 #17
0
 public FCgKeyInputHandler()
 {
     Action = null;
 }
예제 #18
0
 public FCgKeyInputHandler(FECgInputAction action)
 {
     Action = action;
     Event  = new FCgKeyInputHandler_Event();
 }
예제 #19
0
 public void Allocate(FECgInputAction action, ECgInputEvent e)
 {
     Allocate(action, e, 0f, Vector3.zero, Vector3.zero);
 }
예제 #20
0
 public void Allocate(FECgInputAction action, ECgInputEvent e, float value)
 {
     Allocate(action, e, value, Vector3.zero, Vector3.zero);
 }
예제 #21
0
 public void Allocate(FECgInputAction action, ECgInputEvent e, Vector3 location, Vector3 rotation)
 {
     Allocate(action, e, 0f, location, rotation);
 }
예제 #22
0
 public void Allocate(FECgInputAction action, ECgInputEvent e, float value, Vector3 location, Vector3 rotation)
 {
     IsAllocated = true;
     Set(action, e, value, location, rotation);
 }
예제 #23
0
 public void Set(FECgInputAction action, ECgInputEvent e)
 {
     Set(action, e, 0f, Vector3.zero, Vector3.zero);
 }
예제 #24
0
 public void AddAndInput(FECgInputAction action, ECgInputEvent e)
 {
     AddAndInput(action, e, 0.0f, Vector3.zero, Vector3.zero);
 }
예제 #25
0
 public void Set(FECgInputAction action, ECgInputEvent e, Vector3 location, Vector3 rotation)
 {
     Set(action, e, 0f, location, rotation);
 }
예제 #26
0
 public void Set(FECgInputAction action, ECgInputEvent e, float time)
 {
     Set(action, e, time, Vector3.zero, Vector3.zero);
 }
예제 #27
0
 public void AddAndInput(FECgInputAction action, ECgInputEvent e, float value)
 {
     AddAndInput(action, e, value, Vector3.zero, Vector3.zero);
 }
예제 #28
0
 public void AddOrInput(FECgInputAction action, ECgInputEvent e, Vector3 location)
 {
     AddOrInput(action, e, 0.0f, location, Vector3.zero);
 }