// Use this for initialization void Awake() { manager = GameObject.Find("Manager").GetComponent <ManagerScript>(); if (destroyBlock == null) { destroyBlock = GameObject.Find("Manager").GetComponent <DestroyBlockScript>(); } }
void Start() { foreach (Transform child in transform) { DestroyBlockScript a = child.gameObject.AddComponent <DestroyBlockScript> (); a.healthCoefficient = healthCoefficient; a.blockAudio = blockAudio; a.hitClip = hitClip; a.destroyClip = destroyClip; a.ui_manager = UI.GetComponent <UIManager> (); } }
private void initializeDestroyBlock() { destroyBlockScript = gameObject.AddComponent <DestroyBlockScript>(); destroyBlockScript.Initialize(this, blockPair, towerWidth, towerHeight); destroyBlockScript.audioManager = audioManager; }