Ejemplo n.º 1
0
    public void InitOrbit(SolarBody sbody)
    {
        // check there is an Ellipse Base
        OrbitEllipse orbitEllipse = sbody.GetComponent <OrbitEllipse>();

        if (orbitEllipse == null)
        {
            Debug.LogError("Prefab must have OrbitEllipse component");
            return;
        }
        orbitEllipse.InitFromSolarBody(sbody);
        ScaleModel(sbody.transform.gameObject, sbody);
        SetPhase(orbitEllipse, sbody);
    }
Ejemplo n.º 2
0
    public void InitOrbit(SolarBody sbody)
    {
        // check there is an Ellipse Base
        OrbitEllipse orbitEllipse = sbody.GetComponent <OrbitEllipse>();

        if (orbitEllipse != null)
        {
            orbitEllipse.InitFromSolarBody(sbody);
            ScaleModel(sbody.transform.gameObject, sbody);
            SetPhase(orbitEllipse, sbody);
            return;
        }
        // TODO: Need to work through SetPhase stuff. Likely ditch OrbitEllipse completely?
        // - this would break backwards compatibility for epoch updates, so NO!
        //OrbitUniversal orbitU = sbody.GetComponent<OrbitUniversal>();
        //if (orbitU != null) {
        //    orbitU.InitFromSolarBody(sbody);
        //    ScaleModel(sbody.transform.gameObject, sbody);
        //    SetPhase(orbitU, sbody);
        //    return;
        //}
        Debug.LogError("Prefab must have OrbitEllipse component");
        return;
    }