Add poor menu
This commit is contained in:
36
Assets/Scripts/CanvasManager.cs
Normal file
36
Assets/Scripts/CanvasManager.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class CanvasManager : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
public void Scene(int sceneNumber)
|
||||
{
|
||||
SceneManager.LoadScene(sceneNumber);
|
||||
}
|
||||
|
||||
public void Scene(string sceneName)
|
||||
{
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
|
||||
|
||||
}
|
11
Assets/Scripts/CanvasManager.cs.meta
Normal file
11
Assets/Scripts/CanvasManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a854263946f24e34b97f71784bdf5b3e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -245,7 +245,6 @@ public class PlayerManager : MonoBehaviour
|
||||
|
||||
public void ActivePowerCube(float power, float powerTime, PowerCubeManager.PowerType powerType, string nextSceneName = "")
|
||||
{
|
||||
Debug.Log((powerType.GetHashCode() - 1));
|
||||
if ((powerType.GetHashCode() - 1) == 3)
|
||||
{
|
||||
SceneManager.LoadScene(nextSceneName);
|
||||
|
@@ -9,7 +9,6 @@ public class PowerCubeManager : MonoBehaviour
|
||||
public PowerType powerType = PowerType.Nothing;
|
||||
public float powerTime = 5f;
|
||||
public float powerUnit = 10f;
|
||||
private bool interact = false;
|
||||
public string nextSceneName;
|
||||
private MeshRenderer meshRenderer;
|
||||
|
||||
@@ -45,7 +44,6 @@ public class PowerCubeManager : MonoBehaviour
|
||||
if (other.gameObject.tag == "Player")
|
||||
{
|
||||
meshRenderer.materials[1].SetFloat("_Outline", 0.4f);
|
||||
interact = true;
|
||||
}
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -53,7 +51,6 @@ public class PowerCubeManager : MonoBehaviour
|
||||
if (other.gameObject.tag == "Player")
|
||||
{
|
||||
meshRenderer.materials[1].SetFloat("_Outline", 0.0f);
|
||||
interact = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user