This commit is contained in:
CortexCore
2023-10-24 23:38:22 +08:00
parent 2c4710bc5d
commit bd40165ade
152 changed files with 3681 additions and 1531 deletions

View File

@@ -1,28 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public abstract class Mono : MonoBehaviour, IMonoProxy
{
protected virtual void Awake()
{
}
protected virtual void Start()
{
}
protected virtual void Update()
{
}
protected virtual void FixedUpdate()
{
}
protected virtual void LateUpdate()
{
}
protected virtual void OnDestroy()
{
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 13003171a12d81c4eaee9c516471992a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,40 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace BITKit
{
public class MonoEvents : Mono
{
public UnityEvent OnAwake = new();
public UnityEvent OnStart = new();
public UnityEvent<float> OnUpdate = new();
public UnityEvent<float> OnFixexUpdate = new();
public UnityEvent<float> OnLateUpdate = new();
public UnityEvent OnDestroyComponent = new();
protected override void Awake()
{
OnAwake.Invoke();
}
protected override void Start()
{
OnStart.Invoke();
}
protected override void Update()
{
OnUpdate.Invoke(Time.deltaTime);
}
protected override void FixedUpdate()
{
OnFixexUpdate.Invoke(Time.deltaTime);
}
protected override void LateUpdate()
{
OnLateUpdate.Invoke(Time.deltaTime);
}
protected override void OnDestroy()
{
OnDestroyComponent.Invoke();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1e8903c9eaac98b4788b121973994a29
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -9,7 +9,8 @@ namespace BITKit
public abstract class StateBasedMonoBehaviour<T> : MonoBehaviour, IStateMachine<T> where T : IState
{
[SerializeField] private MonoStateMachine<T> stateMachine;
protected Transform Transform => _transform ? _transform : _transform = transform;
private Transform _transform;
public bool Enabled
{
get => stateMachine.Enabled;