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]); }
private void WorldChanged(WorldPreview world) { activeWorld = world; ChangeGoToButton(); ChangeWorldTextMesh(); }
public override void OnInspectorGUI() { WorldPreview mapPreview = (WorldPreview)target; if (DrawDefaultInspector()) { if (mapPreview.autoUpdate) { mapPreview.DrawMapInEditor(); } } if (GUILayout.Button("Generate")) { mapPreview.DrawMapInEditor(); } }