void Awake() { exploder = GetComponentInChildren <HLG_Exploder> (); exploder.callback += Explode; myRigidbody = GetComponent <Rigidbody> (); float randomX = Random.Range(-1.0f, 1.0f); float randomZ = Random.Range(-1.0f, 1.0f); movementDirection = new Vector3(randomX, 0.0f, randomZ).normalized; myRigidbody.velocity = movementDirection * wanderSpeed; mySprite = GetComponentInChildren <SpriteRenderer> (); }
void Awake() { exploder = GetComponentInChildren <HLG_Exploder> (); exploder.callback += Explode; }