Пример #1
0
        protected override void OnAdd(GUnit unit)
        {
            var controlDataList = ObjectControlDataDict.Get(unit);

            foreach (var controlData in controlDataList)
            {
                var controlModule = ObjectControlModuleDict.Get(controlData.controlType);
                controlData.objectControl = controlModule;

                ObjectControlStateTypeDict.Set(unit, controlData.controlType, KeyStateType.None);
            }
        }
Пример #2
0
        protected override void OnRemove(GUnit unit)
        {
            var controlStateData = unit.GetData <ObjectControlStateData>();

            controlStateData.stateType.Value = ObjectControlStateType.Finish;

            var controlDataList = ObjectControlDataDict.Get(unit);

            foreach (var controlData in controlDataList)
            {
                Pool.Release(controlData);
            }
            ObjectControlDataDict.Clear(unit);
            ObjectControlStateTypeDict.Clear(unit);
        }
Пример #3
0
        public static void CheckAllControl(GUnit unit, int controlType, ObjectControlStateData controlStateData,
                                           ObjectStateProcessData stateProcessData)
        {
            var controlDataList = ObjectControlDataDict.Get(unit);

            foreach (var controlData in controlDataList)
            {
                if (!ContainsControlType(controlData.objectControl.ControlTypeList, controlType))
                {
                    continue;
                }

                var controlModule = controlData.objectControl;
                var result        = controlModule.CheckControl(unit, controlData, stateProcessData);
                if (result.Item1)
                {
                    DoState(unit, controlData, result.Item2);
                }
            }
        }