示例#1
0
        internal static void ExecuteBones(UpdateTiming updateTiming)
        {
            if (s_bonesMap.Count == 0)
            {
                return;
            }

            Profiler.BeginSample("BoingManager.ExecuteBones");

            foreach (var itBones in s_bonesMap)
            {
                var bones = itBones.Value;
                if (bones.InitRebooted)
                {
                    continue;
                }

                bones.Reboot();
                bones.InitRebooted = true;
            }

      #if UNITY_2018_1_OR_NEWER
            if (UseAsynchronousJobs)
            {
                BoingWorkAsynchronous.ExecuteBones(s_aEffectorParams, s_bonesMap, updateTiming);
            }
            else
      #endif
            {
                BoingWorkSynchronous.ExecuteBones(s_aEffectorParams, s_bonesMap, updateTiming);
            }

            Profiler.EndSample();
        }
示例#2
0
        internal static void ExecuteBehaviors(UpdateTiming updateTiming)
        {
            if (s_behaviorMap.Count == 0)
            {
                return;
            }

            Profiler.BeginSample("BoingManager.ExecuteBehaviors");

            foreach (var itBehavior in s_behaviorMap)
            {
                var behavior = itBehavior.Value;
                if (behavior.InitRebooted)
                {
                    continue;
                }

                behavior.Reboot();
                behavior.InitRebooted = true;
            }

      #if UNITY_2018_1_OR_NEWER
            if (UseAsynchronousJobs)
            {
                BoingWorkAsynchronous.ExecuteBehaviors(s_behaviorMap, updateTiming);
            }
            else
      #endif
            {
                BoingWorkSynchronous.ExecuteBehaviors(s_behaviorMap, updateTiming);
            }

            Profiler.EndSample();
        }
示例#3
0
        internal static void ExecuteReactors(UpdateTiming updateTiming)
        {
            if (s_effectorMap.Count == 0 && s_reactorMap.Count == 0 && s_fieldMap.Count == 0 && s_cpuSamplerMap.Count == 0)
            {
                return;
            }

            Profiler.BeginSample("BoingManager.ExecuteReactors");

            foreach (var itReactor in s_reactorMap)
            {
                var reactor = itReactor.Value;
                if (reactor.InitRebooted)
                {
                    continue;
                }

                reactor.Reboot();
                reactor.InitRebooted = true;
            }

      #if UNITY_2018_1_OR_NEWER
            if (UseAsynchronousJobs)
            {
                BoingWorkAsynchronous.ExecuteReactors(s_effectorMap, s_reactorMap, s_fieldMap, s_cpuSamplerMap, updateTiming);
            }
            else
      #endif
            {
                BoingWorkSynchronous.ExecuteReactors(s_aEffectorParams, s_reactorMap, s_fieldMap, s_cpuSamplerMap, updateTiming);
            }

            Profiler.EndSample();
        }
示例#4
0
        private static void PostUnregisterBehavior()
        {
            if (s_behaviorMap.Count > 0)
            {
                return;
            }

      #if UNITY_2018_1_OR_NEWER
            BoingWorkAsynchronous.PostUnregisterBehaviorCleanUp();
      #endif
        }
示例#5
0
        private static void PostUnregisterEffectorReactor()
        {
            if (s_effectorMap.Count > 0 || s_reactorMap.Count > 0 || s_fieldMap.Count > 0 || s_cpuSamplerMap.Count > 0 || s_gpuSamplerMap.Count > 0)
            {
                return;
            }

            s_effectorParamsList = null;
            s_effectorParamsBuffer.Dispose();
            s_effectorParamsBuffer = null;

      #if UNITY_2018_1_OR_NEWER
            BoingWorkAsynchronous.PostUnregisterEffectorReactorCleanUp();
      #endif
        }
示例#6
0
        private static void PostUnregisterBehavior()
        {
            if (s_behaviorMap.Count > 0)
            {
                return;
            }

      #if UNITY_2018_1_OR_NEWER
            BoingWorkAsynchronous.PostUnregisterBehaviorCleanUp();
      #endif

            Camera.onPreCull    -= UpdateBehaviorsPreCull;
            Camera.onPostRender -= UpdateBehaviorsPostRender;

      #if UNITY_2019_1_OR_NEWER
            RenderPipelineManager.beginFrameRendering -= UpdateBehaviorsPreCull;
            RenderPipelineManager.endFrameRendering   -= UpdateBehaviorsPostRender;
      #endif
        }
示例#7
0
        internal static void PullBonesResults(UpdateTiming updateTiming)
        {
            if (s_bonesMap.Count == 0)
            {
                return;
            }

            Profiler.BeginSample("BoingManager.PullBonesResults");

      #if UNITY_2018_1_OR_NEWER
            if (UseAsynchronousJobs)
            {
                BoingWorkAsynchronous.PullBonesResults(s_aEffectorParams, s_bonesMap, updateTiming);
            }
            else
      #endif
            {
                BoingWorkSynchronous.PullBonesResults(s_aEffectorParams, s_bonesMap, updateTiming);
            }

            Profiler.EndSample();
        }
示例#8
0
        internal static void LateUpdateBonesPullResults()
        {
            if (s_bonesMap.Count == 0)
            {
                return;
            }

            Profiler.BeginSample("BoingManager.UpdateBonesLateUpdateExecute");

      #if UNITY_2018_1_OR_NEWER
            if (UseAsynchronousJobs)
            {
                BoingWorkAsynchronous.UpdateBonesLateUpdatePullResults(s_aEffectorParams, s_bonesMap);
            }
            else
      #endif
            {
                BoingWorkSynchronous.UpdateBonesLateUpdatePullResults(s_aEffectorParams, s_bonesMap);
            }

            Profiler.EndSample();
        }
示例#9
0
        private static void PostUnregisterEffectorReactor()
        {
            if (s_effectorMap.Count > 0 || s_reactorMap.Count > 0 || s_fieldMap.Count > 0 || s_cpuSamplerMap.Count > 0 || s_gpuSamplerMap.Count > 0)
            {
                return;
            }

            s_effectorParamsList = null;
            s_effectorParamsBuffer.Dispose();
            s_effectorParamsBuffer = null;

      #if UNITY_2018_1_OR_NEWER
            BoingWorkAsynchronous.PostUnregisterEffectorReactorCleanUp();
      #endif

            Camera.onPreCull    -= UpdateReactorsPreCull;
            Camera.onPostRender -= UpdateReactorsPostRender;

      #if UNITY_2019_1_OR_NEWER
            RenderPipelineManager.beginFrameRendering -= UpdateReactorsPreCull;
            RenderPipelineManager.endFrameRendering   -= UpdateReactorsPostRender;
      #endif
        }