- The Way Java Works
- Source : Create a source document. Use an established protocol ( in this case, the Java language).
- Compiler : Run your document through a source code compiler. The compiler checks for errors and won't let you compile until it's satisfied that everything will run correctly.
- Output : The compiler creates a new document, coded into java bytecode. Any device capable of running java will be able to interpret / translate this file into something it can run . The compiled bytecode is platform-independent.
- Virtual Machines : Your friends don't have a physical Java Machines, but they all have a Virtual Java machine (implemented in software) running inside their electronic gadgets. The virtual machine reads and runs the bytecode.
Joystick in unity using System . Collections ; using System . Collections . Generic ; using UnityEngine ; public class Joystick : MonoBehaviour { public Transform player ; public float speed = 5.0f ; private bool touchStart = false ; private Vector2 pointA ; private Vector2 pointB ; public Transform circle ; public Transform outerCircle ; // Update is called once per frame void Update ( ) { if ( Input . GetMouseButtonDown ( 0 ) ) { pointA = Camera . main . ScreenToWorldPoint ( new Vector3 ( Input . mousePosition . x , Input . mousePosition . y , Camera . main . transform . position . z ) ) ; circle . transform . position = pointA * - 1 ; outerCircle . transform . position = pointA * - 1 ; circle . GetComponent<SpriteRenderer>() . enabled = true ; outerCircle . GetComponent<SpriteRenderer>() . enabled = true ; } ...
Comments
Post a Comment