public void SetAvatar(int avatarIndex) { if (humanoid == null) { return; } if (avatarIndex < 0 || avatarIndex > fpAvatars.Length) { return; } if (fpAvatars[avatarIndex] != null) { #if hNW_UNET || hNW_PHOTON if (avatarIndex < tpAvatars.Length && tpAvatars[avatarIndex] != null) { humanoid.ChangeAvatar(fpAvatars[avatarIndex].gameObject, tpAvatars[avatarIndex].gameObject); } else #endif humanoid.ChangeAvatar(fpAvatars[avatarIndex].gameObject); } }