Advertisement
salahzar

Rotate.cs Interattivo

Apr 22nd, 2020
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Rotate : MonoBehaviour
  6. {
  7.     public bool abilita = false;
  8.     public float speed = 10;
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.        
  13.     }
  14.  
  15.     public void AbilitaTrue()
  16.     {
  17.         abilita = true;
  18.     }
  19.     public void AbilitaFalse()
  20.     {
  21.         abilita = false;
  22.         speed = 10;
  23.     }
  24.     public void AumentaVelocita()
  25.     {
  26.         speed += 10;
  27.     }
  28.  
  29.     // Update is called once per frame
  30.     void Update()
  31.     {
  32.         if(abilita)
  33.             transform.Rotate(new Vector3(0,speed,0) * Time.deltaTime);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement