Menu big update
A menu 90%-ának elkészítése a bolt és a bállítások nélkül
This commit is contained in:
94
Assets/Scripts/jatekmanager.cs
Normal file
94
Assets/Scripts/jatekmanager.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Sockets;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class jatekmanager : MonoBehaviour
|
||||
{
|
||||
public static jatekmanager Instance;
|
||||
public GameState State;
|
||||
public static event Action<GameState> OnGameStateChanged;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
UpdateGameState(GameState.Home);
|
||||
}
|
||||
|
||||
public void UpdateGameState(GameState newState)
|
||||
{
|
||||
State = newState;
|
||||
|
||||
switch (newState)
|
||||
{
|
||||
case GameState.Home:
|
||||
HandleHome();
|
||||
break;
|
||||
case GameState.Settings:
|
||||
HandleSettings();
|
||||
break;
|
||||
case GameState.Shop:
|
||||
HandleShop();
|
||||
break;
|
||||
case GameState.Game:
|
||||
HandleGame();
|
||||
break;
|
||||
case GameState.Meghaltal:
|
||||
HandleMeghaltal();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(newState), newState, null);
|
||||
}
|
||||
|
||||
OnGameStateChanged?.Invoke(newState);
|
||||
}
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
Home,
|
||||
Settings,
|
||||
Shop,
|
||||
Game,
|
||||
Meghaltal
|
||||
}
|
||||
|
||||
private async void HandleHome()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void HandleSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void HandleShop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void HandleGame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void HandleMeghaltal()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//application target frame rate
|
||||
}
|
||||
|
||||
|
||||
11
Assets/Scripts/jatekmanager.cs.meta
Normal file
11
Assets/Scripts/jatekmanager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a1faa9a1ba58437f92f33c86f8a89a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
25
Assets/Scripts/menumanager.cs
Normal file
25
Assets/Scripts/menumanager.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cinemachine;
|
||||
|
||||
public class menumanager : MonoBehaviour
|
||||
{
|
||||
public CinemachineVirtualCamera currentCamera;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
currentCamera.Priority++;
|
||||
}
|
||||
|
||||
public void UpdateCamera(CinemachineVirtualCamera target)
|
||||
{
|
||||
currentCamera.Priority--;
|
||||
|
||||
currentCamera = target;
|
||||
|
||||
currentCamera.Priority++;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/menumanager.cs.meta
Normal file
11
Assets/Scripts/menumanager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 785cdc4d6118041cf86784af33ad3476
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
44
Assets/Scripts/playbutton.cs
Normal file
44
Assets/Scripts/playbutton.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Cinemachine;
|
||||
|
||||
public class playbutton : MonoBehaviour
|
||||
{
|
||||
public CinemachineVirtualCamera currentCamera;
|
||||
public CinemachineTrackedDolly cinemachineTrackedDolly;
|
||||
public CinemachinePathBase.PositionUnits m_PositionUnits;
|
||||
|
||||
public CinemachineTrackedDolly dolly;
|
||||
|
||||
public CinemachineSmoothPath smoothPath;
|
||||
public CinemachinePath utvonal;
|
||||
public float pathPosition = 0.0f;
|
||||
public float speed = 0.2f;
|
||||
public float pathLength;
|
||||
public GameObject playButton;
|
||||
public Transform cameraTransform;
|
||||
public Vector3 cameraTransformOriginal;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//CinemachineVirtualCamera.GetComponent<CinemachineVirtualCamera>;
|
||||
pathPosition = 0.0f;
|
||||
cinemachineTrackedDolly = currentCamera.GetCinemachineComponent<CinemachineTrackedDolly>();
|
||||
pathLength = utvonal.MaxPos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void PlayButton()
|
||||
{
|
||||
playButton.SetActive(false);
|
||||
if (pathPosition < pathLength)
|
||||
{
|
||||
pathPosition += speed;
|
||||
cinemachineTrackedDolly.m_PathPosition = pathPosition;
|
||||
//smoothPath.m_PathPosition = pathPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/playbutton.cs.meta
Normal file
11
Assets/Scripts/playbutton.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87ae71cc7940e4650b0424d51e2b8e28
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user