Example #1
0
    virtual public void Loaded(Transform shooter)
    {
        gameObject.layer   = LayerMask.NameToLayer("Astronaut");
        isLoaded           = true;
        bodyRb.useGravity  = false;
        bodyRb.isKinematic = true;
        Vector3 handsRot = armCtrl.localEulerAngles;

        handsRot.z = 180f;
        armCtrl.localEulerAngles = handsRot;
        Vector3 loadedPos = shooter.position;

        //loadedPos.y += height;
        transform.position = loadedPos;
        transform.parent   = shooter;
        cageScript.Dismiss(volume);
    }
 public void SelfDestroy()
 {
     audioS.Play();
     cageScript.Dismiss(volume);
     Instantiate(destroyParticle, destroyParticlePos.position, destroyParticlePos.rotation);
     Collider[] smashTargets = Physics.OverlapSphere(transform.position, transform.localScale.x * smashRange, smashTargetLayer);
     foreach (Collider col in smashTargets)
     {
         col.transform.GetComponent <humanCtrl>().Death();
     }
     Destroy(gameObject);
 }