void Update () { if (lastCharacterType != characterType || lastLocation != location) { Change(); lastCharacterType = characterType; lastLocation = location; } }
public static string GetWeaponPostion(CharacterType character, CharacterWeaponLocation location, out Vector3 localPos, out Vector3 localRot) { Vector3[] datas = null; if (character == CharacterType.Mage) datas = mageData; else if (character == CharacterType.Archer) datas = archerData; else if (character == CharacterType.Swordsman) datas = swordsData; else if (character == CharacterType.Spearman) datas = spearData; else { Debug.LogError("Error " + character); } int i = (int)location; localPos = datas[i * 2]; localRot = datas[i * 2 + 1]; return boneName[(int)location]; }