
本文共 1480 字,大约阅读时间需要 4 分钟。
���Unity������������������������������������������������������������������������������
������Unity���������������������������������cube������������������������������������������������������������������ > ���������������������������������������������������Sphere��������������������������������� > ���������������������������������������Sphere��������������������������� > ���������������������������������������
������������������������������������������������������������������������������������Sphere���������������������������MonoBehavior������������������������������������������
using System.Collections;using UnityEngine;public class Shpere : MonoBehaviour { private Rigidbody rd; // ���Por��������� private int force = 5; // ������ void Start() { rd = GetComponent(); // ��������������� } void Update() { // ��������������������������� float horizontal = Input.GetAxisRaw("Horizontal"); float vertical = Input.GetAxisRaw("Vertical"); // ������������������������������������ rd.AddForce(new Vector3(horizontal * force, 0, vertical * force)); } // ������������������������������������������������������������}
���������������Sphere������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
