public override void Disable()
	{
		activeProfile = null;
		profileRoot.SetActive(false);
		timer = 5;
		loading = false;
		base.Disable();
	}
	public void DisplayProfile(PlayerProfileDisplayData profile)
	{
		if(!isDisplayed)
			return;
		loading = false;
		activeProfile = profile;
		loadingIcon.SetActive(false);
		profileRoot.SetActive(true);
		nameLabel.text = activeProfile.name;
		for (int i = 0; i < profile.equips.Count; i++) {
			if(profile.equips[i].slotIndex == 0)
				headTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
			else if(profile.equips[i].slotIndex == 1)
				bodyTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
			else if(profile.equips[i].slotIndex == 2)
				armLTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
			else if(profile.equips[i].slotIndex == 3)
				armRTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
			else if(profile.equips[i].slotIndex == 4)
				legsTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
			else if(profile.equips[i].slotIndex == 5)
				headTile.LoadBasicAmor(profile.equips[i].uniqueItemId, profile.equips[i].level);
		}
		//questPointsLabel.text = profile.questPoints.ToString();
		citizenPointsLabel.text = profile.citizenPoints.ToString();
		healthLabel.text = profile.baseHealth.ToString() + " + " +profile.bonusHealth.ToString();
		attackLabel.text = profile.baseStrength.ToString() + " + " +profile.bonusStrength.ToString();
		defenceLabel.text = profile.baseDefense.ToString() + " + " +profile.bonusDefense.ToString();
		for (int i = 0; i < badgeSprites.Length; i++) {
			if(i < profile.badgeIDs.Count)
			{
				badgeSprites[i].gameObject.SetActive(true);
				RPGBadge badge = Storage.LoadById<RPGBadge>(profile.badgeIDs[i], new RPGBadge());
				badgeSprites[i].spriteName = badge.IconPath;
			}
			else
				badgeSprites[i].gameObject.SetActive(false);
		}
	}
Esempio n. 3
0
	public void NetworkRequestPlayerProfileData(PhotonMessageInfo info)
	{
		BinaryFormatter b = new BinaryFormatter();
		MemoryStream m = new MemoryStream();
		PlayerProfileDisplayData newData = new PlayerProfileDisplayData();
		newData.CreatePlayerProfileDisplayData();
		b.Serialize(m, newData);
		myPhotonView.RPC("SendBackPlayerProfileData", info.sender, m.GetBuffer());
	}