37 lines
624 B
C#
37 lines
624 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.AI;
|
|
|
|
public class Rotate : MonoBehaviour
|
|
{
|
|
|
|
bool isRotate;
|
|
public float rotatespeed;
|
|
// Start is called before the first frame update
|
|
|
|
public void ActivateRotation()
|
|
{
|
|
if (isRotate)
|
|
{
|
|
isRotate = false;
|
|
}
|
|
else
|
|
{
|
|
isRotate = true;
|
|
}
|
|
}
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (isRotate)
|
|
{
|
|
transform.Rotate(0,1,0, Space.Self);
|
|
}
|
|
}
|
|
} |