using System.Collections; using System.Collections.Generic; using UnityEngine; public class Deflectors : MonoBehaviour { public float rotationSpeed = 1000.0F; public static int Deflections; // Use this for initialization void Start () { } // Update is called once per frame void Update () { MoveWithKeyboard(); } void MoveWithKeyboard () { float rotation = Input.GetAxis("Horizontal") * rotationSpeed * 5; rotation *= Time.deltaTime; transform.Rotate(0, 0, rotation); } void OnTriggerEnter2D(Collider2D collision) { GetComponent().Play(); Deflections++; } }