Example #1
0
 //Remvoes any old copy of the chunk and sets the original, abstract chunk active
 private void Restore()
 {
     DestroyMultiple(SceneInstances);          //Destroy the generated chunk
     SetObjectActive(true);
     SceneUpdater.SetActive(true);
     SceneUpdater.UpdateScene();
 }
Example #2
0
    private void InstantiateChunk(int _seed)
    {
        int startMillis = DateTime.Now.Millisecond;

        UnityEngine.Random.InitState(_seed);

        SceneUpdater.SetActive(false);
        DestroyMultiple(SceneInstances); //Remove old generated chunk
        SetObjectActive(true);           //Has to be active or else the copy could be inactive, too
        GameObject instance       = (GameObject)GameObject.Instantiate(OriginalObject, OriginalObject.transform.position, Quaternion.identity);
        GameObject instantiatable = FindInstantiatable(instance);

        SetObjectActive(false);
        ChunkInstantiator generator = ChunkInstantiator.Instance;

        generator.ProcessType = ProcessType.INEDITOR;
        generator.InstantiateChunk(instantiatable, false);
        instance.tag   = InstanceTag;
        durationMillis = DateTime.Now.Millisecond - startMillis;
    }