Example #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);
	}
Example #2
0
	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);
	}
Example #3
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);
		}
	}
Example #4
0
    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; 
    }
Example #5
0
	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);
	}
Example #6
0
 private void Awake()
 {
     _startButton = GetComponent<Button>();
     _masterInstance = FindObjectOfType<Master_Instance>();
 }
Example #7
0
	void Start () {
		master = GameObject.Find("Master_Instance").GetComponent<Master_Instance>();
		aux = GetComponent<SpriteRenderer>().sprite;
		setLayer();
        _towerController = transform.parent.parent.GetComponent<TowerController>();
    }