// Use this for initialization void Start() { #region get score counter //get ScoreHealthLivesCounter from ScoreHealthLives myScoreCounter = GameObject.Find("ScoreHealthLives").GetComponent <ScoreHealthLivesCounter>(); #endregion get score counter }
// Use this for initialization void Start() { //get scripts on this object atlasBullets = GetComponent <AtlasBullets>(); polyCollider2D = GetComponent <PolygonCollider2D>(); enemyHeatlh = GetComponent <EnemyHealth>(); spawnEnemy = transform.parent.parent.GetComponent <SpawnEnemy>(); //music player musicPlayer = GameObject.FindObjectOfType <MusicPlayer>(); //bullet manager bulletManager = GameObject.FindObjectOfType <BulletManagerScript>(); #region get score counter //get ScoreHealthLivesCounter from ScoreHealthLives myScoreCounter = GameObject.Find("ScoreHealthLives").GetComponent <ScoreHealthLivesCounter>(); #endregion get score counter }
void Start() { #region find gameObject and scripts //get BulletManager Script #region find object of type bullet manager bulletManager = GameObject.FindObjectOfType <BulletManagerScript>(); #endregion find object of type bullet manager //get ScoreHealthLivesCounter script scoreHealthLivesCounter = GameObject.FindObjectOfType <ScoreHealthLivesCounter>(); //get beginTryAgain beginTryAgain = GameObject.FindObjectOfType <BeginTryAgain>(); //get playerhealth playerHealth = GameObject.FindObjectOfType <PlayerHealth>(); //get butterflyPC gameObject butterflyPC = GameObject.FindWithTag("Player"); #endregion find gameObject and script }
void Start() { //get ScoreHealthLivesCounter from ScoreHealthLives scorehealthlivescounter = GameObject.Find("ScoreHealthLives").GetComponent <ScoreHealthLivesCounter>(); }