Questions in topic: "process" The latest questions for the topic "process" Detect how much RAM is available? (IL2CPP) Process.GetCurrentProcess().WorkingSet64 returns zero Hello guys, i want to know how much RAM is available on the device. Process.GetCurrentProcess().WorkingSet64 & PeakWorkingSet64 returns zero. How to evaluate available memory in IL2CPP-Builds? c# memory il2cpp process ram Tue, 08 Jun 2021 16:31:51 GMT DeveloperZeeDE Unity variables disappear when a method is called on an event from an external process I'm writing a chess UI with Unity as well as an external engine (executable written in c#). I can send and receive data to and from the process (engine). This is working, But when the Make_Move method is called, when the process responds back with data, a problem occurs. While debugging the code execution just stops when trying to access the Unity objects in the Make_Move method, and The objects are missing namely the piece gameObject and sprite but the rest of the variables(that are not unity objects) is still there. I don't get any errors, all of the variables are part of a class that is kept in an array that keeps track of the piece it's sprite the gameObject as well as other things. why would only the unity objects disappear from the object array? why does code execution stop when trying to access the unity objects (sprite's etc)? How to fix this? Unity class for sending and receiving a 4 digit string, the start, and end position of the move to make (xyxy) public static class UCI { static Process process = new Process(); static UCI() { ProcessStartInfo si = new ProcessStartInfo() { FileName = @"C:\Users\hanno\OneDrive\Documents\Coding\Projectsc#\ChessEngine\ChessEngine\bin\Debug\ChessEngine.exe", UseShellExecute = false, CreateNoWindow = true, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true }; process.StartInfo = si; process.OutputDataReceived += new DataReceivedEventHandler(OnRecieved); process.Start(); process.BeginErrorReadLine(); process.BeginOutputReadLine(); } public static void SendLine(string command) { Debug.Log("send: "+ command); process.StandardInput.WriteLine(command); process.StandardInput.Flush(); } public static void Kill() { process.Kill(); } private static void OnRecieved(object sender, DataReceivedEventArgs e) { string text = e.Data; Debug.Log("Recieved: " + text); if(text.Length == 4) Game.MakeMove(new Move(Board.Squares[(int)char.GetNumericValue(text[0]),(int)char.GetNumericValue(text[1])],Board.Squares[(int)char.GetNumericValue(text[2]), (int)char.GetNumericValue(text[3])])); } } Unity make_Move method where the problem occurs: static void Make_Move(Move move) { var end = move.end.GetPiece(); //posistion is a vector2Int, this line does not cause any trouble print("Pos: " + Squares[move.start.GetPosition().x, move.start.GetPosition().y].GetPosition()); //this line causes exexution to stop without error. if it is commented out execution will continue. print("obj: " + Squares[move.start.GetPosition().x, move.start.GetPosition().y].gameObject); //lines below this is not executed SetPiece(move.start.gameObject.GetComponent<Image>().sprite, move.end.GetPosition(), end.MoveCnt); RemovePiece(move.start.GetPosition()); // set the current turn to the other player CurrentPlayer = CurrentPlayer == players[0] ? CurrentPlayer = players[1] : CurrentPlayer = players[0]; } c# event external process Wed, 10 Feb 2021 16:02:39 GMT HannoKruger Unity standard input/output piping I have a unity build being executed by a program I'm running. The exact command is: build.exe -batchmode -nographics ---------- My problem is that I need to pipe input and output through unity using it's stdio streams. I know that I can use Debug.unityLogger to output any data from unity into the parent process, but my question is if it's possible to access any data sent into unity from the parent process (to access the stdin stream from within unity) ---------- How would I handle data being directly sent to unity though the parent process? networking process Tue, 10 Nov 2020 12:56:57 GMT jordanclay325 Capture screen of external process Hello, I've got this code: public void Launch() { Process process = Process.Start("mspaint.exe"); Thread.Sleep(1000); User32.GetWindowRect(process.MainWindowHandle, out User32.RECT rect); Tools.ScreenCapture screenCapture = new Tools.ScreenCapture(); Bitmap img = screenCapture.CaptureWindow(process.Handle); img.Save("c:\\tmp\\test.png", ImageFormat.Png); //gameObject.GetComponent<Image> } It's supposed to work but I always get an empty "MainWindowHandle" (0x0) which is supposed to be define as the application is graphical. The code works outside Unity, with a in independent project. When I try Process.GetCurrentProcess(), I always get Unity which may be why it doesn't work. I don't mind using an other method. All I want is to capture a screenshot of an external application and a crossplateforme solution. Thank you for your help. screenshot process Fri, 09 Oct 2020 08:24:04 GMT ValentinBeaule EXE run from unity does not work as it should. I am attempting to run my own custom .exe from unity which I have managed to do. The .exe runs perfectly when I open it manually by double clicking, but from Unity it just opens then does not work at all. <br> For context, the .exe is a very basic script which reads a text file and then creates another one. When run from Unity the executable window says that this file does not exist, when I know it does, and then immediately closes. I have tried running this .exe with these methods: Application.OpenURL(path + "Search.exe"); and Process.Start(path + "Search.exe"); and I have tried this with the .exe and the text file being in different places (Application.dataPath, Application.persistentDataPath, and also an external folder on my computer). <br> It seems no matter what I do the .exe just doesn't run the same from Unity as when I click on it. executable process Thu, 23 Jul 2020 14:02:48 GMT mike175 How to use a pre-trained h5 MachineLearning model for a Rock Paper Scissors in Unity3D? Hello, My team and I are making this VR Rock Paper Scissors game on unity 3D, and we are planning to apply a bit of ML for the sequence prediction so that the AI can predict our next move. The problem is, I don't know how to extract the data while in-game (meaning an array of past moves; I'm using a pre-trained LSTM model) to the python script. A bit of research tells me that ironpython causes a bit of lag and/or isn't reliable for real time execution (hope I'm wrong about this). **TLDR** : I have a pretrained h5 model. I want to extract in game data in real time to use the h5 model to predict the next move, THEN extract the output of the prediction to use in-game. I appreciate your help :) data process python Thu, 23 Apr 2020 09:40:14 GMT phanbionicle Script Takes time to compile in unity Hi in a empty project, i made script and added couple of codes like player movments , varaibles when i back to unity it takes like 6+ seconds to compile in unity how can i make it faster? script. process faster Wed, 18 Mar 2020 06:16:03 GMT harethl1s Unity Editor freezes when starting several System.Diagnostics.Process one after another I have got a method that starts an external process via System.Diagnostics.Process and returns its output as a string: public static string ExecuteCommand(string command, string[] arguments) { var processInfo = new System.Diagnostics.ProcessStartInfo(command, string.Join(" ", arguments)); processInfo.CreateNoWindow = true; processInfo.RedirectStandardOutput = true; processInfo.UseShellExecute = false; string output = ""; var process = System.Diagnostics.Process.Start(processInfo); while (!process.StandardOutput.EndOfStream) output += process.StandardOutput.ReadLine() + "\n"; process.WaitForExit(); process.Close(); Debug.Log(output); return output; } Which works fine, the editor is frozen while the command is being executed which is expected using the `process.WaitForExit()` flag, however I noticed that when calling this function multiple times, the editor stays frozen until the last command has finished executing. So, if I have: ExecuteCommand("adb", "install test.apk") Debug.Log("A") ExecuteCommand("adb", "uninstall") Debug.Log("B") ExecuteCommand("adb", "push file.mp4") Debug.Log("C") A, B and C won't be printed until the last command (adb push) has finished execution. I can understand the ExecuteCommand method is blocking but shouldn't control being given back to the Unity Editor once it's finished and letting print the debug messages inbetween calls? How could I fix this? Can't use coroutines because it's an EditorWindow script. freeze command call external process Wed, 06 Nov 2019 11:58:11 GMT leon_r42 Send data from unity to windows form application using named pipe? I tried Implementing this: I could get data from wcf host to Unity app. But I want to do exactly reverse of this. I want to send data from unity to Windows Form using namedpipes. I also tried to implement this: in above method. Although i could create proxy class script. I was unable to host a server from unity that could send data from Unity build to the client Web Application. All i want is to create a wrapper DLL that can be implemented in any application which runs on same desktop. I have tried Interprocess communication methods, but examples could only limit data sent to unity app , and not data sent from unity app This DLL accepts data which is sent by Unity App and then can be received by Clients app which he/she makes at his side. Any resource or help is mostly appreciated. Thanks in advance name communication process pipe Fri, 24 May 2019 05:17:27 GMT jayeshK Issues running gdb debug mode in runtime,Running GDB during run time of application My application is essentially trying to run whatever C based codes the user has typed into the textbox provided. Afterwhich it will compile the code which will create the exe file for gdb to run. My problem now is if gdb is waiting for an user input, I wont be able to readline from the background console it is running on, are there any workarounds for me to read the command that essentially waits states that it is waiting for a user input. GDB will print (gdb) without a \n to wait for a user input. I have tried using Process.Threads but my process.Threads returned an empty list of threads. runtime compiler threads command-line process Wed, 20 Mar 2019 14:03:44 GMT zn96 Debug Statement Doesn't Work? Hi guys, I've got this code string filePath = PlayerPrefs.GetString("Igloo Install Location") + "\\IglooWarper"; if (File.Exists(filePath)) { UnityEngine.Debug.Log(filePath); } Process.Start(PlayerPrefs.GetString("Igloo Install Location") + "\\IglooWarper"); //Needs the full file path to launch; defined in registry. The Process.Start line works fine, but the lines above, with the Debug statement won't get hit. It fires if !File.Exists but I know that it does, obviously, because it's launching. using system.IO; Any ideas? Thanks. string debug file process exists Tue, 05 Feb 2019 15:57:02 GMT TSCSimulation_AH Scheduling a job issue I'm trying to schedule a job for my ECS system, I'm following the docs on [ECS docs][1] specifically the handling of the job: protected override JobHandle OnUpdate(JobHandle inputDeps) { MovementJob moveJob = new MovementJob { topBound = GameManager.GM.topBound, bottomBound = GameManager.GM.bottomBound, deltaTime = Time.deltaTime }; JobHandle moveHandle = moveJob.Schedule(this, 64, inputDeps); return moveHandle; } _When trying to schedule this job on my own class_ I get this error: ![alt text][2] even though the plant system derives from the job component system `public class PlantSystem : JobComponentSystem` Full code: public class PlantSystem : JobComponentSystem { [Unity.Burst.BurstCompile] struct PlantJob : IJobProcessComponentData<Position, Plant> { public float health; public void Execute(ref Position data0, ref Plant data1) { if( < 10000) { float data2 =; = data2 + 1; } } } protected override JobHandle OnUpdate(JobHandle inputDeps) { PlantJob plantJob = new PlantJob { health = 1.0f }; return plantJob.Schedule(this, 64, inputDeps); } } [1]: [2]: /storage/temp/130453-screenshot-1.png process Fri, 04 Jan 2019 00:08:51 GMT jmgek unity freezes when external process is running and breakpoint is triggered I have a problem where i run an external process through Diagnostics.Process, and then try to trigger a breakpoint. In my case i am using Unity 5.6 and Rider 2018.3. The result is that Unity freeze, and rider does not detect a breakpoint. If i after this de-attach rider from unity, unity remains frozen and needs to be force closed. In this post, the same issue is described with MonoDevelop: In addition to this, unity seems to freeze if it is recompiling while an external process is running. What can i do to avoid this? The processes running while compiling i can always work around, by killing all processes when compilation starts, but the breakpoint issue is completely breaking what i am trying to do. debugging external process breakpoint Thu, 06 Dec 2018 14:25:14 GMT tactileunity05 A proper way to manage game process????? Hi. I am currently making a game which has countdown for game progress. I take care of game process in Update function, just as below. But it guess there must be some better ways to do this. is there proper ways to manage this ??? if there is, what is the keyword that I have to search on google to learn it. Thanks you all. void Update () { if (gameStatus == "Waiting") { // do the stuff for waiting situation. if(conditionForNextProcess) { gameStatus = "Countdown"; } } else if (gameStatus == "Countdown") { //do things for countdown situation. if (conditionForNextProcess2) { gameStatus = "Playing"; } } else if (gameStatus == "Playing") { //do things for Playing situation. if (conditionForNextProcess3) { gameStatus = "GameOver"; } } } update function process Wed, 28 Nov 2018 12:21:59 GMT FlippingFlopper Update console in the same frame Hi, I have two loops, one inside other. The process I am doing takes around 9 seconds with 8192 x 8192 iterations. I would like to print a percentage in the outer loop but it seems that console just update on the next frame after the loop. Pseudo-code: for(int i = 0; i < 8192;i++){ for(int j = 0; j < 8192;j++){ // Do some crazy stuff here } Debug.Log(100f * i / 8192f + "%"); /* Doesn't print until next frame*/ } I understand why it would be a bad practice to print every time the console updates,in most cases unnecessary and process consuming but since I need it how can I force the console to update? Or I will need to write to a file in the HD to ensure the system stop processing. loop looping process Wed, 03 Oct 2018 01:56:38 GMT lorenzofman2 Run terminal cmd on osx I'm trying to run a terminal cmd in osx Here's the code I'm using: public Process process; process = new Process(); process.StartInfo.FileName = "/Applications/Utilities/"; process.StartInfo.UseShellExecute = true; process.StartInfo.CreateNoWindow = true; process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; process.StartInfo.Arguments = "screencapture screen.jpg"; process.Start(); It's supposed to take a screenshot of the entire desktop. The result is that a terminal opens but nothing happens -- no commands are typed into the terminal. I have used this with ffmpeg before and it worked fine as long as you state the path correctly. process command line terminal Thu, 20 Sep 2018 23:14:53 GMT dansav Destroy/Purge GameObjects in Parent Empty Object Part of my Class code manage to create a GameObject, attach a SpriteRenderer and finally set all this as a child of the main Parent. This will be run for 400 or 500 times. So I don't want to have that much of items in my editor. I have the idea of remove all those dynamic GameObjects at some point, but I get some errors or the destroy order is just ignored. I try with OnApplicationQuit and OnDIsable. I see some idea of store the GameObjects in an array and read that array for the destruction process, but then I see this comment "... **you should never iterate through arrays and destroy the elements you are iterating over**..." So I run out of ideas. destroygameobject process Fri, 27 Jul 2018 15:54:01 GMT aolba Get notification from command line or other application when a printer finish printng? Hello! I am working on a game in which people take selfie via webcam and the photo is printed by a printer. I am using System.Diagnostics.Process to open cmd.exe and pass command into it. ("rundll32 C:\\WINDOWS\\system32\\shimgvw.dll,ImageView_PrintTo " + "\"" + (Path) + "\"" + " " + "\"" + "(Printer Name)" + "\"") This works and my printer successfully prints photo. However **I also want Unity can be able to check whether the printing is done.** After searching and trying I know I can use Prnjobs.vbs or Prncnfg.vbs to know status of printing jobs in command line. ![alt text][1] But I don't konw how to let Unity know the printing status. Maybe there is some way to save those information as a text file from cmd, and then ask Unity to read it? Or make another small WPF or Windows Form application to check the status (maybe the Win32_Printer class is what I need?) and make it talk to Unity? I will be really grateful if you can give me some advice. Thank you! *1 Win32_Printer class c# programming windows process command line Tue, 12 Jun 2018 12:16:08 GMT echuang98 Getting memory usages from other processes Hi! I need to check the memory usages of another process from within a unity script. At the moment I'm just trying to iterate through all processes and try to print the WorkingSet64 for that process, like so: Process[] processes = Process.GetProcesses();  foreach (Process p in processes) {  p.Refresh ();  UnityEngine.Debug.Log (p.ProcessName + ", workingSet64: " + p.WorkingSet64);  }    Problem is that they all return 0. When debugging, I can see that all values that has anything with the memory to do has a value of 0. Why is this happening, and is there another approach I could take here? The problem I'm having is that another third part process I have to use seems to have a memory leak, and I'm looking for a way to restart that process when the memory reaches a certain point. memory usage process Tue, 12 Jun 2018 08:20:38 GMT Spree_User "system.componentmodel.win32exception" when trying to run stockfish binary file for android I am creating a Chess Game in Unity. I want to build my game for Android. For AI I am using Stockfish Chess Engine and more particularly "Stockfish-9-arm64v8" file which is a binary file for Android. I have created a C# script which creates a process to run this binary file and communicate with it. When I try to Start my process the exception is raised -> `try{ mProcess.Start() } catch(Exception e){ Helper.PrintString(e.GetType().ToString()); // ----------------(1) Helper.PrintString(e.Message); // --------------(2) } /* (1) is printing : system.componentmodel.win32exception (2) is printing : ApplicationName = '/storage/emulated/0/Android/data/com.chessmania.chess/files/Stockfish-9-arm64v8', CommandLine = '', CurrentDirectory = '' */` Also my process info parameters are as follows: `ProcessStartInfo si = new ProcessStartInfo() { FileName = System.IO.Path.Combine(Application.persistentDataPath, "Stockfish-9-arm64v8"), UseShellExecute = false, CreateNoWindow = true, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true };` Can anyone please help me with it. I have been trying to resolve this issue past few days but unable to. Does it have something to do with file permission?? I mean shall I include some arguments in my ProcessInfoParameters to forcefully run the binary file?? I really don't know if this is the problem or something else? Correct me from the start if I am wrong. I just want to integrate Stockfish Chess Engine with with Unity Project and build it for Android Platform. If anyone has any ideas or suggestions or if anyone has dealt with similar problem before, please let me know how to solve this issue. I would be grateful. Thanks for bearing with me till here :) c# android build permissions process chess Mon, 14 May 2018 07:10:00 GMT suresh_gandhi How do you kill the Unity.exe process when it will not open a project I have to restart my computer over and over just to see if Unity will open my project. I don't understand why, as an administrative user, I do not have rights to kill the executable? How can I enable rights to kill the executable, so that I can at least try some of the 100 methods of fixing the problem that exists? I have released the handle on the UnityLockfile. This allows me to open the project again but that just creates another executable that will not close, and no visual interface to work on my project. What rights do I need to close the executable? I really should be able to shut down unity if it is not working properly. I can't keep hard shutting down my computer crash kill process Mon, 30 Apr 2018 00:15:15 GMT BrokawBound When closed, external processes pause. I have a patcher for my application, it's an external c# program. When the user accepts an update I have the unity application run said external process and then quit, which it does but once the application closes, the external process stops running/freezes. System.Diagnostics.Process.Start("Patcher/Patcher.exe"); Application.Quit(); I assume it's because the process is somehow dependant on the unity app being alive, but from what I've read using Process.Start() shouldn't associate the process with the current application. How can I run the seperate process with no dependencies to the unity application? process application.quit Tue, 27 Feb 2018 13:26:25 GMT jamal54312 Detect if .bat (cmd.exe) running? (C#) - Unity Version: 4.5.5f1 Hi, How Can i detect if .bat (cmd.exe) running? (C#) - Unity Version: 4.5.5f1,Hi, How Can I Detect if .bat (cmd.exe) running? (C#) - Unity Version: 4.5.5f1 c# detect running process Sat, 20 Jan 2018 19:33:07 GMT tomasekCZE Open Terminal window for OSX System.Diagnostics.Process Hi all, I have a script that I'm using to upload to after a build processes. It works perfectly on Windows, and *works* on OSX (it uploads), however it doesn't open a Terminal window to actually show the upload's progress. (On Windows it opens a CMD window.) Here is the code I'm using: Process uploadProc = new Process { StartInfo = { FileName = butlerPath, Arguments = "push \"" + projectFolder + "\" " + Settings.ItchURLUserName + "/" + Settings.ItchURLProjectName + ":" + "osx", CreateNoWindow = false, WindowStyle = ProcessWindowStyle.Normal, UseShellExecute = false } }; uploadProc.Start(); So like I said, it actually uploads. I just have no idea at what stage it is while it's doing it. I tried to run Terminal instead (which does open a window), but I couldn't figure out how to run the Unix executable from there. Any help is greatly appreciated! osx buildpipeline process terminal Mon, 15 Jan 2018 02:46:23 GMT gumboots System.Diagnostics.Process.Kill() doesn't work Hi, I have a script that starts an external process on Unity. It runs as expected, but calling process.Kill() has no effect. The external app isn't being terminated. public void InitSensor () { sensorStatus = SensorStatus.Initializing; pSensor = new System.Diagnostics.Process(); pSensor.StartInfo.FileName = Application.streamingAssetsPath + "/"; pSensor.StartInfo.CreateNoWindow = false; pSensor.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; pSensor.EnableRaisingEvents = true; pSensor.Exited += OnSensorTerminated; pSensor.Start(); sensorStatus = SensorStatus.Running; } public void KillSensor() { Debug.Log("Killing Sensor..."); if (pSensor != null) { pSensor.Exited -= OnSensorTerminated; try { pSensor.Kill(); } catch (Exception e) { Debug.LogWarning(e); } finally { pSensor.Close(); pSensor = null; sensorStatus = SensorStatus.Exited; } } } The code is as above. Am I missing something?? process external-application system.diagnostics Fri, 12 Jan 2018 05:23:01 GMT NGC6543 How to get .exe file to run through script? I'm trying to implement text to speech through eSpeak into Unity (I'm on Windows). I've imported the eSpeak files into unity and I've made a script that I want to play the sound. This is what it looks like: import System.Diagnostics; var speak = "Hello"; function Start () { var proc = new Process(); proc.StartInfo.FileName = "eSpeak/command_line/espeak.exe -s80 "+speak; proc.Start(); } Whenever I run it, I get the error "Win32Exception: The system cannot find the file specified." I tried it without the tags and it still doesn't work, so it might have to do with the path. The eSpeak folder is in the Assets folder and not any subfolders, and I tried putting in the full path from C:/, but that didn't work either. I'd appreciate any help. **Edit:** I tried this instead: import System.Diagnostics; var speak = "Hello"; function Start () { System.Diagnostics.Process.Start(Application.dataPath + "/eSpeak/command_line/espeak.exe); } It worked, but if I add the tags to the end of the path, it doesn't. Is there a way to get the tags to also work? scripting problem path executable process system.diagnostics Sat, 30 Sep 2017 00:46:55 GMT greatwhiteshark17283 Unity Editor is not displayed For some reason when I start Unity. I choose a project and than nothing happens, I can see in process monitor that Unity Editor process is running and I can't open the same project again with this Warning that it is already running but no Unity Editor is displayed and I am not able to work in it at all. No Unity thing on taskbar, no UI, nothing. Anybody has a suggestion or and idea why it behaves like that? editor hang process blocks Fri, 08 Sep 2017 13:18:10 GMT Hallker Infinite loop with named pipes Hello everyone, I'm currently trying to implement a threaded IPC service with named pipes in PipeTransmissionMode.Message. When reading received messages from the server stream, the thread gets stuck in an infinite loop because IsMessageComplete never evaluates to true. The problem occurs in Unity 5.6.1f1 as well as 2007.1, but not in a .NET 4.5.2 console application using the identical code. Having spent a whole day on trying to figure this out I'd very much appreciate if someone could point me in the right direction. I'm not sure if I'm doing something wrong or this is a bug in Unity. Here is a minimal working example: using UnityEngine; using System.IO.Pipes; using System.Threading; using System.Text; using System.IO; public class MinimalPipeExample : MonoBehaviour { public string pipe = "MinimalPipeExamplePipe"; void Start() { new Thread(runServer).Start(); Thread.Sleep(1000); // wait until the server is running using (NamedPipeClientStream cs = new NamedPipeClientStream(".", pipe, PipeDirection.Out)) { cs.Connect(); byte[] message = Encoding.UTF8.GetBytes("Hello World"); cs.Write(message, 0, message.Length); cs.Flush(); Debug.Log("C Message sent"); } } void runServer() { using (NamedPipeServerStream ss = new NamedPipeServerStream(pipe, PipeDirection.In, 1, PipeTransmissionMode.Message)) { ss.WaitForConnection(); MemoryStream ms = new MemoryStream(); byte[] buffer = new byte[32]; do { int bytesReceived = ss.Read(buffer, 0, buffer.Length); ms.Write(buffer, 0, bytesReceived); Debug.Log("S Some bytes read; message complete: " + ss.IsMessageComplete); // infinite loop here because IsMessageComplete is never true } while (!ss.IsMessageComplete); Debug.Log("S Message received: " + Encoding.UTF8.GetString(ms.ToArray())); } } } threading process pipe Sun, 23 Jul 2017 02:09:59 GMT bnmn Process.GetProcesses() Not all processes return Why ? And how to fix it ? Unity 2017.1 process Thu, 13 Jul 2017 16:08:08 GMT wchar_t How to execute a method when I create a new script, or I saved an existing one ? (and get his type) I want to know how to execute a method when I create a new script, or rename an existing one ? I know Unity do some processes when scripts are created. For example, when you create a script, the script is added to the list of components in the window `Component > Scripts > NamespaceOfYourScript > NameOfYOurScript`. I want to do something like that, but for my own custom window. I'm pretty sure that the process is accessible, but I don't know its name and how to access and use it. I have already searched on the documentation, unity answers, stack overflow, but I don't find yet what I was looking for (without to know what is the exact process keyword you are looking for, it's not easy to search). I want to get a script a bit like this kind : using UnityEngine; using UnityEditor; public class MyScript : SomeScriptProcess () { void OnScriptSaved (System.Type TheScriptThatWasJustSaved) { //I execute my stuff here } } Any helps would be great. :) script. editor-scripting type process processing Tue, 11 Jul 2017 17:42:07 GMT eskivor