Exemplo n.º 1
0
 public void Launch(Vector2 force, List <ShipPart> shipParts)
 {
     spriteRenderer.material.SetColor("_SecondaryColor", launchedSecondaryColor);
     this.shipParts = shipParts;
     if (dockingTarget == null)
     {
         ShowGhost();
     }
     else
     {
         dockingTarget.ShowGhost();
     }
     launchFinished = false;
     launchStarted  = true;
     bounds         = Camera.main.GetComponent <FollowCamera>().GetBounds();
     rb.AddForce(force, ForceMode2D.Impulse);
     rb.AddTorque(Random.Range(-100f, 100f));
     collisionDisabledUntil = Time.time + 3.0f;
     coll.enabled           = false;
     rb.simulated           = true;
     targetSet = false;
     GetComponent <Tractorable>().Activate();
 }