public MBehaviour(ExecutionPriority priority = ExecutionPriority.Mid, float executionOrder = 0, bool isActive = true) { this.priority = priority; this.executionOrder = executionOrder; this.IsActive = isActive; this.isEnable = isActive; MBehaviourController.AddBehaviour(this); }
private void Awake() { behaviour = new MBehaviour(ExecutionPriority.Highest, -1000, enabled); behaviour.OnAwake(() => { MUtility.CurrentPlatform = CurrentPlatform; SwitchPlatform(Application.platform); }); behaviour.OnDestroy(() => { DestoryPlatform(Application.platform); }); DontDestroyOnLoad(gameObject); MBehaviourController.AddBehaviour(behaviour); }