Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.SceneManagement;
- class CastleInfo
- {
- private string _name;
- private int _gold,_population;
- public string CastleName
- {
- get
- {
- return _name;
- }
- set
- {
- _name = value;
- }
- }
- public int CastleGold
- {
- get
- {
- return _gold;
- }
- set
- {
- _gold = value;
- }
- }
- public int CastlePopulation
- {
- get
- {
- return _population;
- }
- set
- {
- _population = value;
- }
- }
- }
- public class CastleChose : MonoBehaviour
- {
- public int random = 0;
- CastleInfo MyCastle = new CastleInfo();
- void OnMouseOver()
- {
- if (Input.GetMouseButtonDown(0))
- {
- random = Random.Range(1, 10) * 10;
- MyCastle.CastleName = gameObject.name;
- MyCastle.CastlePopulation = 1000 - random;
- MyCastle.CastleGold = 11000 - (MyCastle.CastlePopulation * 4);
- print(MyCastle.CastleName + " < nazwa");
- print(MyCastle.CastleGold + " < złoto");
- print(MyCastle.CastlePopulation + " < Populacia");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement