Exemplo n.º 1
0
    public void DisengageParts()
    {
        ExplosionDummy.gameObject.SetActive(true);
        //set rotations correctly
        if (isFullbody())
        {
            ExplosionDummy.FindChild("LowerTorso").rotation = Fullbody.rotation;
            ExplosionDummy.FindChild("UpperTorso").rotation = Fullbody.rotation;
        }
        else
        {
            ExplosionDummy.FindChild("LowerTorso").rotation = LowerTorso.rotation;
            ExplosionDummy.FindChild("UpperTorso").rotation = UpperTorso.rotation;
        }
        foreach (Rigidbody r in ExplosionDummy.GetComponentsInChildren(typeof(Rigidbody)))
        {
            r.transform.parent = null;
        }

        particles.Explode();
    }
Exemplo n.º 2
0
    //DEV.TEMP
    public void setColor(Color color)
    {
        foreach (Renderer t in Mecha.GetComponentsInChildren(typeof(Renderer)))
        {
            t.material.color = color;
        }

        ExplosionDummy.gameObject.SetActive(true);
        foreach (Renderer t in ExplosionDummy.GetComponentsInChildren(typeof(Renderer)))
        {
            t.material.color = color;
        }
        ExplosionDummy.gameObject.SetActive(false);

        Fullbody.gameObject.SetActive(true);
        foreach (Renderer t in Fullbody.GetComponentsInChildren(typeof(Renderer)))
        {
            t.material.color = color;
        }
        Fullbody.gameObject.SetActive(false);
    }