Пример #1
0
    public static void SetupGravityEngine(GameObject centerBody, GameObject orbitingBody)
    {
        GravityEngine ge = GravityEngine.Instance();

        if (ge == null)
        {
            Debug.LogError("No GE in scene");
        }
        if (ge.evolveAtStart)
        {
            Debug.LogError("Evolve at start set. Are you in the TestRunner scene?");
        }
        else if (ge.detectNbodies)
        {
            Debug.LogError("Detect NBodies at start set. Are you in the TestRunner scene?");
        }
        ge.UnitTestAwake();
        ge.Clear();
        ge.AddBody(centerBody);
        if (orbitingBody != null)
        {
            ge.AddBody(orbitingBody);
        }
        ge.Setup();
        ge.LogDump();
    }