Arsene vor 4 Jahren
Ursprung
Commit
630d853e07

+ 6 - 0
.vsconfig

@@ -0,0 +1,6 @@
+{
+  "version": "1.0",
+  "components": [ 
+    "Microsoft.VisualStudio.Workload.ManagedGame"
+  ]
+} 

+ 8 - 0
Assets/Event.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1072c5f81f5db3045857c01fb86c8611
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Assets/Event/GamePassEvent.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class GamePassEvent : MonoBehaviour
+{
+    public static Action mOnEvent;
+    public static void Register(Action onEvent)
+    {
+        mOnEvent += onEvent;
+    }
+    public static void UnRegister(Action onEvent)
+    {
+        mOnEvent -= onEvent;
+    }
+    public static void Trigger()
+    {
+        mOnEvent?.Invoke();
+    }
+}

+ 11 - 0
Assets/Event/GamePassEvent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c01384794f961d041af1310554f2130e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 23 - 0
Assets/Event/GameSrartEvent.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class GameSrartEvent : MonoBehaviour
+{
+    private static Action mOnEvent;
+
+    public static void Register(Action onEvent)
+    {
+        mOnEvent += onEvent;
+    }
+
+    public static void UnRegister(Action onEvent)
+    {
+        mOnEvent -= onEvent;
+    }
+    public static void Trigger()
+    {
+        mOnEvent?.Invoke();
+    }
+}

+ 11 - 0
Assets/Event/GameSrartEvent.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 389b067d8875c6342b238a917ad003da
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/FrameWorkDesign.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 01af76ff963759a4e85795461cc9f14d
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/FrameWorkDesign/Example.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c8e070be83362504d852eb5fdd1bdcf4
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Datei-Diff unterdrückt, da er zu groß ist
+ 1880 - 0
Assets/FrameWorkDesign/Example/Game.unity


+ 7 - 0
Assets/FrameWorkDesign/Example/Game.unity.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: dbf2c17a9065b624b9f5a94916923070
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/Game.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c102a7bfd86c3da4d8c54701e6d7ec13
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Assets/Game/Game.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Game : MonoBehaviour
+{
+    private void Awake()
+    {
+        GameSrartEvent.Register(OnGameStart);
+    }
+
+    private void OnGameStart()
+    {
+        transform.Find("Enemies").gameObject.SetActive(true);
+    }
+    private void OnDestroy()
+    {
+        GameSrartEvent.UnRegister(OnGameStart);
+    }
+}

+ 11 - 0
Assets/Game/Game.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7a721c7766350204cae5a3647d5fb070
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/Resources.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ba4fbcfcf0d32a5418b0b36ecfc66281
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/Scripts.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ee343f5f479cdcd41a71bf01de2fb280
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Assets/Scripts/Enemy.cs

@@ -0,0 +1,21 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Enemy : MonoBehaviour
+{
+    protected static int count = 0;
+
+    public GameObject GamePassPenel;
+
+    private void OnMouseDown()
+    {
+        count++;
+        Destroy(gameObject);
+        if (count >= 6)
+        {
+            GamePassEvent.Trigger();
+        }
+    }
+
+}

+ 11 - 0
Assets/Scripts/Enemy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 03dab518e674c124e98b668b805aec4e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/Scripts/UI.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: dccee577ca4355b40a3b931b9ec90abf
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 0
Assets/Scripts/UI/GameStartPanel.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class GameStartPanel : MonoBehaviour
+{
+    public GameObject Enemies;
+    private void Start()
+    {
+        transform.Find("BtnStart").GetComponent<Button>()
+            .onClick.AddListener(() =>
+            {
+                gameObject.SetActive(false);
+
+                GameSrartEvent.Trigger();
+            });
+    }
+}

+ 11 - 0
Assets/Scripts/UI/GameStartPanel.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c6e1f2f1fd32a414c9fefd73f829eb58
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 22 - 0
Assets/Scripts/UI/UI.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UI : MonoBehaviour
+{
+    private void Start()
+    {
+        GamePassEvent.Register(OnGamePass);
+    }
+
+    private void OnGamePass()
+    {
+        transform.Find("Canvas/GamePassPanel").gameObject.SetActive(true) ;
+    }
+    private void OnDestroy()
+    {
+        GamePassEvent.UnRegister(OnGamePass);
+    }
+
+}

+ 11 - 0
Assets/Scripts/UI/UI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ed0ac1051134b68449215f489179222a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: