Completed course 2 adn 3, working on 4

This commit is contained in:
2026-03-20 17:34:22 +00:00
parent 623ad6f509
commit db966bab55
507 changed files with 67348 additions and 4667 deletions

View File

@@ -0,0 +1,49 @@
using UnityEngine;
using UnityEngine.UI;
public class UnitStateBubble : MonoBehaviour
{
public Image stateBubble;
public Sprite idleSprite;
public Sprite gatherSprite;
public Sprite attackSprite;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnStateChange(UnitState state)
{
stateBubble.enabled = true;
switch(state)
{
case UnitState.Idle:
{
stateBubble.sprite = idleSprite;
break;
}
case UnitState.Gather:
{
stateBubble.sprite = gatherSprite;
break;
}
case UnitState.Attack:
{
stateBubble.sprite = attackSprite;
break;
}
default:
{
stateBubble.enabled = false;
break;
}
}
}
}