added audio folder and renamed C# Scripts to Scripts C#
hi
This commit is contained in:
19
Assets/Scripts C#/UI overlay/AttackCooldown.cs
Normal file
19
Assets/Scripts C#/UI overlay/AttackCooldown.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class AttackCooldown : MonoBehaviour
|
||||
{
|
||||
Teo player;
|
||||
UnityEngine.UI.Image bar;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>();
|
||||
bar = GetComponent<UnityEngine.UI.Image>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Mathf.Max(0, 100-100*(Time.fixedTime-player.lastAttackTime)/player.attackCooldownSeconds));
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts C#/UI overlay/AttackCooldown.cs.meta
Normal file
2
Assets/Scripts C#/UI overlay/AttackCooldown.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44c4f0b9443ce51e7bb9fbb5e2ee3e47
|
||||
26
Assets/Scripts C#/UI overlay/DistanceIndicator.cs
Normal file
26
Assets/Scripts C#/UI overlay/DistanceIndicator.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class DistanceIndicator : MonoBehaviour
|
||||
{
|
||||
public float multiplier;
|
||||
Teo player;
|
||||
SpriteRenderer sprite;
|
||||
float timeCreated;
|
||||
void Start() {
|
||||
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>();
|
||||
sprite = GetComponent<SpriteRenderer>();
|
||||
timeCreated = Time.fixedTime;
|
||||
transform.localScale = new Vector3 (player.swingDistance*multiplier, player.swingDistance*multiplier, 1);
|
||||
StartCoroutine("KillMyself");
|
||||
}
|
||||
|
||||
void Update() {
|
||||
sprite.color = new Color (0F, 0F, 0F, 0.5F-(Time.fixedTime-timeCreated));
|
||||
}
|
||||
|
||||
IEnumerator KillMyself() {
|
||||
yield return new WaitForSeconds (0.5F);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts C#/UI overlay/DistanceIndicator.cs.meta
Normal file
2
Assets/Scripts C#/UI overlay/DistanceIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23dc3f32eba4c9e5aad24589fdbfa30c
|
||||
17
Assets/Scripts C#/UI overlay/HealthIndicator.cs
Normal file
17
Assets/Scripts C#/UI overlay/HealthIndicator.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class HealthIndicator : MonoBehaviour
|
||||
{
|
||||
Teo player;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<TMPro.TMP_Text>().text = "Health: "+player.health+"/"+player.maxHealth;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts C#/UI overlay/HealthIndicator.cs.meta
Normal file
2
Assets/Scripts C#/UI overlay/HealthIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d13803709cc4d9259a92b5dc9f49fe05
|
||||
17
Assets/Scripts C#/UI overlay/WaveIndicator.cs
Normal file
17
Assets/Scripts C#/UI overlay/WaveIndicator.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WaveIndicator : MonoBehaviour
|
||||
{
|
||||
GameState gameState;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
gameState = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameState>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<TMPro.TMP_Text>().text = "Wave: "+gameState.wave;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts C#/UI overlay/WaveIndicator.cs.meta
Normal file
2
Assets/Scripts C#/UI overlay/WaveIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 718783a6a2d0457d590a9bbe51b7d5e4
|
||||
Reference in New Issue
Block a user