void setCameraMode(MinimapMode mode) { _mode = mode; switch (mode) { case MinimapMode.FOLLOW_PLAYER: GetComponent <Camera>().orthographicSize = 65; transform.position = new Vector3(_player.transform.position.x, _cameraHeight, _player.transform.position.z); _player.transform.GetChild(0).localScale = new Vector3(3, 1, 3); break; case MinimapMode.VIEW_ALL: transform.position = new Vector3(10, _cameraHeight, 5); _player.transform.GetChild(0).localScale = new Vector3(7, 1, 7); GetComponent <Camera>().orthographicSize = 200; break; } }
public void Start() { this.CurrentMode = MinimapMode.Heightmap; }
public void setModeFromDropdown(int option_index) { CurrentMode = (MinimapMode) System.Enum.GetValues(typeof(MinimapMode)).GetValue(option_index); }
private void OnGUI() { scrollviewPos = EditorGUILayout.BeginScrollView(scrollviewPos); style = new GUIStyle(EditorStyles.largeLabel); style.fontStyle = FontStyle.Bold; style.fixedWidth = 120; GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Canvas options", style); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(10); createCanvas = EditorGUILayout.Toggle("Create new canvas", createCanvas); if (createCanvas) { GUILayout.Space(5); style = new GUIStyle(EditorStyles.foldoutHeader); style.fixedWidth = 185; style.fontStyle = FontStyle.Bold; canvasFoldOut = EditorGUILayout.Foldout(canvasFoldOut, "Canvas advanced options", true, style); if (canvasFoldOut) { CanvasOptions(); GUILayout.Space(5); } } style = new GUIStyle(EditorStyles.largeLabel); style.fontStyle = FontStyle.Bold; style.fixedWidth = 120; GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Minimap options", style); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(15); minimapMode = (MinimapMode)EditorGUILayout.EnumPopup("minimap version", minimapMode); switch (minimapMode) { case MinimapMode.CAMERA_RENDER: createCamera = EditorGUILayout.Toggle("Create camera?", createCamera); if (createCamera) { cameraProjection = (CameraProjectionType)EditorGUILayout.EnumPopup("Projection", cameraProjection); //define culling mask if (cameraProjection == CameraProjectionType.Orthographic) { //define size } else { //define fov } } break; case MinimapMode.CUSTOM_TEXTURE: CustomTexture = (Sprite)EditorGUILayout.ObjectField("Map texture", CustomTexture, typeof(Sprite), false); break; } //list of custom waypoints to show on map. //image for player //show icons on border? //compass //minimap position //minimap size //border? //custom border? //Create radar button CreateButton(); EditorGUILayout.EndScrollView(); }