Exemplo n.º 1
0
    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> ();
    }
Exemplo n.º 2
0
    void Awake()
    {
        exploder = GetComponentInChildren <HLG_Exploder> ();

        exploder.callback += Explode;
    }