Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Rotate : MonoBehaviour
- {
- public bool abilita = false;
- public float speed = 10;
- // Start is called before the first frame update
- void Start()
- {
- }
- public void AbilitaTrue()
- {
- abilita = true;
- }
- public void AbilitaFalse()
- {
- abilita = false;
- speed = 10;
- }
- public void AumentaVelocita()
- {
- speed += 10;
- }
- // Update is called once per frame
- void Update()
- {
- if(abilita)
- transform.Rotate(new Vector3(0,speed,0) * Time.deltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement