コード例 #1
0
		private static bool IsAvatarAvailable(AvatarSlot avatarSlot, Entity avatar)
		{
			return avatar.GetTags().Contains(avatarSlot.AvatarName.ToString());
		}
コード例 #2
0
		private void CheckIfAvatarIsUnlocked(AvatarSlot avatarSlot, int index)
		{
			if (index >= totalAvatarCount || index < 0)
			{
				avatarSlot.IsVisible = false;
				return;
			}

			if (!avatarSlot.IsVisible)
				avatarSlot.IsVisible = true;
			avatarSlot.AvatarName = avatarList[index];

			foreach (Avatar avatar in Player.Current.AvailableAvatars)
				if (IsAvatarAvailable(avatarSlot, avatar))
				{
					avatarSlot.LockImage.IsVisible = false;
					avatarSlot.GemImage.IsVisible = false;
					avatarSlot.IconImage.Material = sceneMaterials.AvatarIconsMaterials[index];
					return;
				}
				else
				{
					avatarSlot.LockImage.IsVisible = true;
					avatarSlot.GemImage.IsVisible = true;
					avatarSlot.IconImage.Material = sceneMaterials.AvatarIconsGreyMaterials[index];
				}
		}