HackAndSlashTutorial
C:\Documents and Settings\Administrator\Application Data\Unity\Asset Store
1.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: ScriptName variable = (ScriptName) varibale2.GetComponent("ScriptName");
cooldown,attackTimer; Vector3.normalized:向量化 Vector3.Dot:求点积判方向. Vector3.Distance:两者距离
4.Targetting: List<Transform> targets; foreach(GameObject enemy in go ){AddTarget(enemy.transform);}
List.sort排序:delegate.
private void SortTargetByDistance(){
targets.Sort(
delegate(Transform t1,Transform t2){
return (Vector3.Distance(t1.position,myTransform.position)).CompareTo (Vector3.Distance(t2.position,myTransform.position));
}
);
}
5.Character statistics; BaseStat:public int BuffValue{get{}set{}} //私有属性,子类只能通过父类的公有函数读写私有属性
Attribute:BaseStat : public Attribute(){ExpToLevel = 50;} enum AttribueName{,,,, }
ModifiedStat:BaseStat :
Vital: ModifiedStat :
Skill:ModifiedStat :
6,Base Character; _name _level uint _freeExp primayAttribute,skill,vital; //Enum.GetValues(typeof(AttributeName))获得enum值
(AttributeName)cnt cnt为值获得枚举变量
初始化类类型数组:_primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];
public void SetupPrimaryAttributes(){
for(int cnt=0; cnt<_primaryAttribute.Length; cnt++){
_primaryAttribute[cnt] = new Attribute();
}
}
7.Character Creation PlayerCharacter : BaseCharacter
CharacterGenerator //(AttributeName)cnt).ToString()枚举中(cnt)的值.toString
//Application.Load() loadScene
8.GUIStyle & GUI.skin
9.Saving Character Data GameSetting: playerPrefs 创建预制prefabs:PLayercharacter。 DontDestroyOnLoad();
10,Instantiating Our character GameMaster:创建角色预制 确定摄像头角度,创建gamesetting
11,Player Spawn Point gamesetting:Player spawn point ,gameMaster called it ;
12,Getting CSharpMessenger Extended 事件
13,GUITexture Health Bar;vitalbar.cs预制
使用事件 事件的设置 http://wiki.unity3d.com/index.php/CSharpMessenger_Extended
14,Mob Classes
15,TargetMob 复写targetting 切换敌人血条和显示
16, Spawn Points And Spawning Mobs //模型的材质更换,和shader改变 状态机state
MobGenerator.cs IEnumerator Start() 协同 随机生成mob和所在地
17,item
18,Basic Character Movement.
19 BuffItem Class: hashtable存放键值对 由basestat.name得mod值
Weapon Class
20Gizmos 调试辅助类
21 jewelry 珠宝首饰
22 Clothing
23 Consumable 消耗品
24 day night cycle 日夜交替 flare rotate les flare
Sun.cs addcomponentmenu
Skybox Blended:是一个shader http://wiki.unity3d.com/index.php/SkyboxBlended
lights and flare lignht set; ambientlight set;
25 camera control part smoothfollow:平滑跟随,和直接跟随
26input manager movenment advanedMovement CollisionFlags CharacterControl
27 player input playerinput need advancdemovement Ienumerator协同
28 AI OnTriggerEnter,Exit控制AI视线范围 sphececolider .istrigger
29 interactive object chest宝箱 startcoroutine animation audioclip particle system
30Playerinput:swimming 游泳 从天下掉下水时 落地事伯和游泳事件 要和空中事件分开
31 myGui lootingbar chest : static变量 MYGUI存有chest 的static变量 Destory(gameobject); public static,外部直接访问修改
Forceclose(){...,StopCoroutin("open"),StartCo..(close)..}
32inventory part mygui playercharacter.inventory
33,item generator guicotent
34charactr window 父类如果继承自monobehavior 子类不能new 需要addcomponent
35equipment weapon part
36 chest time destroy
37 Unity3d Tutorial - Weapon Meshes Part
38Main menu loadlevel Application.GetStreamProgressForLevel 过场进度条
39character generator: 按键连击 delaytimer;
40 setup from scratch and cleanup 脚本整理 addcomponentmenu requirecomponent
tutorial 字符串代替动画名声音名等来实现
41 changing room characte assest 人物挂载点,人物模型切换选择角色模型 继承自monobehaviou不能有构造函数
detectleaks 检查所有资源 Resources.UnLoadUnusedAssets();清除不用资源 DestroyImmediate
MeshMaterial切换人物各部位material enum switchcase 子物体相对于父物体为localpostion
42 character customization : PlayerModelCustomization RotatePlayerArrow GenderChanger CharacterMeshSale 消息传递 public static 其他类直接访问
Hair纯类不继承monobeharivor 另一个类调用它用new
43saveing CharacterSettings static GameSettings2静态类直接访问
203. Item System Update.mp4
204 Craeate a singleton player PC.cs http://prolove10.blog.163.com/blog/static/1384118432011898214753/
205 implementing out singleton
206 Loadding character data 存储位置vetor3 用3个int存储
211. Unity3d Tutorial - Loading The Skin Color.mp4
212. Unity3d Tutorial - Loading Character Scale.mp4
213. Unity3d Tutorial - Few Script Changes.mp4 gamesetting 增加version
215. Unity3d Tutorial - Displaying Character Attributes - Part 1.mp4 PC单例加载属性 gamesetting实现方法
217 Unity3d Tutorial Displaying Character Vitals.mp4 注意更新调节器 基值为零 若调节器不加入 则最后值也为零则curvlaue变为零
218. Unity3d Tutorial - Displaying Character Skills.mp4 注意更新调节器
220 Particle System
226. Unity3d Tutorial - Animated Texture.mp4 传送阵
227. Unity3d Tutorial - Line Renderer.mp4 直线渲染器
228. Unity3d Tutorial - Item System Fixes.mp4
229. Unity3d Tutorial - Armor Generation Overview.mp4
231. Unity3d Tutorial - typeof.mp4
230. Unity3d Tutorial - Creating Shields.mp4
231 typeof(weapon) = instance.invent[cnt].gettype
232 Unity3d Tutorial - Instantiating A Shield.mp4
233. Unity3d Tutorial - Setting Up Hats.mp4
234. Unity3d Tutorial - Solving The Multiple Armor Problem.mp4
237 Unity3d Tutorial Head Gear Scaling.mp4 戴帽去发 脱帽加发
238. Unity3d Tutorial - UIToolkit (Loot Window Part 1).mp4 texture packer 图集制作
243 from scratch
247. Unity3d Tutorial - Mob AI Updates.mp4 startcorotine fsm
249. Unity3d Tutorial - Making the Mob Turn Properly.mp4 调整旋转角度
255. Unity3d Tutorial - Mob Spawn Setup - Part 1.mp4 mob装备位置初始
259. Unity3d Tutorial - Settup Mob Attributes At Spawn Time.mp4
262. Unity3d Tutorial - Preprocessor Directives Intro.mp4 预处理程序 #define DEBUGGER
263. Unity3d Tutorial - Base Melee Logic.mp4
264. Unity3d Tutorial - Melee Reset Timer.mp4
268. Unity3d Tutorial - Incombat Flag.mp4
273. Unity3d Tutorial - Setting Up Player Attacks.mp4 攻人攻击,使玩家进入战斗状态 enmu 最后一个元素设为Count 既enum个数
278. Unity3d Tutorial - Spell System Quick Notes.mp4 Ispell接口 ibuff接口:ispell ibolt接口:ispell iaoe接口:ispell
LineOfSight视野
float smooth
transform.position = Vector3.Lerp(transform.position, standarPos.position, Time.deltaTime * smooth);
//lerp 线性插值(from,to,t) t在0,1之间, 0.5代表from - to距离的一半