public void DriftIntoSpace() { Destruction(); gameManager.GetComponent <GameManager>().DeselectObject(); launchStatus = launchStatuses.Drifting; ColorOverlay(); }
public void CrashIntoEarth() { Destruction(); gameManager.GetComponent <GameManager>().DeselectObject(); launchStatus = launchStatuses.Falling; ColorOverlay(); }
public virtual void Update() // Nove the satellite around // Calculate sat distance from planet { orbitalDistance = Vector3.Distance(transform.position, planetToOrbit.transform.position) - (planetToOrbit.transform.localScale.x / 2) + 20; if (launchStatus == launchStatuses.Constructing) { // Rocket is being built. So it cannot launch even when forced to. ColorOverlay(); launchStatus = launchStatuses.Waiting; } else if (launchStatus == launchStatuses.Waiting) { // If rocket is waiting on ground, have it rotate with the earth. transform.RotateAround(Vector3.zero, Vector3.forward, Time.deltaTime); } else if (launchStatus == launchStatuses.Launching) { transform.position = Vector3.MoveTowards(transform.position, planetToOrbit.transform.position, -20 * Time.deltaTime); if (orbitalDistance >= startingOrbit) { transform.position = Vector3.MoveTowards(transform.position, planetToOrbit.transform.position, orbitalDistance - startingOrbit); // Compensate for overshot launches on low FPS launchStatus = launchStatuses.Orbiting; ColorOverlay(); } } else if (launchStatus == launchStatuses.Orbiting) { if (orbitalDistance > 225) { DriftIntoSpace(); } Orbit(); } else if (launchStatus == launchStatuses.Landing) { if (orbitalDistance < 15) { Destroy(this.gameObject); } downwardSpeed = 0.01f; transform.position = Vector3.MoveTowards(transform.position, planetToOrbit.transform.position, 10 * Time.deltaTime); } else if (launchStatus == launchStatuses.Falling) { if (orbitalDistance < 15) { Destroy(this.gameObject); } downwardSpeed = 0.1f; Orbit(); } else if (launchStatus == launchStatuses.Drifting) { if (orbitalDistance > 666) { Destroy(this.gameObject); } downwardSpeed = -0.1f; Orbit(); } }
public virtual void Landing() { launchStatus = launchStatuses.Landing; ColorOverlay(); gameManager.GetComponent <GameManager>().DeselectObject(); }
public void LiftOff() { launchStatus = launchStatuses.Launching; }