代码源自噩梦射手,记录一下方便后续使用,顺便将老师的解释给备注上去_(:з」∠)_ using UnityEngine; using UnitySampleAssets.CrossPlatformInput; namespace CompleteProject { public class PlayerMovement : MonoBehaviour { public float speed = 6f; // The speed that the player will move at. Vec
这里就不多做解释了,直接上代码,只为了备忘. public class HeroMove : MonoBehaviour { private float speed;//人物行动速度 private Animation ani; // Use this for initialization void Start () { speed = 1f; ani = GetComponent<Animation> (); } // Update is called once per frame void
何谓第三人称?就像这样: 用wasd控制人物移动,同时保持在相机的中心.用鼠标右键与滚轮控制相机的角度和距离. 先说一下人物的移动: 首先给作为主角的单位加上 Charactor Controller组件,并调整胶囊型的碰撞体刚好包裹住主角(有其是脚底,除非你想看到你的主角能遁地,或飞行) 然后给你的人物加上控制的脚本~ using UnityEngine; using System.Collections; public class move_controll : MonoBehaviour
先看官方介绍:https://www.assetstore.unity3d.com/#/content/3322 (Allows you to quickly and easily develop actions based on a touchscreen, joystick & button. All major gestures are recognized by EasyTouch such as tap, double tap, swipe, twist, pinch...) 简单快速