Priz 1 сар өмнө
parent
commit
aaeedd9488

+ 39 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/MinimapTexture.renderTexture

@@ -0,0 +1,39 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!84 &8400000
+RenderTexture:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: MinimapTexture
+  m_ImageContentsHash:
+    serializedVersion: 2
+    Hash: 00000000000000000000000000000000
+  m_IsAlphaChannelOptional: 0
+  serializedVersion: 6
+  m_Width: 256
+  m_Height: 256
+  m_AntiAliasing: 1
+  m_MipCount: -1
+  m_DepthStencilFormat: 94
+  m_ColorFormat: 8
+  m_MipMap: 0
+  m_GenerateMips: 1
+  m_SRGB: 0
+  m_UseDynamicScale: 0
+  m_UseDynamicScaleExplicit: 0
+  m_BindMS: 0
+  m_EnableCompatibleFormat: 1
+  m_EnableRandomWrite: 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
+  m_ShadowSamplingMode: 2

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/MinimapTexture.renderTexture.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 291f62d3315772a4abb4581ec6d84d30
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 8400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 784 - 97
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Game.unity


+ 27 - 1
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/GameManager.cs

@@ -5,6 +5,8 @@ using UnityEngine.SceneManagement;
 public class GameManager : MonoBehaviour
 {
     public static GameManager Instance;
+    public GameObject GameOverUI;
+    public GameObject VictoryUI;
 
     [Header("Orb Settings")]
     public int totalOrbs = 20;
@@ -20,7 +22,7 @@ public class GameManager : MonoBehaviour
 
     void Awake()
     {
-       if (Instance == null)
+        if (Instance == null)
         {
             Instance = this;
         } else
@@ -80,13 +82,37 @@ public class GameManager : MonoBehaviour
 
     void Victory()
     {
+        VictoryUI.SetActive(true);
         gameOver = true;
+
+        Time.timeScale = 0f;
+
+        Cursor.lockState = CursorLockMode.None;
+        Cursor.visible = true;
+
         Debug.Log("YOU WIN!");
     }
 
     void GameOver()
     {
+        GameOverUI.SetActive(true);
         gameOver = true;
+
+        Time.timeScale = 0f;
+
+        Cursor.lockState = CursorLockMode.None;
+        Cursor.visible = true;
+
+
         Debug.Log("YOU LOSE!");
     }
+
+    public void RestartGame()
+    {
+        Time.timeScale = 1f;
+        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
+
+        Cursor.lockState = CursorLockMode.Locked;
+        Cursor.visible = false;
+    }
 }

+ 18 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MinimapCamera.cs

@@ -0,0 +1,18 @@
+using UnityEngine;
+
+public class MinimapCamera : MonoBehaviour
+{
+    public Transform player;
+    public float height = 40f;
+
+    void LateUpdate()
+    {
+        transform.position = new Vector3(
+            player.position.x,
+            height,
+            player.position.z
+        );
+
+        transform.rotation = Quaternion.Euler(90f, player.eulerAngles.y, 0f);
+    }
+}

+ 2 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MinimapCamera.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: fc3598329d6cd854f922bd82ac7efaea

+ 17 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/StaminaUI.cs

@@ -0,0 +1,17 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+public class StaminaUI : MonoBehaviour
+{
+    public Image staminaFill;
+    public PlayerController player;
+
+    void Update()
+    {
+        staminaFill.fillAmount = Mathf.Lerp(
+            staminaFill.fillAmount,
+            (float)player.Stamina / player.maxStamina,
+            Time.deltaTime * 10f
+        );
+    }
+}

+ 2 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/StaminaUI.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 8c65bec366f0932458839460219ebc75

+ 1 - 1
GAMEN3-ValleyRunner_SanTi036/Assets/Skybox.mat

@@ -112,7 +112,7 @@ Material:
     - _DstBlend: 0
     - _DstBlendAlpha: 0
     - _EnvironmentReflections: 1
-    - _Exposure: 0.8942374
+    - _Exposure: 0.85094875
     - _GlossMapScale: 0
     - _Glossiness: 0
     - _GlossyReflections: 0

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно