mirror of
https://github.com/celisej567/forest.git
synced 2026-09-17 20:08:53 +03:00
Initial commit
This commit is contained in:
25
Assets/scripts/GameRules.cs
Normal file
25
Assets/scripts/GameRules.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameRules : MonoBehaviour
|
||||
{
|
||||
public int MaxLevelSticks;
|
||||
[HideInInspector] public GameObject[] SticksInWorld;
|
||||
[HideInInspector] public GameObject[] stickSpawner;
|
||||
StickSpawner bebra;
|
||||
void Start()
|
||||
{
|
||||
stickSpawner = GameObject.FindGameObjectsWithTag("Spawner");
|
||||
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
SticksInWorld = GameObject.FindGameObjectsWithTag("stick");
|
||||
if (MaxLevelSticks > SticksInWorld.Length)
|
||||
{
|
||||
stickSpawner[Random.Range(0, stickSpawner.Length)].GetComponent<StickSpawner>().CreateStick();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/GameRules.cs.meta
Normal file
11
Assets/scripts/GameRules.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4839ddb5dccdfe0489791d43fc778a87
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/scripts/StickSpawner.cs
Normal file
13
Assets/scripts/StickSpawner.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class StickSpawner : MonoBehaviour
|
||||
{
|
||||
public GameObject StickPrefab;
|
||||
|
||||
public void CreateStick()
|
||||
{
|
||||
GameObject.Instantiate(StickPrefab, transform);
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/StickSpawner.cs.meta
Normal file
11
Assets/scripts/StickSpawner.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89974df8f986e6945b444e9a570b7837
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
Assets/scripts/fireplace.cs
Normal file
49
Assets/scripts/fireplace.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class fireplace : MonoBehaviour
|
||||
{
|
||||
public Light bbb;
|
||||
|
||||
public float magnitude = 2;
|
||||
public float timer = 0.5f;
|
||||
|
||||
private float time = 0;
|
||||
|
||||
public float dietime = 1;
|
||||
|
||||
public Slider Fuel;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//bbb = GetComponent<Light>();
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
//StartCoroutine("bebra");
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if(other.tag == "Player")
|
||||
{
|
||||
dietime += 0.3f * other.GetComponent<PlayerMovement>().stickCount;
|
||||
other.GetComponent<PlayerMovement>().stickCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
|
||||
dietime -= 0.001f;
|
||||
time += Time.deltaTime * timer * Random.Range(1,4);
|
||||
|
||||
bbb.intensity = Mathf.Sin(time) * timer + 10 * dietime;
|
||||
Fuel.value = dietime;
|
||||
//Debug.Log(Fuel.value);
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/fireplace.cs.meta
Normal file
11
Assets/scripts/fireplace.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe2fc2cefe81b2843aeead14c9c2cc22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/scripts/general.meta
Normal file
8
Assets/scripts/general.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba37fd72c20a2e94a9037600442f8716
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/scripts/general/player.meta
Normal file
8
Assets/scripts/general/player.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b0ea5f4250ff644680f18bfb733b164
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
69
Assets/scripts/general/player/CameraBob.cs
Normal file
69
Assets/scripts/general/player/CameraBob.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraBob : MonoBehaviour
|
||||
{
|
||||
public bool Enable = true;
|
||||
[Range(0, 0.1f)] public float Amplitude = 0.015f;
|
||||
[Range(0, 30)] public float Frequency = 10;
|
||||
public float YStrength = 1;
|
||||
public float XStrength = 0.5f;
|
||||
|
||||
public Transform Camera;
|
||||
public Transform CameraHolder;
|
||||
|
||||
public float ToggleSpeed = 3;
|
||||
Vector3 StartPos;
|
||||
CharacterController controller;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Enable)
|
||||
{
|
||||
CheckMotion();
|
||||
ResetPosition();
|
||||
CameraHolder.LookAt(FocusTarget());
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
controller = GetComponent<CharacterController>();
|
||||
StartPos = Camera.localPosition;
|
||||
}
|
||||
|
||||
void PlayMotion(Vector3 motion)
|
||||
{
|
||||
Camera.localPosition += motion;
|
||||
}
|
||||
|
||||
void CheckMotion()
|
||||
{
|
||||
|
||||
if (controller.GetComponent<PlayerMovement>().PlayerState != PlayerMovement.CurrentState.Walk) return;
|
||||
if (!controller.isGrounded) return;
|
||||
PlayMotion(FootStepMotion());
|
||||
}
|
||||
|
||||
Vector3 FootStepMotion()
|
||||
{
|
||||
Vector3 pos = Vector3.zero;
|
||||
pos.y += Mathf.Sin(Time.time * Frequency) * Amplitude;
|
||||
pos.x += Mathf.Cos(Time.time * Frequency / 2) * Amplitude *2;
|
||||
return pos;
|
||||
}
|
||||
|
||||
void ResetPosition()
|
||||
{
|
||||
if (Camera.localPosition == StartPos) return;
|
||||
Camera.localPosition = Vector3.Lerp(Camera.localPosition, StartPos, Time.deltaTime);
|
||||
}
|
||||
|
||||
Vector3 FocusTarget()
|
||||
{
|
||||
Vector3 pos = new Vector3(transform.position.x, transform.position.y + CameraHolder.localPosition.y, transform.position.z);
|
||||
pos += CameraHolder.forward * 15;
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/general/player/CameraBob.cs.meta
Normal file
11
Assets/scripts/general/player/CameraBob.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36b966fd5829bfc4d929a3860d57ae12
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
Assets/scripts/general/player/CameraMovement.cs
Normal file
68
Assets/scripts/general/player/CameraMovement.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class CameraMovement : MonoBehaviour
|
||||
{
|
||||
[Header("Main")]
|
||||
public float MouseSens = 200f;
|
||||
float xRot;
|
||||
public GameObject PlayerBody;
|
||||
public int MaxCameraAngle = 80;
|
||||
|
||||
bool pause = false;
|
||||
void Start()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
float mouseX = Input.GetAxis("Mouse X") * MouseSens * Time.deltaTime;
|
||||
float mouseY = Input.GetAxis("Mouse Y") * MouseSens * Time.deltaTime;
|
||||
|
||||
xRot -= mouseY;
|
||||
xRot = Mathf.Clamp(xRot, -MaxCameraAngle, MaxCameraAngle);
|
||||
|
||||
transform.localRotation = Quaternion.Euler(xRot, 0, 0);
|
||||
PlayerBody.transform.Rotate(Vector3.up * mouseX);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyUp(KeyCode.Escape))
|
||||
{
|
||||
if (!pause)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Confined;
|
||||
pause = true;
|
||||
StartCoroutine("PauseGame");
|
||||
}
|
||||
else
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
pause = false;
|
||||
StartCoroutine("UnPauseGame");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator PauseGame()
|
||||
{
|
||||
SceneManager.LoadSceneAsync("pause", LoadSceneMode.Additive);
|
||||
Time.timeScale = 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
IEnumerator UnPauseGame()
|
||||
{
|
||||
SceneManager.UnloadSceneAsync("pause" );
|
||||
Time.timeScale = 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
11
Assets/scripts/general/player/CameraMovement.cs.meta
Normal file
11
Assets/scripts/general/player/CameraMovement.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0873a8b84bf4f9540b08db84d88253b8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
127
Assets/scripts/general/player/PlayerMovement.cs
Normal file
127
Assets/scripts/general/player/PlayerMovement.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PlayerMovement : MonoBehaviour
|
||||
{
|
||||
CharacterController PlayerController;
|
||||
|
||||
public float PlayerWalkSpeed = 5;
|
||||
public float PlayerRunSpeed = 7;
|
||||
public float CrouchWalkSpeed = 2;
|
||||
public GameObject PlayerCamera;
|
||||
public GameObject CameraHolder;
|
||||
Vector3 Velocity;
|
||||
[HideInInspector] public CurrentState PlayerState;
|
||||
public bool isCrouch;
|
||||
public float CrouchHeight = 0.4f;
|
||||
|
||||
float StartCameraPos;
|
||||
public float CrouchCameraHeight = 0.1f;
|
||||
|
||||
|
||||
public int stickCount = 0;
|
||||
|
||||
public Text TextStickCount;
|
||||
|
||||
public enum CurrentState
|
||||
{
|
||||
Idle = 0,
|
||||
Walk,
|
||||
Run,
|
||||
Crouch,
|
||||
CrouchWalk
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
PlayerController = GetComponent<CharacterController>();
|
||||
StartCameraPos = PlayerCamera.transform.localPosition.y;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
float xAxies = Input.GetAxis("Horizontal");
|
||||
float zAxies = Input.GetAxis("Vertical");
|
||||
|
||||
Vector3 move = transform.right * xAxies + transform.forward * zAxies;
|
||||
|
||||
if (isCrouch)
|
||||
{
|
||||
PlayerController.Move(move * CrouchWalkSpeed * Time.deltaTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerController.Move(move * PlayerWalkSpeed * Time.deltaTime);
|
||||
}
|
||||
|
||||
if(PlayerController.velocity.magnitude == 0)
|
||||
{
|
||||
if (!isCrouch)
|
||||
{
|
||||
PlayerState = CurrentState.Idle;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerState = CurrentState.Crouch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isCrouch)
|
||||
{
|
||||
PlayerState = CurrentState.Walk;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerState = CurrentState.CrouchWalk;
|
||||
}
|
||||
}
|
||||
//Debug.Log(PlayerState);
|
||||
|
||||
if (!PlayerController.isGrounded)
|
||||
{
|
||||
Velocity = Physics.gravity + Physics.gravity;
|
||||
PlayerController.Move(Physics.gravity * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
TextStickCount.text = stickCount.ToString();
|
||||
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.LeftShift))
|
||||
{
|
||||
if (isCrouch)
|
||||
{
|
||||
if (!Physics.Raycast(PlayerCamera.transform.position, Vector3.up, 1f))
|
||||
{
|
||||
PlayerCamera.transform.localPosition = new Vector3(0, StartCameraPos, 0);
|
||||
|
||||
PlayerController.height = 1.88f;
|
||||
isCrouch = false;
|
||||
PlayerState = CurrentState.Idle;
|
||||
PlayerController.Move(Vector3.up * Time.deltaTime * 10);
|
||||
//Debug.LogError("Now Not Crouch");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
PlayerCamera.transform.localPosition = new Vector3(0, CrouchCameraHeight, 0);
|
||||
PlayerController.height = CrouchHeight;
|
||||
isCrouch = true;
|
||||
PlayerState = CurrentState.Crouch;
|
||||
//Debug.LogError("Now Crouch");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/general/player/PlayerMovement.cs.meta
Normal file
11
Assets/scripts/general/player/PlayerMovement.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d959fe4ab337f274fa25daf28567a008
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
19
Assets/scripts/mainstick.cs
Normal file
19
Assets/scripts/mainstick.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class mainstick : MonoBehaviour
|
||||
{
|
||||
public fireplace Firething;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if(other.tag == "Player")
|
||||
{
|
||||
other.GetComponent<PlayerMovement>().stickCount += 1;
|
||||
GameObject.Destroy(gameObject);
|
||||
//Firething.dietime += 0.3f;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/mainstick.cs.meta
Normal file
11
Assets/scripts/mainstick.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ccd75cf9f56e1b4d90f6b066a2d036a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/scripts/menu.meta
Normal file
8
Assets/scripts/menu.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ffea339cd5b36642b19425f4ee77b42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
83
Assets/scripts/menu/GraphicSlider.cs
Normal file
83
Assets/scripts/menu/GraphicSlider.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
|
||||
public class GraphicSlider : MonoBehaviour
|
||||
{
|
||||
int GLevel = 2;
|
||||
|
||||
public Text Handle;
|
||||
|
||||
public RenderPipelineAsset[] DetailLevel;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (PlayerPrefs.HasKey("GraphicsLevel"))
|
||||
{
|
||||
GLevel = PlayerPrefs.GetInt("GraphicsLevel");
|
||||
GetComponent<Slider>().value = GLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetInt("GraphicsLevel", 2);
|
||||
|
||||
}
|
||||
|
||||
GetComponent<Slider>().value = GLevel;
|
||||
|
||||
switch (GLevel)
|
||||
{
|
||||
case 0:
|
||||
Handle.text = "low";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Handle.text = "medium";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Handle.text = "high";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Changed()
|
||||
{
|
||||
GLevel = ((int)GetComponent<Slider>().value);
|
||||
QualitySettings.SetQualityLevel(GLevel);
|
||||
QualitySettings.renderPipeline = DetailLevel[GLevel];
|
||||
Debug.Log(QualitySettings.renderPipeline.name);
|
||||
|
||||
PlayerPrefs.SetInt("GraphicsLevel", GLevel);
|
||||
PlayerPrefs.Save();
|
||||
|
||||
switch (GLevel)
|
||||
{
|
||||
case 0:
|
||||
Handle.text = "low";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Handle.text = "medium";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Handle.text = "high";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/scripts/menu/GraphicSlider.cs.meta
Normal file
11
Assets/scripts/menu/GraphicSlider.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c67f4094043b9cc42bd43000505af2b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
Assets/scripts/menu/exit.cs
Normal file
12
Assets/scripts/menu/exit.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class exit : MonoBehaviour
|
||||
{
|
||||
public void Exit()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/exit.cs.meta
Normal file
11
Assets/scripts/menu/exit.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53e6dc6fc43d5ce4e8f3cf98ea7b113b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/scripts/menu/leave.cs
Normal file
13
Assets/scripts/menu/leave.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class leave : MonoBehaviour
|
||||
{
|
||||
public string MenuName;
|
||||
public void <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>()
|
||||
{
|
||||
SceneManager.LoadScene(MenuName);
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/leave.cs.meta
Normal file
11
Assets/scripts/menu/leave.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fab3506914a16d4419984a1de5cdaa7f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/scripts/menu/play.cs
Normal file
18
Assets/scripts/menu/play.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class play : MonoBehaviour
|
||||
{
|
||||
|
||||
public void Load()
|
||||
{
|
||||
StartCoroutine("load");
|
||||
}
|
||||
|
||||
IEnumerable load()
|
||||
{
|
||||
SceneManager.LoadScene("game");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/play.cs.meta
Normal file
11
Assets/scripts/menu/play.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7129716d8ae09b4f918b647434e318c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/scripts/menu/settingsbutton.cs
Normal file
21
Assets/scripts/menu/settingsbutton.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class settingsbutton : MonoBehaviour
|
||||
{
|
||||
|
||||
public void Load()
|
||||
{
|
||||
|
||||
Time.timeScale = 1;
|
||||
StartCoroutine("load");
|
||||
}
|
||||
|
||||
IEnumerable load()
|
||||
{
|
||||
SceneManager.LoadSceneAsync("settings");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
Assets/scripts/menu/settingsbutton.cs.meta
Normal file
11
Assets/scripts/menu/settingsbutton.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6b33bc3874b38d408eee8287063a7f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user