Rigidbody.MovePosition 使用插值平滑的移动到目标位置
Rigidbody.position 快速的移动到目标位置
Rigidbody 比Transform的移动效率高,因为Transfrom移动的时候还要计算碰撞等事件
Rigidbody.MovePosition 使用插值平滑的移动到目标位置
Rigidbody.position 快速的移动到目标位置
Rigidbody 比Transform的移动效率高,因为Transfrom移动的时候还要计算碰撞等事件
EasyTouch 插件 好用的触摸插件
按时艾弗森啊发啊发啊安抚
Destroy方法既可以销毁物体也可以销毁组件
组件只有类名,没有name
GameObject.name和GameObject.getComponent<xxx>().name取得的是同一个值
Time
captureFramerate
deltaTime
fixedDeltaTime
fixedTime
realtimeSinceStartup
time
frameCount
timeScale
timeSinceLevelLoad:从当前场景加载开始游戏所运行的时间
相减说反了, a-b 返回一个指向a的向量。。。。。
..
1.5倍速的
旋转 cube.eulerAngles()
一般用欧拉角,界面也是欧拉角
cube.eulerAngles=new Vector3(10,0,0)
rotation是四元素
乒乓球的来回运动:
cube.position = new Vector3(Mathf.PingPong(Time.time, 10), 0, 0);
如果要加快运动:
cube.position = new Vector3(Mathf.PingPong(Time.time*speed, 10), 0, 0);
如果要返回值是5-10
cube.position = new Vector3(5Mathf.PingPong(Time.time*speed, 5), 0, 0);
Time类全是静态变量
Time.captureFramerate(帧速率) ;
Time.deltatime(每帧占用时间在六十分之一秒执上下形成波动);
Time.fixTime(从游戏开始到现在所运行的时间 )
任务13:011-UnityEngine下Object用有的静态方法
--#
任务12:010-GameObject、Component和Object的千丝万缕的关系
--#
color;颜色
shader;
Mesh;网格
Mate;材质
角色控制器
center:获取自身的位置
helgt:获取自身的高度
isGrounded;判断自身的位置
移动方法
Move
SlmpleMove
onControllerC olliderHit;移动时角色控制器碰撞到物体时会触发
characterController自带碰撞器
SimplMove,会模拟重力而Move则不会
MathfMoveToward
Mathf.Lerp差值运算
Lerp(float a 是开始数值 float b是结束值 float
Mathf