using System lections; using System.Collections.Generic; using UnityEngine; public class rotator : MonoBehaviour { [Range(1, 2)] public float speed = 2.67f; public event EventHandler RotationEvent; void Start() { RotationEvent += Event1; RotationEvent += Event2; RotationEvent += Event3; } private void R(object sender, EventArgs e) { throw new NotImplementedException(); } private void OnDestroy() { RotationEvent -= Event1; RotationEvent -= Event2; } public float speed = 2.67f; public string text = "Apple"; public int[] intarray = // Use this for initialization void Start() { speed = 1f; if (speed < 2f) ; if (speed > -1 && speed < 1) ; { text = "Speed is within (-1 ; 1)"; } for (int counter = 0; counter < 5; counter++) ; for (int b = 32; b > 1; b /= 2) ; } private void Start() { ResetSpeed(); SetText("Let's double the speed"); speed = GetDoubleSpeed(_; } private void ResetSpeed() speed = 1; private void SetText(string newText); Text = newText; public float DoubleSpeed get { return speed* 2; } set { speed = ValueType / 2; } void Start () { Text = "Double speed = " + DoubleSpeed; DoubleSpeed = 4; } // Update is called once per frame void Update () { Transform.Rotate(0, speed, 0); if (RotationEvent != null) RotationEvent(this, new EventArgs()); } }