Simple Level Template Prefab Added
This commit is contained in:
@@ -41,6 +41,8 @@ namespace Level
|
||||
needsRestart = false;
|
||||
}
|
||||
|
||||
public void EndLevel() => PlayerPrefs.SetInt(LevelName, 1);
|
||||
|
||||
[ContextMenu("Restart")]
|
||||
public void Restart() => LevelManager.Instance.SwitchToLevel(LevelName);
|
||||
}
|
||||
|
12
Assets/Scripts/Level/LevelEnd.cs
Normal file
12
Assets/Scripts/Level/LevelEnd.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Level
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
public class LevelEnd : MonoBehaviour
|
||||
{
|
||||
private Level level = null;
|
||||
private void Awake() => level = GetComponentInParent<Level>();
|
||||
|
||||
public void EndLevel() => level.EndLevel();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Level/LevelEnd.cs.meta
Normal file
11
Assets/Scripts/Level/LevelEnd.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 696558d6c83d74a498934105513921b3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user