Пример #1
0
        private void Awake()
        {
            behaviour = new MBehaviour(ExecutionPriority.High, -100, enabled);

            normalCamera = new CameraProperty(MUtility.MainCamera);

            if (isSetCamera)
            {
                setCamera.SetCameraProperty(MUtility.MainCamera);
            }

            if (onAwakeEvent != null)
            {
                onAwakeEvent.Invoke();
            }
            IsExperimentHome = true;

            //behaviour.OnAwake_MBehaviour(() =>
            //{
            //    normalCamera = new CameraProperty(MUtility.MainCamera);

            //    if (isSetCamera)
            //    {
            //        setCamera.SetCameraProperty(MUtility.MainCamera);
            //    }

            //    if (onAwakeEvent != null)
            //        onAwakeEvent.Invoke();
            //    IsExperimentHome = true;
            //});

            //behaviour.OnEnable_MBehaviour(() =>
            //{
            //    if (onEnableEvent != null)
            //        onEnableEvent.Invoke();
            //});

            //behaviour.OnStart_MBehaviour(() =>
            //{
            //    if (IsSetLighting && lightingData != null)
            //        SystemParameters.SetLighting(lightingData);

            //    if (onStartEvent != null)
            //        onStartEvent.Invoke();
            //});

            //behaviour.OnDisable_MBehaviour(() =>
            //{
            //    if (onDisableEvent != null)
            //        onDisableEvent.Invoke();
            //});

            //behaviour.OnDestroy_MBehaviour(() =>
            //{
            //    if (onDestoryEvent != null)
            //        onDestoryEvent.Invoke();

            //    if (normalLighting != null)
            //    {
            //        SystemParameters.SetLighting(normalLighting);
            //    }
            //});
        }