using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InstagramSkript : MonoBehaviour
{
public SympathysUpping sympathysUpping;
public GameObject MainCamera;
public Image MainBttn;
[Header("Инстаграм Маркет")]
public int[] SkinPrice;
public Image[] mainSkin;
public Text[] SkinPriceText;
void Awake()
{
SkinPrice[index] = PlayerPrefs.GetInt("SkinPrice", SkinPrice[index]);
}
void Start()
{
sympathysUpping = MainCamera.GetComponent<SympathysUpping>();
}
public void PressSkin(int index)
{
if(sympathysUpping.sympathy >= SkinPrice[index])
{
sympathysUpping.sympathy = sympathysUpping.sympathy - SkinPrice[index];
SkinPrice[index] = 0;
MainBttn.sprite = mainSkin[index].sprite;
SkinPriceText[index].text = "Куплено";
PlayerPrefs.SetInt("SkinPrice", SkinPrice[index]);
}
}
}
using UnityEngine.UI;
using UnityEngine;
public class SympathysUpping : MonoBehaviour
{
public Text MainSympathysText;
public Text AllYurSympathies;
public int sympathy = 0; // Либо public int sympathy = PlayerPrefs.GetInt("sympathy", 0);
public int sympathyBonus = 0;
public long allSympathies;
void Awake()
{
PlayerPrefs.GetInt("sympathy", 0);
}
void Update()
{
MainSympathysText.text = sympathy.ToString();
}
public void sympathysUping()
{
sympathy += sympathyBonus;
allSympathies += sympathyBonus;
AllYurSympathies.text = allSympathies.ToString();
PlayerPrefs.SetInt("sympathy", sympathy);
}
}
using UnityEngine.UI;
using UnityEngine;
public class SympathysUpping : MonoBehaviour
{
public Text MainSympathysText;
public Text AllYurSympathies;
public int sympathy = 0; // Либо public int sympathy = PlayerPrefs.GetInt("sympathy", 0);
public int sympathyBonus = 0;
public long allSympathies;
void Update()
{
MainSympathysText.text = sympathy.ToString();
}
public void sympathysUping()
{
sympathy += sympathyBonus;
allSympathies += sympathyBonus;
AllYurSympathies.text = allSympathies.ToString();
PlayerPrefs.SetInt("sympathy", sympathy);
}
}