Exemplo n.º 1
0
    public void Preview(GameObject obj)
    {
        SoundManager.Ins.PlaySound(SoundManager.Ins._Select);
        furnitureData = obj.transform.parent.GetComponent <FurnitureData>();
        clothesData   = obj.transform.parent.GetComponent <ClothesData>();
        foodData      = obj.transform.parent.GetComponent <FoodData>();

        price = furnitureData != null ? furnitureData.price : price;
        price = clothesData != null ? clothesData.price : price;
        price = foodData != null ? foodData.price : price;
        coin  = SaveSystem.A_Coin();
        previewImage.sprite = obj.GetComponent <Image>().sprite;
        cost.text           = obj.transform.parent.GetChild(1).GetChild(0).GetComponent <Text>().text;
        previewObj.SetActive(true);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     playerCoin.text = SaveSystem.A_Coin().ToString();
     Main_Manager.m_CoinEvent.AddListener(UpdateCoin);
 }