コード例 #1
0
        /* "Debug" */
        private void DumpObjects()
        {
            //We put it in a try block.
            try
            {
                //Path to debug.txt dump. (Same folder as mysummercar.exe)
                string file_path = "ChildObjects.txt";

                //Declare an array and define its name.
                GameObject[] allObjects;

                //Declare an StreamWriter and define its name but also initialize it with given parmiters
                System.IO.StreamWriter sr = System.IO.File.CreateText(file_path);

                //We Initialize allObjects and give it the array values of GameObjects
                allObjects = UnityEngine.Object.FindObjectsOfType <GameObject>();

                //We write first line of the document to give it a "header" like appearance.
                sr.WriteLine("SceneObjects=>FindObjectsOfType<GameObject>:");

                //For every GameObject in allObjects we print the name of the object in to the file "SceneObjects.txt"
                foreach (var fsm in Resources.FindObjectsOfTypeAll <PlayMakerFSM>())
                {
                    var fsmfloat = new Func <string, FsmFloat>(fsm.FsmVariables.FindFsmFloat);
                    {
                        if (fsm.gameObject.transform.root.name == "Database")
                        {
                            sr.WriteLine(fsm.gameObject.name);
                        }
                    }
                }
                foreach (GameObject obj in allObjects)
                {
                    sr.WriteLine(obj.name);
                }

                //We close the StreamWriter...
                sr.Close();

                //Clean up console..
                ModConsole.Clear();

                //Print out a success message in console.
                ModConsole.Print("SceneObjects: Success creating " + file_path);
                ModConsole.Print(""); // For spacing..
                ModConsole.Print(""); // For spacing..
                ModConsole.Print(""); // For spacing..
            }
            catch (System.Exception) { ModConsole.Print("Something went wrong..."); }
        }
コード例 #2
0
 public override void Run(string[] args)
 {
     ModConsole.Clear();
 }