// Start is called before the first frame update
 void Start()
 {
     exAud          = GetComponent <ExplosionAudio>();
     explosion      = GetComponent <ParticleSystem>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     hp             = gameObject.GetComponent <Damageable>();
 }
Beispiel #2
0
 // 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>();
 }
 // Start is called before the first frame update
 void Start()
 {
     exAud          = GetComponent <ExplosionAudio>();
     explosion      = GetComponent <ParticleSystem>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     collisionBox   = GetComponent <BoxCollider2D>();
     rb2d           = GetComponent <Rigidbody2D>();
 }