コード例 #1
0
 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");
 }
コード例 #2
0
 void Update()
 {
     if (manager is null)
     {
         manager = ActuatorsManager.GetInstance();
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 void Awake()
 {
     manager = ActuatorsManager.GetInstance();
     base.Awake();
 }