贴图有可能是多行多列的一些图案组成的.当我们需要一帧,一帧的播放时候.也就是帧序列动画, 我们就需要用到tiling和offset两个属性, 默认图片的左下角为坐标圆点即:(0,0) tiling是图片的大小,offset是偏移量 来看看一些例子: using UnityEngine; using System.Collections; public class animspite : MonoBehaviour { public int totolFrame;//总帧数,即多少帧 public
Unity 3D里两个碰撞体之间发生碰撞可以用OnCollision族函数和OnTrigger族函数来获知和处理.Unity官方给出了两张可发生碰撞的组合表: Collision detection occurs and messages are sent upon collision Static Collider Rigidbody Collider Kinematic Rigidbody Collider Static Trigger Collider Rigidbody Tri
using System.Collections; using System.Collections.Generic; using UnityEngine; public class NewBehaviourScript : MonoBehaviour { //滚动速度 public float HorSpeed = 1.0f; public float VerSpeed = 1.0f; //Offset偏移量 //水平滚动Offset.y public float HorMin = 1.
1 using System.Collections; 2 using System.Collections.Generic; 3 using UnityEngine; 4 public class MoveCamera : MonoBehaviour 5 { 6 public float distance = 10.0f;//目标物体与摄像机之间在世界坐标基础上保持水平上的距离 7 public float height = 5.0f;//摄像机与目标物体之间的高度差 8 public flo