19 lines
487 B
C#
19 lines
487 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class PlayerMovement_Jpystick : MonoBehaviour
|
|||
|
{
|
|||
|
public Joystick joystick; // <20><>Joystick<63><6B><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD>
|
|||
|
public float speed = 5f;
|
|||
|
|
|||
|
void Update()
|
|||
|
{
|
|||
|
float horizontal = joystick.Horizontal;
|
|||
|
float vertical = joystick.Vertical;
|
|||
|
|
|||
|
Vector3 direction = new Vector3(horizontal, 0, vertical);
|
|||
|
transform.Translate(direction * speed * Time.deltaTime, Space.World);
|
|||
|
}
|
|||
|
}
|