Example #1
0
    private void mockSpawnStars()
    {
        int    index      = 0;
        string starSeedId = null;

        for (; index < 42; index++)
        {
            StarInfo starInfo = new StarInfo();
            starInfo.randomizeInfo();

            spawnStar(starInfo);

            // set seed star as visited
            if (starSeedId == null)
            {
                starSeedId = starInfo.starId;

                NStar starSeed = null;
                if (starMap.TryGetValue(starSeedId, out starSeed))
                {
                    starSeed.setVisited();
                }
            }
        }
    }
Example #2
0
    void Update()
    {
    #if DEBUG
        if (Input.GetKeyUp(KeyCode.S) || Input.GetKey(KeyCode.B))
        {
            StarInfo starInfo = new StarInfo();
            starInfo.randomizeInfo();
            spawnStar(starInfo);
            starPopulation.text = "# of stars: [" + starMap.Count.ToString() + "]";
        }
        else if (Input.GetMouseButtonDown(0))
        {
            createNewStellarSytem();
        }

        if (Input.GetKeyUp(KeyCode.R))
        {
            prepareNewStellarSystem();
        }

        if (Input.GetKeyUp(KeyCode.V))
        {
            getSelected().setVisited();
        }

        if (Input.GetKeyUp(KeyCode.C))
        {
            string currentStarId = getSelected().getStarId();
            setCurrentStar(currentStarId);
        }

        if (Input.GetKeyUp(KeyCode.Space))
        {
            mockSpawnStars();
            starPopulation.text = "# of stars: [" + starMap.Count.ToString() + "]";
            prepareNewStellarSystem();
        }
    #endif

        updateUniverseBoundaryMeta();

    #if DEBUG
        updateUniverseBoundMarker();
    #endif
    }