Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Weminal-labs/Game
Browse files Browse the repository at this point in the history
  • Loading branch information
orp1205 committed May 31, 2024
2 parents b889f3f + a360024 commit 3dac26a
Show file tree
Hide file tree
Showing 354 changed files with 6,829 additions and 246 deletions.
17 changes: 17 additions & 0 deletions Assets/CautionAlert.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using UnityEngine;

public class CautionAlert : MonoBehaviour
{
public Transform box;
private void OnEnable()
{
box.localPosition = new Vector2(0, -Screen.height);
box.LeanMoveLocalY(0, 0.5f).setEaseOutExpo().delay = 0.1f;
}

private void OnDisable()
{
box.LeanMoveLocalY(-Screen.height, 0.5f).setEaseInExpo();

}
}
11 changes: 11 additions & 0 deletions Assets/CautionAlert.cs.meta

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

13 changes: 11 additions & 2 deletions Assets/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class GameController : MonoBehaviour
public int waveCount;
// Start is called before the first frame update

[SerializeField] GameObject spawnController, loadingScreen, loseScreen, winScreen;
[SerializeField] GameObject spawnController, loadingScreen, loseScreen, winScreen, cautionScreen;

public GameObject tutor;
public GameObject intro;
Expand Down Expand Up @@ -135,12 +135,13 @@ void Update()
}
else
{
if (waveCount == 5 && GameObject.FindGameObjectsWithTag("Enemy").Length == 0)
if (waveCount == 6 && GameObject.FindGameObjectsWithTag("Enemy").Length == 0)
{
winGame();
}
if (GameObject.FindGameObjectsWithTag("Enemy").Length == 0)
{

waveCount += 1;
wave.GetComponent<TextMeshProUGUI>().SetText("Wave: " + waveCount);
spawnEnemy.GetComponent<SpawnController>().SpawnEnemy(waveCount);
Expand All @@ -152,11 +153,19 @@ void Update()
}

time = 30.0f;
StartCoroutine(caution(2.0f));
}
}
}
}

IEnumerator caution(float waitTime)
{
cautionScreen.SetActive(true);
yield return new WaitForSeconds(waitTime);
cautionScreen.SetActive(false);
}

