Первый коммит
This commit is contained in:
38
Assets/Scripts/StartMenu/ScriptMenuChangeNumberPlayers.cs
Normal file
38
Assets/Scripts/StartMenu/ScriptMenuChangeNumberPlayers.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScriptMenuChangeNumberPlayers : MonoBehaviour
|
||||
{
|
||||
private TextMeshProUGUI text;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
text = gameObject.GetComponentInChildren<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (GameSetting.OnePlayer)
|
||||
{
|
||||
text.text = "One Player";
|
||||
}
|
||||
else
|
||||
{
|
||||
text.text = "Two Player";
|
||||
}
|
||||
}
|
||||
|
||||
public void ChageNumberPlayersScript()
|
||||
{
|
||||
if (GameSetting.OnePlayer)
|
||||
{
|
||||
GameSetting.OnePlayer = false;
|
||||
text.text = "Two Player";
|
||||
}
|
||||
else
|
||||
{
|
||||
GameSetting.OnePlayer = true;
|
||||
text.text = "One Player";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6f64385e1cc12c41af39593bc7f68bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
38
Assets/Scripts/StartMenu/ScriptMenuChangeTime.cs
Normal file
38
Assets/Scripts/StartMenu/ScriptMenuChangeTime.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class ScriptMenuChangeTime : MonoBehaviour
|
||||
{
|
||||
private TextMeshProUGUI text;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
text = gameObject.GetComponentInChildren<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (GameSetting.isNight)
|
||||
{
|
||||
text.text = "Night";
|
||||
}
|
||||
else
|
||||
{
|
||||
text.text = "Day";
|
||||
}
|
||||
}
|
||||
|
||||
public void ChageNumberChangeTime()
|
||||
{
|
||||
if (GameSetting.isNight)
|
||||
{
|
||||
GameSetting.isNight = true;
|
||||
text.text = "Night";
|
||||
}
|
||||
else
|
||||
{
|
||||
GameSetting.isNight = false;
|
||||
text.text = "Day";
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/StartMenu/ScriptMenuChangeTime.cs.meta
Normal file
11
Assets/Scripts/StartMenu/ScriptMenuChangeTime.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e76c0215d817f7499896759a4f6c314
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Scripts/StartMenu/ScriptMenuExitGame.cs
Normal file
9
Assets/Scripts/StartMenu/ScriptMenuExitGame.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ScriptMenuExitGame : MonoBehaviour
|
||||
{
|
||||
public void Exit()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
11
Assets/Scripts/StartMenu/ScriptMenuExitGame.cs.meta
Normal file
11
Assets/Scripts/StartMenu/ScriptMenuExitGame.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5e27c6445fe31c44809d2e2ae894700
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Scripts/StartMenu/ScriptSelectMap.cs
Normal file
53
Assets/Scripts/StartMenu/ScriptSelectMap.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ScriptSelectMap : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Sprite [] images;
|
||||
private Image currentImage;
|
||||
private int maxNum;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
maxNum = images.Length;
|
||||
currentImage = gameObject.GetComponent<Image>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// todo
|
||||
// придумать как убрать -1
|
||||
ChangeMap();
|
||||
}
|
||||
|
||||
private void ChangeMap()
|
||||
{
|
||||
currentImage.sprite = images[GameSetting.SelectedMap - 1];
|
||||
}
|
||||
|
||||
public void ChangePlus()
|
||||
{
|
||||
if (GameSetting.SelectedMap == maxNum)
|
||||
{
|
||||
GameSetting.SelectedMap = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameSetting.SelectedMap++;
|
||||
}
|
||||
ChangeMap();
|
||||
}
|
||||
|
||||
public void ChangeMinus()
|
||||
{
|
||||
if (GameSetting.SelectedMap == 1)
|
||||
{
|
||||
GameSetting.SelectedMap = maxNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameSetting.SelectedMap--;
|
||||
}
|
||||
ChangeMap();
|
||||
}
|
||||
}
|
11
Assets/Scripts/StartMenu/ScriptSelectMap.cs.meta
Normal file
11
Assets/Scripts/StartMenu/ScriptSelectMap.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2a1ac716f6f76544b3ea66128b6e25b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user