Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var strzalka : Rigidbody2D;
- function Update () {
- for (var i = 0; i < Input.touchCount; ++i) {
- if (Input.GetTouch(i).phase == TouchPhase.Began) {
- // Construct a ray from the current touch coordinates
- var ray = Camera.main.ScreenPointToRay (Input.GetTouch(i).position);
- if (Physics.Raycast (ray)) {
- // Create a particle if hit
- if(strzalka.transform.position.x > -11)
- strzalka.transform.Translate(-PlayerPrefs.GetInt("kursor")*Time.deltaTime, 0, 0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement