// Start is called before the first frame update void Start() { damage = GetComponent <Damageable>(); damage.hitpoints = 0; shipPieces = new List <GameObject>(); startPosition = this.gameObject.transform.position; startRotation = this.gameObject.transform.rotation; explosion = GetComponent <ParticleSystem>(); shieldRenderer = shield.GetComponent <SpriteRenderer>(); engineRenderer = engine.GetComponent <SpriteRenderer>(); lWingRenderer = lWing.GetComponent <SpriteRenderer>(); rWingRenderer = rWing.GetComponent <SpriteRenderer>(); lGunRenderer = lGun.GetComponent <SpriteRenderer>(); rGunRenderer = rGun.GetComponent <SpriteRenderer>(); shieldAnim = shield.GetComponent <ShieldAnimator>(); skeletonRenderer = GetComponent <SpriteRenderer>(); partAttached = new Dictionary <ShipPartEnum, bool>(); partAttached[ShipPartEnum.LGun] = false; partAttached[ShipPartEnum.LWing] = false; partAttached[ShipPartEnum.RGun] = false; partAttached[ShipPartEnum.RWing] = false; partAttached[ShipPartEnum.Shield] = false; partAttached[ShipPartEnum.Engine] = false; audioS = GetComponent <AudioSource>(); exAud = GetComponent <ExplosionAudio>(); }
private void ActivateShield(bool activate) { if (activate) { Animator.SetBool("Shield Active", true); ShieldAnimator.SetBool("Shield Active", true); } else { Animator.SetBool("Shield Active", false); ShieldAnimator.SetBool("Shield Active", false); } }