void Start() { sword = GetComponentInChildren <GhostSword>(); rb = GetComponent <Rigidbody>(); rb.drag = 10; modelTransform = transform.Find("CharacterModel2"); anim = gameObject.GetComponentInChildren <Animator>(); var ghosts = GameObject.FindGameObjectsWithTag("Ghost"); var enemies = GameObject.Find("Final Boss").transform; var player = GameObject.FindGameObjectWithTag("Player"); var collider = GetComponent <Collider>(); foreach (var ghost in ghosts) { Physics.IgnoreCollision(collider, ghost.GetComponent <BoxCollider>()); } foreach (Transform enemy in enemies) { Physics.IgnoreCollision(collider, enemy.gameObject.GetComponent <Collider>()); } Physics.IgnoreCollision(collider, player.GetComponent <Collider>()); }
public Equipment CreateEquipment(string equipmentName) { Equipment eq = null; if (this.equipmentDict[equipmentName] == 5001) { //铁盔 eq = new Chael_de_fer(); } else if (this.equipmentDict[equipmentName] == 5002) { //伏魔刀 eq = new GhostSword(); } else if (this.equipmentDict[equipmentName] == 5003) { //刃甲 eq = new BladeMail(); } else if (this.equipmentDict[equipmentName] == 5004) { //金乌腿甲 eq = new GoldenCrowCuish(); } else if (this.equipmentDict[equipmentName] == 5005) { //白银护腕 eq = new SilverWristbands(); } else if (this.equipmentDict[equipmentName] == 5006) { //杉木戒指 eq = new CedarwoodRing(); } else if (this.equipmentDict[equipmentName] == 5007) { //灵能头巾 eq = new PsionicScarf(); } else if (this.equipmentDict[equipmentName] == 5008) { //光剑 eq = new LightSaber(); } else if (this.equipmentDict[equipmentName] == 5009) { //琉璃背心 eq = new ColouredGlazeVest(); } else if (this.equipmentDict[equipmentName] == 5010) { //灵风裤 eq = new SpiritWindPants(); } else if (this.equipmentDict[equipmentName] == 5011) { //红宝石护膝 eq = new RubyKneeProtector(); } else if (this.equipmentDict[equipmentName] == 5012) { //琥珀精华 eq = new AmberEssence(); } else if (this.equipmentDict[equipmentName] == 5013) { //大法师之帽 eq = new ArchmagesHat(); } else if (this.equipmentDict[equipmentName] == 5014) { //火灵杖 eq = new FireDorje(); } else if (this.equipmentDict[equipmentName] == 5015) { //智慧披风 eq = new WisdomCloak(); } else if (this.equipmentDict[equipmentName] == 5016) { //蚕丝裤 eq = new SilkPants(); } else if (this.equipmentDict[equipmentName] == 5017) { //魔女斗篷 eq = new SirenCloak(); } else if (this.equipmentDict[equipmentName] == 5018) { //贤者之石 eq = new StoneSage(); } return(eq); }