Beispiel #1
0
	// Use this for initialization
	void Start () {
		parent_=this.gameObject.transform.parent.transform.parent.gameObject;
		masterPoint = FindObjectOfType<Master_Instance>();
		if(masterPoint.countMoney()<masterPoint.getPrice(this.gameObject)){master.isHide(this.gameObject);}//---------------------------------prices
		aux = GetComponent<SpriteRenderer>().sprite;
		master.setLayer("interface",this.gameObject);
	}
Beispiel #2
0
	void Start () {
		if(this.gameObject.transform.parent.transform.parent.gameObject.GetComponent<Buttons_Clicked>().isClicked(this.gameObject.name)==true){
			GameObject unclickeable = Instantiate(Resources.Load("Buttons/Unclickeable"), this.transform.position , Quaternion.identity)as GameObject;
			unclickeable.transform.parent = this.transform.parent;
			Destroy(this.gameObject);
		}else{
			masterPoint = GameObject.Find("Master_Instance").GetComponent<Master_Instance>();
			if(masterPoint.countMoney()<masterPoint.getPrice(this.gameObject)){master.isHide(this.gameObject);}//---------------------------------prices
			aux = GetComponent<SpriteRenderer>().sprite;
			master.setLayer("interface",this.gameObject);
		}
	}