Welcome to Unity Learning, unity training, Unity Enterprise training and education zone, there are many u3d resources, u3d training videos, u3d tutorials, U3d Frequently asked questions, U3d Project source code, we are committed to creating the industry Unity3d training, learning the first brand.
Unity3d C # Opens an external application and detects whether the application closes the exit implementation code.
Using Unityengine;
Using System.Collections;
Using System.Diagnostics;
Using System;
public class Startotherapp:monobehaviour {
Private Process pc;
void Start () {
Startcoroutine (STARTAPP ());
}
IEnumerator StartApp ()
{
Yield return new Waitforseconds (2);
PC = Process.Start ("C:/users/lee/desktop/flash videoplayer/vrplayer/vrplayer.app/vrplayer.exe");
Pc. EnableRaisingEvents = true;
Pc. Exited + = new EventHandler (myprocess_exited);
}
void Myprocess_exited (object sender, EventArgs e)
{
Application.Quit ();
}
}
Unity3d about the movement of the Code
Motion related is generally written in the update, the actual development, need to know what is required to detect each frame, which is triggered.
The classes below input are generally written in the update because each frame needs to be instrumented.
Ontriggerenter (); ontriggerstay;ontriggerexit; the corresponding is oncollisionenter .... If Istrigger is checked, the trigger class is required.
Functions that can be used for motion. We should choose the appropriate function in a more specific context.
Rigidbody (2D) Velocity,
To move in a certain direction
Velocity=transform. Transformdirection (vector3.forward*100);
Transform.translate,
To move in a certain direction
Playertransform.translate (vector3.right*time.deltatime* (-movespeed.x));
Vector3.movetowards,
Move to Target Point
Playertransform.position=vector3.movetowards (Playertransform.position,tagerpoint.position,200*time.deltatime);
Can also be operated directly transform.position
For more highlights, please click http://www.gopedu.com/
Unity3d C # Opens an external application and detects if the application closes the exit