public void ReceiveAddress(string json)
{
Dictionary<string, string> jsonObject = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
Expand Down
9 changes: 9 additions & 0 deletions Assets/LeanTween/Examples/Archived.meta

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

30 changes: 30 additions & 0 deletions Assets/LeanTween/Examples/Archived/2dUnlitWithFade.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Shader "Custom/2dUnlitWithFade" {
Properties
{
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
}

Category
{
Lighting Off
ZWrite Off
//ZWrite On // uncomment if you have problems like the sprite disappear in some rotations.
Cull back
Blend SrcAlpha OneMinusSrcAlpha
//AlphaTest Greater 0.001 // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels.
Tags {Queue=Transparent}

SubShader
{
Pass
{
SetTexture [_MainTex]
{
ConstantColor [_Color]
Combine Texture * constant
}
}
}
}
}

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

Binary file added Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions Assets/LeanTween/Examples/Archived/GrumpyCat.jpeg.meta

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

84 changes: 84 additions & 0 deletions Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using UnityEngine;
using System.Collections;
using DentedPixel;

public class OldGUIExamplesCS : MonoBehaviour {
public Texture2D grumpy;
public Texture2D beauty;

private float w;
private float h;

private LTRect buttonRect1;
private LTRect buttonRect2;
private LTRect buttonRect3;
private LTRect buttonRect4;
private LTRect grumpyRect;
private LTRect beautyTileRect;


// Use this for initialization
void Start () {
w = Screen.width;
h = Screen.height;
buttonRect1 = new LTRect(0.10f*w, 0.8f*h, 0.2f*w, 0.14f*h );
buttonRect2 = new LTRect(1.2f*w, 0.8f*h, 0.2f*w, 0.14f*h );
buttonRect3 = new LTRect(0.35f*w, 0.0f*h, 0.3f*w, 0.2f*h, 0f );
buttonRect4 = new LTRect(0.0f*w, 0.4f*h, 0.3f*w, 0.2f*h, 1.0f, 15.0f );

grumpyRect = new LTRect(0.5f*w - grumpy.width*0.5f, 0.5f*h - grumpy.height*0.5f, grumpy.width, grumpy.height );
beautyTileRect = new LTRect(0.0f,0.0f,1.0f,1.0f );

LeanTween.move( buttonRect2, new Vector2(0.55f*w, buttonRect2.rect.y), 0.7f ).setEase(LeanTweenType.easeOutQuad);
}

public void catMoved(){
Debug.Log("cat moved...");
}

// Update is called once per frame
void OnGUI () {
GUI.DrawTexture( grumpyRect.rect, grumpy);

Rect staticRect = new Rect(0.0f*w, 0.0f*h, 0.2f*w, 0.14f*h);
if(GUI.Button( staticRect, "Move Cat")){
if(LeanTween.isTweening(grumpyRect)==false){ // Check to see if the cat is already tweening, so it doesn't freak out
Vector2 orig = new Vector2( grumpyRect.rect.x, grumpyRect.rect.y );
LeanTween.move( grumpyRect, new Vector2( 1.0f*Screen.width - grumpy.width, 0.0f*Screen.height ), 1.0f).setEase(LeanTweenType.easeOutBounce).setOnComplete(catMoved);
LeanTween.move( grumpyRect, orig, 1.0f ).setDelay(1.0f).setEase( LeanTweenType.easeOutBounce);
}
}

if(GUI.Button(buttonRect1.rect, "Scale Centered")){
LeanTween.scale( buttonRect1, new Vector2(buttonRect1.rect.width, buttonRect1.rect.height) * 1.2f, 0.25f ).setEase( LeanTweenType.easeOutQuad );
LeanTween.move( buttonRect1, new Vector2(buttonRect1.rect.x-buttonRect1.rect.width*0.1f, buttonRect1.rect.y-buttonRect1.rect.height*0.1f), 0.25f ).setEase(LeanTweenType.easeOutQuad);
}

if(GUI.Button(buttonRect2.rect, "Scale")){
LeanTween.scale( buttonRect2, new Vector2(buttonRect2.rect.width, buttonRect2.rect.height) * 1.2f, 0.25f ).setEase(LeanTweenType.easeOutBounce);
}

staticRect = new Rect(0.76f*w, 0.53f*h, 0.2f*w, 0.14f*h);
if(GUI.Button( staticRect, "Flip Tile")){
LeanTween.move( beautyTileRect, new Vector2( 0f, beautyTileRect.rect.y + 1.0f ), 1.0f ).setEase(LeanTweenType.easeOutBounce);
}

GUI.DrawTextureWithTexCoords( new Rect(0.8f*w, 0.5f*h - beauty.height*0.5f, beauty.width*0.5f, beauty.height*0.5f), beauty, beautyTileRect.rect);


if(GUI.Button(buttonRect3.rect, "Alpha")){
LeanTween.alpha( buttonRect3, 0.0f, 1.0f).setEase(LeanTweenType.easeOutQuad);
LeanTween.alpha( buttonRect3, 1.0f, 1.0f).setDelay(1.0f).setEase( LeanTweenType.easeInQuad);

LeanTween.alpha( grumpyRect, 0.0f, 1.0f).setEase(LeanTweenType.easeOutQuad);
LeanTween.alpha( grumpyRect, 1.0f, 1.0f).setDelay(1.0f).setEase(LeanTweenType.easeInQuad);
}
GUI.color = new Color(1.0f,1.0f,1.0f,1.0f); // Reset to normal alpha, otherwise other gui elements will be effected

if(GUI.Button(buttonRect4.rect, "Rotate")){
LeanTween.rotate( buttonRect4, 150.0f, 1.0f ).setEase(LeanTweenType.easeOutElastic);
LeanTween.rotate( buttonRect4, 0.0f, 1.0f ).setDelay(1.0f).setEase(LeanTweenType.easeOutElastic);
}
GUI.matrix = Matrix4x4.identity;
}
}
7 changes: 7 additions & 0 deletions Assets/LeanTween/Examples/Archived/OldGUIExamplesCS.cs.meta

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

Loading

0 comments on commit 3dac26a

Please sign in to comment.