/// <summary> /// 初始化 /// </summary> /// <param name="mainObject"></param> private void Initialization(MonoBehaviour mainBehavior) { if (mainBehavior != null) { driverBehaviour = mainBehavior.gameObject.AddComponent <DriverBehaviour>(); driverBehaviour.SetDriver(this); } }
/// <summary> /// 初始化 /// </summary> /// <param name="mainBehavior">mono脚本</param> private void Initialization(Component mainBehavior) { if (mainBehavior == null) { return; } driverBehaviour = mainBehavior.gameObject.AddComponent <DriverBehaviour>(); driverBehaviour.SetDriver(this); }