27 lines
635 B
C#
27 lines
635 B
C#
![]() |
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class JoystickPlayerExample : MonoBehaviour
|
|||
|
{
|
|||
|
public static JoystickPlayerExample Instance;
|
|||
|
public float speed;
|
|||
|
public VariableJoystick variableJoystick;
|
|||
|
public Rigidbody rb;
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
Instance = this;
|
|||
|
}
|
|||
|
|
|||
|
public void OnClick()
|
|||
|
{
|
|||
|
Debug.Log("OnClick");
|
|||
|
}
|
|||
|
|
|||
|
//public void FixedUpdate()
|
|||
|
// {
|
|||
|
// Vector3 direction = Vector3.forward * variableJoystick.Vertical + Vector3.right * variableJoystick.Horizontal;
|
|||
|
// rb.AddForce(direction * speed * Time.fixedDeltaTime, ForceMode.VelocityChange);
|
|||
|
// }
|
|||
|
}
|