示例#1
0
    void Explosion()
    {
        /* active bombs */
        var n = _bombPower;


        /* smoke particles */
        var leftSmoke  = InsertSmoke();
        var rightSmoke = InsertSmoke();
        var upSmoke    = InsertSmoke();
        var downSmoke  = InsertSmoke();

        if (Vector3.Distance(player.transform.position, gameObject.transform.position) < 4.0f)
        {
            am.PlayBombExplosion();
        }



        /* effect */
        leftSmoke.GetComponent <ExplosionSmoke>().Move("left", n);
        rightSmoke.GetComponent <ExplosionSmoke>().Move("right", n);
        upSmoke.GetComponent <ExplosionSmoke>().Move("up", n);
        downSmoke.GetComponent <ExplosionSmoke>().Move("down", n);

        /* destructors */
        leftSmoke.GetComponent <ExplosionSmoke>().Kill();
        rightSmoke.GetComponent <ExplosionSmoke>().Kill();
        upSmoke.GetComponent <ExplosionSmoke>().Kill();
        downSmoke.GetComponent <ExplosionSmoke>().Kill();
        Destroy(gameObject);
    }