示例#1
0
    private void WorldChanged(int newActiveIndex)
    {
        for (int i = 0; i < worlds.Length; i++)
        {
            WorldPreview world = worlds[i];

            if (i == newActiveIndex)
            {
                world.gameObject.SetActive(true);
                world.transform.position = selectedPoint.transform.position;
            }
            else if (i == newActiveIndex - 1)
            {
                world.gameObject.SetActive(true);
                world.transform.position = previousPoint.transform.position;
            }
            else if (i == newActiveIndex + 1)
            {
                world.gameObject.SetActive(true);
                world.transform.position = nextPoint.transform.position;
            }
            else
            {
                world.gameObject.SetActive(false);
            }
        }

        activeWorldIndex = newActiveIndex;
        OnWorldChanged.Invoke(worlds[activeWorldIndex]);
    }
示例#2
0
    private void WorldChanged(WorldPreview world)
    {
        activeWorld = world;

        ChangeGoToButton();
        ChangeWorldTextMesh();
    }
示例#3
0
    public override void OnInspectorGUI()
    {
        WorldPreview mapPreview = (WorldPreview)target;

        if (DrawDefaultInspector())
        {
            if (mapPreview.autoUpdate)
            {
                mapPreview.DrawMapInEditor();
            }
        }

        if (GUILayout.Button("Generate"))
        {
            mapPreview.DrawMapInEditor();
        }
    }