/******equipment setters******/ public void SetHeadEquip(S_Wardrobe headp) { headEquipped = headp; //set other head styles inactive if (otherHeads != null) { foreach (object obj in otherHeads.transform) { Transform child = (Transform)obj; child.gameObject.SetActive(false); } } //set selected head style active switch (headEquipped) { case S_Wardrobe.HEADP_DEFAULT: Head = transform.Find("Head/Hair").gameObject; break; case S_Wardrobe.HEADP_HOOD: Head = transform.Find("Head/Hood").gameObject; break; case S_Wardrobe.HEADP_HAT: Head = transform.Find("Head/Armour1").gameObject; break; case S_Wardrobe.HEADP_CHAIN: Head = transform.Find("Head/Armour2").gameObject; break; case S_Wardrobe.HEADP_PLATE: Head = transform.Find("Head/Armour3").gameObject; break; } if (headEquipped != S_Wardrobe.HEADP_NULL) { Head.SetActive(true); HeadAnim = Head.GetComponent <Animator>(); HeadAnim.SetBool(attackStyle.ToString(), attackPlaceHolder); } }
private void ChangeAttackName(AttackStyle attackStyle, AttackType attackType) { currentAttackName = (Controller.OnGround()) ? ((attackType == AttackType.Primary) ? lightAttackName : heavyAttackName) : ((attackType == AttackType.Primary) ? aerialLightAttackName : aerialHeavyAttackName); string currentStyleName = "Style"; currentStyleName = attackStyle.ToString() + " " + currentStyleName; currentAttackName = currentAttackName.Replace("Style", currentStyleName) + Controller.AttackIndex; }
public void SetWeaponEquip(S_Weapon weapon) { weaponEquipped = weapon; //set other weapons inactive if (otherWeapons != null) { foreach (object obj in otherWeapons.transform) { Transform child = (Transform)obj; child.gameObject.SetActive(false); } } //set selected weapons active switch (weaponEquipped) { case S_Weapon.DAGGER: Weapon = transform.Find("Weapon/Dagger").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.RAPIER: Weapon = transform.Find("Weapon/Rapier").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.SPEAR: Weapon = transform.Find("Weapon/Spear").gameObject; attackStyle = AttackStyle.Thrust; attackPlaceHolder = Thrust; break; case S_Weapon.LONGSPEAR: Weapon = transform.Find("Weapon/LongSpear").gameObject; attackStyle = AttackStyle.Thrust; attackPlaceHolder = Thrust; break; case S_Weapon.LONGSWORD: Weapon = transform.Find("Weapon/LongSword").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.ARROW: Weapon = transform.Find("Weapon/Arrow").gameObject; attackStyle = AttackStyle.Bow; attackPlaceHolder = Slash; break; case S_Weapon.BOW: Weapon = transform.Find("Weapon/Bow").gameObject; attackStyle = AttackStyle.Bow; attackPlaceHolder = Slash; break; } Weapon.SetActive(true); WeaponAnim = Weapon.GetComponent <Animator>(); WeaponAnim.SetBool(attackStyle.ToString(), attackPlaceHolder); }