Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
menthy-wu committed Jan 15, 2023
1 parent a5d95ca commit 31c95dc
Show file tree
Hide file tree
Showing 12 changed files with 1,647 additions and 754 deletions.
383 changes: 93 additions & 290 deletions Fighter/Assets/Scenes/LevelSelection.unity

Large diffs are not rendered by default.

1,742 changes: 1,452 additions & 290 deletions Fighter/Assets/Scenes/MenuScene.unity

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Fighter/Assets/Scripts/GameStartButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ void Update() { }

public void onPress()
{
StartCoroutine(next());
}
IEnumerator next()
{
yield return new WaitForSeconds(1);
SceneManager.LoadScene(selectedScene);

}
}
35 changes: 7 additions & 28 deletions Fighter/Assets/Scripts/LevelButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,28 @@

public class LevelButton : MonoBehaviour
{

[SerializeField]
string stage;
GameObject StageDisplay;
bool selected;
public bool selected;
public GameObject otherbutton1;
public GameObject otherbutton2;

// Start is called before the first frame update
void Start()
{
StageDisplay = GameObject.Find("StageDisplay");
if (stage == "bell")
{
selected = true;
GetComponent<Image>().color = new Color(255, 255, 255, 255);
}
else
{
selected = false;
GetComponent<Image>().color = new Color(100, 100, 100, 255);
}
}

// Update is called once per frame
void Update()
{
}

public void onPress()
public void onPress(string stage)
{
StageDisplay.GetComponent<StageDisplay>().setStage(stage);
gameObject.GetComponent<Image>().color = new Color(255, 255, 255, 255);
otherbutton1.GetComponent<Image>().color = new Color(100, 100, 100, 255);
otherbutton2.GetComponent<Image>().color = new Color(100, 100, 100, 255);
}

public void setSelected(bool select)
{
selected = select;
if(select)
{

// GetComponent<Image>().color = new Color(255, 255, 255, 255);
}
else{

// GetComponent<Image>().color = new Color(100, 100, 100, 255);
}
}
}
23 changes: 23 additions & 0 deletions Fighter/Assets/Scripts/MainMenuButtons.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MainMenuButtons : MonoBehaviour
{
GameObject menuManager;
// Start is called before the first frame update
void Start()
{
menuManager = GameObject.Find("MenuManager");
}

// Update is called once per frame
void Update()
{

}
public void startGame()
{
menuManager.GetComponent<MenuManager>().changeScene();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions Fighter/Assets/Scripts/MenuManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MenuManager : MonoBehaviour
{
[SerializeField]
GameObject panel;
[SerializeField]
GameObject Credit;
[SerializeField]
GameObject Option;

// Start is called before the first frame update
void Start()
{
panel.SetActive(false);
}

void Update()
{

}
public void changeScene()
{
panel.SetActive(true);
StartCoroutine(next());
}
IEnumerator next()
{
yield return new WaitForSeconds(1);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
11 changes: 11 additions & 0 deletions Fighter/Assets/Scripts/MenuManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions Fighter/Assets/Scripts/StageDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,27 @@ void Update() { }

public void setStage(string stage)
{
Debug.Log(stage);
if (stage == "hub")
{
currentStage = "hub";
hub.SetActive(true);
src.SetActive(false);
bell.SetActive(false);
currentStage = "hub";
hubButton.GetComponent<LevelButton>().setSelected(true);
srcButton.GetComponent<LevelButton>().setSelected(false);
bellButton.GetComponent<LevelButton>().setSelected(false);
}
else if (stage == "src")
{
currentStage = "src";
src.SetActive(true);
hub.SetActive(false);
bell.SetActive(false);
currentStage = "src";
hubButton.GetComponent<LevelButton>().setSelected(false);
srcButton.GetComponent<LevelButton>().setSelected(true);
bellButton.GetComponent<LevelButton>().setSelected(false);
}
else if (stage == "bell")
{
bell.SetActive(true);
currentStage = "bell";
bell.SetActive(true);
src.SetActive(false);
hub.SetActive(false);
hubButton.GetComponent<LevelButton>().setSelected(false);
srcButton.GetComponent<LevelButton>().setSelected(false);
bellButton.GetComponent<LevelButton>().setSelected(false);
}
}
}
1 change: 0 additions & 1 deletion Fighter/Assets/Scripts/StageDisplay.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 0 additions & 126 deletions Fighter/Assets/Scripts/playerAnimation.cs

This file was deleted.

21 changes: 15 additions & 6 deletions Fighter/UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,35 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedSceneGuid-0:
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
value: 575455025056595f590d5d2043200b44454f1b2f782c71357e781b36b5b76c6b
flags: 0
RecentlyUsedSceneGuid-1:
value: 06545702520c0b0c540d0f7b47720e4445164e2b28787132747a4d66b0b76168
value: 01550d575c0c580f5f5e0d7b11220a44414f482b2e7874612f2a1935e0e2673c
flags: 0
RecentlyUsedSceneGuid-2:
value: 07050c5f03005b5f0b5b5e74127b5b4441154d2e2a7a2569297b4a6abab7663c
value: 0606020357500f0b09580a7b46205e44104f4a737f7171647e781e66e0e63261
flags: 0
RecentlyUsedSceneGuid-3:
value: 005052025d030d585a5b0d20437a5c4412161e79752e77667a2f4e62b1e13739
value: 5652575404070c035b0d0d7a137b0c4442164b7c7e7173627e7e4e6ae7b2306e
flags: 0
RecentlyUsedSceneGuid-4:
value: 0704040707565c5d090a547011700d44414f4d7e7f2c71617e7a4a65e3e6306a
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
flags: 0
RecentlyUsedSceneGuid-5:
value: 540702505d0d5a035f0d58731475064442164f2f7c2b7136797c4467bbb46468
value: 005052025d030d585a5b0d20437a5c4412161e79752e77667a2f4e62b1e13739
flags: 0
RecentlyUsedSceneGuid-6:
value: 0704040707565c5d090a547011700d44414f4d7e7f2c71617e7a4a65e3e6306a
flags: 0
RecentlyUsedSceneGuid-7:
value: 540702505d0d5a035f0d58731475064442164f2f7c2b7136797c4467bbb46468
flags: 0
RecentlyUsedSceneGuid-8:
value: 005307005d050c03550c5d70137a5b44124f4879282d77327b781b64b7b56061
flags: 0
RecentlyUsedSceneGuid-9:
value: 065307050706085d5f5d58241177074415151a29747023612b2f4c67e4e36039
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0
Expand Down

0 comments on commit 31c95dc

Please sign in to comment.