using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float RotatePlayer;
public bool isTouchClick;
private int min;
private int max;
void Start()
{
}
void Update()
{
if(Input.GetKey(KeyCode.Space))
{
isTouchClick = true;
}
else
{
isTouchClick = false;
}
PlayerMove();
}
public void PlayerMove()
{
if (isTouchClick == true)
{
GetRandomRotation();
transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(0, 0, 0 + RotatePlayer), 0.07f);
}
else if (isTouchClick == false)
{
// transform.Rotate(0, 0, 0);
}
}
public void GetRandomRotation()
{
min = 60;
max = 110;
Random rnd = new Random();
RotatePlayer = Random.Range(min, max + 1);
}
}