8efdd2db33
https://assetstore.unity.com/packages/3d/characters/humanoids/fantasy/low-poly-medieval-fantasy-heroes-basic-pack-288957
36 lines
738 B
C#
36 lines
738 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Generic_SimpleRotate : MonoBehaviour
|
|
{
|
|
|
|
public bool rotX;
|
|
public float rotXSpeed = 50f;
|
|
public bool rotY;
|
|
public float rotYSpeed = 50f;
|
|
public bool rotZ;
|
|
public float rotZSpeed = 50f;
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (rotX == true)
|
|
{
|
|
transform.Rotate(Vector3.left * Time.deltaTime * rotXSpeed);
|
|
}
|
|
if (rotY == true)
|
|
{
|
|
transform.Rotate(Vector3.up * Time.deltaTime * rotYSpeed);
|
|
}
|
|
|
|
if (rotZ == true)
|
|
{
|
|
transform.Rotate(Vector3.back * Time.deltaTime * rotZSpeed);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|