private void Start() { anim = GetComponentInChildren <Animator>(); _shoot = FindObjectOfType <Shoot>(); _scoreText = GameObject.Find("Score_Text").GetComponent <Score_Text>(); _shoot.ShootPos += ZombieDead; }
// Use this for initialization void Start() { audio_source = gameObject.GetComponent<AudioSource>(); anim = gameObject.GetComponent<Animator>(); GameObject score_text_object = GameObject.FindWithTag("Score"); if (score_text_object != null) { score_text = score_text_object.GetComponent<Score_Text>(); } }
private void Start() { score_text = FindObjectOfType <Score_Text>(); best_text = FindObjectOfType <Best_Text>(); coin_text = FindObjectOfType <Coin_Text>(); Grid.getGrid.LoadFile(); best_text.SetText(Grid.getGrid.BestScore.ToString()); coin_text.SetText(Grid.getGrid.Coin.ToString()); Grid.getGrid.Score = 0; //score_text.SetText(Grid.getGrid.Score.ToString()); setManMoveable(new NormalManMove(this.gameObject, null)); CreatManMoveFac = new CreateMoveableFactory(); HpBar = FindObjectOfType <Slider>(); setHpBar((float)Grid.getGrid.BagLeftBox); Sound_Jump = Resources.Load <AudioClip>("Sound_Jump"); Sound_EatBag = Resources.Load <AudioClip>("Sound_EatBag"); m_sprite = transform.GetComponentInChildren <SpriteRenderer>(); }
// Start is called before the first frame update void Start() { _st = FindObjectOfType <Score_Text>(); }
// Use this for initialization void Awake() { audio_source = gameObject.GetComponent<AudioSource>(); anim = gameObject.GetComponent<Animator>(); //Gte the game score text GameObject score_text_object = GameObject.FindWithTag("Score"); if (score_text_object != null) { score_text = score_text_object.GetComponent<Score_Text>(); } //Set status variables hp = 3; //Start with 3 hit points }