void Awake() { MyDebugger.enabled = debug; //Debug.unityLogger.logEnabled = false; triggerClassPath = @".\Assets\Scripts\Trigger.cs"; if (!Directory.Exists(@"Assets\Scripts")) { Directory.CreateDirectory(@"Assets\Scripts"); } if (ASPFilePath is null) { ASPFilePath = @".\Assets\Resources\" + gameObject.name + ".asp"; } actuatorsManager = ActuatorsManager.GetInstance(); sensorManager = SensorsManager.GetInstance(); if (Application.isEditor && !File.Exists(triggerClassPath)) { using (FileStream fs = File.Create(triggerClassPath)) { string triggerClassContent = "using System;\n"; triggerClassContent += "using UnityEngine;\n\n"; triggerClassContent += @"// every method of this class returning a bool value can be used to trigger the sensors update."; triggerClassContent += "\n public class Trigger:ScriptableObject{\n\n"; triggerClassContent += "}"; Byte[] info = new UTF8Encoding(true).GetBytes(triggerClassContent); fs.Write(info, 0, info.Length); } AssetDatabase.Refresh(); } //MyDebugger.MyDebug("FINISH WITH AWAKE"); }
void Update() { if (manager is null) { manager = ActuatorsManager.GetInstance(); } }
void Awake() { triggerClassPath = @".\Assets\Scripts\Trigger.cs"; if (!Directory.Exists("Assets/Scripts")) { Directory.CreateDirectory("Assets/Scripts"); } if (ASPFilePath.Equals(null)) { ASPFilePath = @".\Assets\Resources\" + gameObject.name + ".asp"; } actuatorsManager = ActuatorsManager.GetInstance(); sensorManager = SensorsManager.GetInstance(); if (Application.isEditor && !File.Exists(triggerClassPath)) { using (FileStream fs = File.Create(triggerClassPath)) { string triggerClassContent = "using System;\n"; triggerClassContent += "using UnityEngine;\n\n"; triggerClassContent += @"// every method of this class returning a bool value can be used to trigger the sensors update."; triggerClassContent += "\n public class Trigger:ScriptableObject{\n\n"; triggerClassContent += "}"; Byte[] info = new UTF8Encoding(true).GetBytes(triggerClassContent); fs.Write(info, 0, info.Length); } } else if (Application.isPlaying && enableBrain) { initBrain(); } }
void Awake() { manager = ActuatorsManager.GetInstance(); base.Awake(); }