using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Balance : MonoBehaviour
{
void Awake ()
{
GameObject stone = GameObject.Find ("Stone");
ClickChet clickChet = stone.GetComponent<ClickChet>();
}
public int Coin = clickChet.coin;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClickChet : MonoBehaviour
{
public int Coin;
void OnMouseDown()
{
Coin = Coin + 1; // при нажатии добавляет 1 монету
}
}