//private void OnDrawGizmos() //{ // if (Application.isPlaying) // { // if (targetPlanetT != null) // Gizmos.DrawSphere(playerToTarget, 0.1f); // Gizmos.color = Color.green; // Gizmos.DrawRay(t.position, t.up); // Gizmos.color = Color.blue; // Gizmos.DrawRay(t.position, t.forward); // Gizmos.color = Color.red; // Gizmos.DrawRay(t.position, t.right); // Gizmos.color = Color.white; // Gizmos.DrawRay(t.position, playerToTarget); // Gizmos.color = Color.yellow; // Gizmos.DrawRay(t.position, targetCourse); // } //} void _StartMoveAround() { t.RotateAround(targetPlanetT.position, -t.right, (GameManager.gameBaseSpeed * 1.6f) * Time.deltaTime); if (Vector3.Distance(t.position, (targetPlanetT.position - (Vector3.forward * 1.1f))) < 0.02f) { StartMoveAround = null; // PlanetController.OccupedPlanetNum = TargetPlanetNum; t.up = t.up; GameManager.Mode = GameManager.GameMode.Idle; } }
void _StartMoveToSelectedPlanet() { t.position = Vector3.MoveTowards(t.position, (targetPlanetT.position + (Vector3.forward * 1.1f)), 1.5f * speed * Time.deltaTime); if (Vector3.Distance(transform.position, (targetPlanetT.position + (Vector3.forward * 1.1f))) < 0.001f) { StartMoveToSelectedPlanet = null; t.rotation = Quaternion.Euler(0.0f, 0.0f, t.rotation.eulerAngles.z); PlanetController.OccupedPlanetNum = TargetPlanetNum; //tc.SetTrailToPlanet(); StartMoveAround = _StartMoveAround; } }