Скрипт перемещения машин
This commit is contained in:
26
Assets/Crossy Road VR/Scripts/CarControllerScript.cs
Normal file
26
Assets/Crossy Road VR/Scripts/CarControllerScript.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Скрипт для анимации машины
|
||||
/// </summary>
|
||||
public class CarControllerScript : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// to do
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
private List<GameObject> _Wheels = new List<GameObject>();
|
||||
|
||||
[SerializeField]
|
||||
private int _Speed;
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
foreach (var wheel in _Wheels)
|
||||
{
|
||||
wheel.transform.Rotate(Vector3.right * _Speed);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user