// 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); }
private void Init() { masterPoint = FindObjectOfType<Master_Instance>(); master.setLayer("enemies",this.gameObject); lifebar = master.getChildFrom("Lifebar",this.gameObject); getPoint(); pathFollow = GetComponent<PathFollower>(); anim = this.gameObject.GetComponent<Animator> (); anim.SetBool ("walk", false); anim.SetBool ("dead", false); anim.SetBool ("attack", false); }
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); } }
void Start () { _masterInstance = FindObjectOfType<Master_Instance>(); waves = GameObject.Find("Waves").GetComponent<Text>(); waves.text = wavesIndex + "/" + enemiesInWaves.Length; _movePathRoot = transform.FindChild("MovePath"); int pathSize = GetPathSize(_movePathRoot); path = new Transform[pathSize]; for (int i = 0; i < pathSize - 1; i++) { path[i] = _movePathRoot.FindChild("a" + i); } path[pathSize - 1] = _movePathRoot.FindChild("End"); _gameObject = gameObject; }
void Start () { masterPoint = GameObject.Find("Master_Instance").GetComponent<Master_Instance>(); aux = GetComponent<SpriteRenderer>().sprite; master.setLayer("interface",this.gameObject); this.gameObject.GetComponent<Animator>().SetBool ("on",on); }
private void Awake() { _startButton = GetComponent<Button>(); _masterInstance = FindObjectOfType<Master_Instance>(); }
void Start () { master = GameObject.Find("Master_Instance").GetComponent<Master_Instance>(); aux = GetComponent<SpriteRenderer>().sprite; setLayer(); _towerController = transform.parent.parent.GetComponent<TowerController>(); }