June.Stop C# (CSharp) Method

Stop() public method

public Stop ( ) : void
return void
    public void Stop()
    {
        if(is_stopped)
            return;

        //is_stopped = true;

        success = true;

        try{
            //Work-around because Unity is being stupid
            if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor) {
                java_process.GetType().GetMethod( "Kill" ).Invoke( java_process, new object[]{} );
            } else {
                //Send a "friendly" SIGTERM to java so that we can log some stuff before the program exits
                Process killer = Shell.shell_no_start("kill", "-15 "+java_process.Id);
                killer.Start();
                killer.WaitForExit();
                killer.Close();
            }
        }catch(Exception e){
            UnityEngine.Debug.Log(e);
        }
    }

Usage Example

Example #1
0
    public string disenchant()
    {
        if (isEnchanted())
        {
            june.Stop();
        }

        is_enchanted = false;
        enchantmentsRunning.Pop();
        enchantmentsRunning.Push(false);

        return(getFileName());
    }