private void Awake() { scriptFinderInstance = this; // this keyword refers to this instance of this script scripttofind2.setname("chloe"); scripttofind2.myName = "chloe"; }
public override void OnInspectorGUI() { DrawDefaultInspector(); scriptFinderScript = target as ScriptFinder; if (GUILayout.Button("Get All Objects")) { Undo.RecordObject(scriptFinderScript, "Get All Objects"); scriptFinderScript.FillSceneGameObjectList(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set SpriteColorFade Ref")) { Undo.RecordObject(scriptFinderScript, "Set SpriteColorFade Ref"); scriptFinderScript.SpriteColorFadeRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set FadeInOutSprite Ref")) { Undo.RecordObject(scriptFinderScript, "Set FadeInOutSprite Ref"); scriptFinderScript.FadeInOutSpriteRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set TMPTextColorFade Ref")) { Undo.RecordObject(scriptFinderScript, "Set TMPTextColorFade Ref"); scriptFinderScript.TMPTextColorFadeRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set TMPWarpText Ref")) { Undo.RecordObject(scriptFinderScript, "Set TMPWarpText Ref"); scriptFinderScript.TMPWarpTextRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set LvlCompEggMove Ref")) { Undo.RecordObject(scriptFinderScript, "Set LvlCompEggMove Ref"); scriptFinderScript.TempLvlCompEggMoveRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } if (GUILayout.Button("Set LvlCompEggAnim Ref")) { Undo.RecordObject(scriptFinderScript, "Set LvlCompEggAnim Ref"); scriptFinderScript.LvlCompEggAnimRefFinder(); EditorUtility.SetDirty(scriptFinderScript); } }
static void Main(string[] args) { NLogConfiguration.Configure(LogLevel.Info); ParserResult <CommandLineArguments> parserResult = Parser.Default.ParseArguments <CommandLineArguments>(args); if (parserResult.Tag == ParserResultType.NotParsed) { Environment.ExitCode = ErrorInvalidCommandLine; return; } DirectoryInfo inputDirectory = null; DirectoryInfo outputDirectory = null; parserResult.WithParsed((commandLineArguments) => { inputDirectory = new DirectoryInfo(commandLineArguments.InputDirectory); outputDirectory = new DirectoryInfo(commandLineArguments.OutputDirectory); }); Logger.Info("Searching for scripts in '{0}'.", inputDirectory.FullName); List <FileInfo> fileInfos = ScriptFinder.FindScriptsRecursivelyUnder(inputDirectory); Logger.Info("Found '{0}' scripts in '{1}'.", fileInfos.Count, inputDirectory.FullName); Analyzer analyzer = new Analyzer(fileInfos, inputDirectory); List <FileModel> fileModelList = analyzer.Analyze(); Logger.Info("Writing model to JSON in '{0}' ...", outputDirectory.FullName); foreach (FileModel fileModel in fileModelList) { DirectoryInfo subFolderInOutputDirectory = CreateSubFolderInOutputDirectory(fileModel, inputDirectory, outputDirectory); string jsonString = JsonSerializer.Serialize(fileModel, _options); File.WriteAllText(BuildJsonName(subFolderInOutputDirectory, fileModel), jsonString); } Logger.Info("Finished writing model to JSON."); }
// Start is called before the first frame update void Start() { scriptfinder = FindObjectOfType <ScriptFinder>(); }
public Transform objectTransform; // a reference to the script to find. private void Awake() { ScriptFinderInstance = this; // "This" keyword refers to THIS instance of the script. }