2013年12月5日
摘要: (1) float smooth = ... transform.position = Vector3.Lerp(transform.position, standarPos.position, Time.deltaTime * smooth); //lerp 线性插值(from,to,t) t在0,1之间, 0.5代表from - to距离的一半 // Time.deltaTime * smooth , 最后一帧的时间 * smooth 每一次步进from-to的 Time.deltaTime * smooth 每一次调用移动几分之一距离,直到到达目的地 ,实现平滑过度(2) voi... 阅读全文
posted @ 2013-12-05 13:36 鱼 丸 阅读(423) 评论(1) 推荐(0) 编辑
摘要: (1)f_DeltaTime值。 //自己计算每一帧时间float f_LastFrameRealtime;void Start(){f_LastFrameRealtime = Time.realtimeSinceStartup ;}void Update(){float f_DeltaTime = Time.realtimeSinceStartup - f_LastFrameRealtime;f_LastFrameRealtime = Time.realtimeSinceStartup ;}(2) mecanim系统中 muscle可以控制角色各部位摆动幅度等, 速度为负,动画倒着播放Vec 阅读全文
posted @ 2013-12-05 13:36 鱼 丸 阅读(685) 评论(0) 推荐(0) 编辑
摘要: C:\Documents and Settings\Administrator\Application Data\Unity\Asset Store1.health bar: curHealth/maxHealth healthBarLenght = Screen.width/2*(curHealth/maxHealth);2.enemy AI: Debug.DrawLine()调试两者连线 Quaternion.LookRotation(target.position-myTransform.position);myTra..指向target时的旋转角度.3.Melee-combat: Sc 阅读全文
posted @ 2013-12-05 13:35 鱼 丸 阅读(410) 评论(0) 推荐(0) 编辑
  2013年12月4日
摘要: string number = this.gameObject.GetComponent().label.text;int a;if(int.TryParse(number, out a)){}@"一些字符" 前+@不会进行转义unity3d prefab不能携带从面板拖拽(五笔rjx)的Object 阅读全文
posted @ 2013-12-04 14:05 鱼 丸 阅读(181) 评论(0) 推荐(0) 编辑
  2013年11月21日
摘要: Chapter 1 :Introduction to AIAI in games:游戏AI目的,创建难度适中的NPCs AI,尽量简化计算过程。AI techniques:(1) Finite State Machines(FSM):有限状态机简单射击游戏敌人状态机简单有限状态机的基本4组件:1.状态(States):一系列游戏实体状态或者NPC可选择的状态(例如图中的Patrol(巡逻), Chase(追踪),Shoot(射击)。2.过渡(Transitions):定义不同状态间的关系。3.规则(Rules):触发过渡(如图player on sight, close enough to a 阅读全文
posted @ 2013-11-21 20:47 鱼 丸 阅读(604) 评论(0) 推荐(0) 编辑