コード例 #1
0
    // Use this for initialization
    protected void Start()
    {
        //First time setup
        gravityElements             = GetComponent <GravityElements>();
        gravityElements.MassiveBody = findInfluencingCelestialBody(transform.position, gravityElements.velocity, null);
        gravityElements.TimeStep    = GlobalElements.timeStep;
        gravityElements.Position    = transform.position - gravityElements.MassiveBody.transform.position;
        sphereChangeImmunity        = 0;

        calculateInitialOrbitalElements(gravityElements.Position, gravityElements.velocity);

        shipPatchedConics = GetComponent <ShipPatchedConics>();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        node          = null;
        shipElements  = GetComponent <GravityElements>();
        ship          = GetComponent <ShipGravityBehavior>();
        lineDrawer    = GetComponentInChildren <LineDrawer>();
        patchedConics = GetComponent <ShipPatchedConics>();

        currentMassiveBody = shipElements.massiveBody;

        hoverDistanceTolerance = 1f;
        hovering        = false;
        lastTrueAnomaly = shipElements.TrueAnomaly;
        thrustVector    = new Vector2(0, 0);
    }