Skip to content

Commit

Permalink
Create MiniMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Legorobotdude committed Apr 2, 2018
1 parent eb641dd commit abc09cc
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 5 deletions.
33 changes: 33 additions & 0 deletions Assets/Materials/MiniMap.renderTexture
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: MiniMap
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_DepthFormat: 2
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
10 changes: 10 additions & 0 deletions Assets/Materials/MiniMap.renderTexture.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

230 changes: 225 additions & 5 deletions Assets/Scenes/Level1.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,75 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &91540843
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 91540844}
- component: {fileID: 91540846}
- component: {fileID: 91540845}
m_Layer: 5
m_Name: Image (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &91540844
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 91540843}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.1232989, y: 1.1232989, z: 1.1232989}
m_Children:
- {fileID: 193625975}
m_Father: {fileID: 609262768}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 69.1, y: -75.3}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &91540845
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 91540843}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!222 &91540846
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 91540843}
--- !u!1 &105101328
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3031,6 +3100,151 @@ ParticleSystem:
m_PrefabParentObject: {fileID: 198138622565325818, guid: a66b7d1917790174eab104e470cd133a,
type: 2}
m_PrefabInternal: {fileID: 381897434}
--- !u!1 &193625974
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 193625975}
- component: {fileID: 193625977}
- component: {fileID: 193625976}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &193625975
RectTransform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 193625974}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.9629083, y: 0.96290845, z: 0.96290845}
m_Children: []
m_Father: {fileID: 91540844}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &193625976
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 193625974}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Texture: {fileID: 8400000, guid: 9cbd000d9ea91864dbbc522d93f4a795, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &193625977
CanvasRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 193625974}
--- !u!1 &219508053
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 219508056}
- component: {fileID: 219508055}
- component: {fileID: 219508054}
m_Layer: 0
m_Name: MiniMapCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &219508054
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 219508053}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d1d0a897618141e41ad6def194ace8c1, type: 3}
m_Name:
m_EditorClassIdentifier:
player: {fileID: 478378695}
--- !u!20 &219508055
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 219508053}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 15
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 8400000, guid: 9cbd000d9ea91864dbbc522d93f4a795, type: 2}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &219508056
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 219508053}
m_LocalRotation: {x: 0.70710677, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 48.84, y: 24.82, z: -38.73}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 0}
--- !u!1001 &294148099
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3163,6 +3377,11 @@ Camera:
m_PrefabParentObject: {fileID: 20355403973716424, guid: b9561aa12c8047f40929aae36eeb67f5,
type: 2}
m_PrefabInternal: {fileID: 1818987494}
--- !u!4 &478378695 stripped
Transform:
m_PrefabParentObject: {fileID: 4327301938351504, guid: b9561aa12c8047f40929aae36eeb67f5,
type: 2}
m_PrefabInternal: {fileID: 1818987494}
--- !u!1 &533223857
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5695,7 +5914,7 @@ MonoBehaviour:
m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
Expand Down Expand Up @@ -5736,6 +5955,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 633955921}
- {fileID: 91540844}
m_Father: {fileID: 0}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -5831,7 +6051,7 @@ RectTransform:
m_GameObject: {fileID: 633955920}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.047856048, y: 0.047856044, z: 0.047856044}
m_LocalScale: {x: 0.018967746, y: 0.018967733, z: 0.018967733}
m_Children: []
m_Father: {fileID: 609262768}
m_RootOrder: 0
Expand Down Expand Up @@ -8972,11 +9192,11 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 1906805425085612, guid: b9561aa12c8047f40929aae36eeb67f5, type: 2}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1775412684214486, guid: b9561aa12c8047f40929aae36eeb67f5, type: 2}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114169403544723174, guid: b9561aa12c8047f40929aae36eeb67f5,
type: 2}
Expand Down Expand Up @@ -9355,7 +9575,7 @@ Mesh:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: pb_Mesh-73812
m_Name: pb_Mesh12490
serializedVersion: 8
m_SubMeshes:
- serializedVersion: 2
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions Assets/Scripts/Minimap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Minimap : MonoBehaviour {

[SerializeField] private Transform player;
private float yPos;

void Start()
{
yPos = transform.position.y;
}


// Update is called once per frame
void LateUpdate ()
{
transform.position = new Vector3(player.position.x, yPos, player.position.z);
transform.rotation = Quaternion.Euler(90f, player.eulerAngles.y,0);
}
}
13 changes: 13 additions & 0 deletions Assets/Scripts/Minimap.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit abc09cc

Please sign in to comment.