Ejemplo n.º 1
0
    public virtual void Start()
    {
        shipID      = GetInstanceID();
        rb          = gameObject.GetComponent <Rigidbody2D>();
        attributes  = GetComponent <ShipAttributes>();
        engineSound = GetComponent <AudioSource>();

        if (!attributes.HasKillCallback())
        {
            attributes.OnKill(RemoveWhenKilled);
        }

        if (trails.Length > 0)
        {
            foreach (ParticleSystem trail in trails)
            {
                trail.Stop();
            }
        }

        if (module && module.GetDefaultState())
        {
            module.isActive = true;
            module.OnActivate(this);
        }

        ships.Add(this);
    }