Commit 06ad0ac6 authored by Isa's avatar Isa
Browse files

HUD Design-Update

parent af1096a5
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_3.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
Assets/_Game/Graphics/Sprite/HUD/wasser_3.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_4.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
Assets/_Game/Graphics/Sprite/HUD/wasser_4.png
  • 2-up
  • Swipe
  • Onion skin
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_5.png

130 Bytes | W: | H:

Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
Assets/_Game/Graphics/Sprite/HUD/wasser_5.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -12287,19 +12287,6 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114817957, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: m_Name
value: Anzeige
objectReference: {fileID: 0}
- target: {fileID: 388107567, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: ElementBox
value:
objectReference: {fileID: 0}
- target: {fileID: 388107565, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 21300000, guid: 706d34e52b620a34abdffce7a27726a1,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 50a0ddec8ac259c46a58a6b5324a759d, type: 3}
--- !u!1 &1046025670
......
......@@ -8,52 +8,76 @@ public class ElementAnzeige : MonoBehaviour
{
[SerializeField] private PlayerState state;
public Sprite empty;
public GameObject ElementBox;
public Sprite[] FeuerSprites;
public Sprite[] ErdeSprites;
public Sprite[] LuftSprites;
public Sprite[] WasserSprites;
public Sprite[] currentSprites;
public int availableCount = 0;
public Sprite[] feuerSprites;
public Sprite[] erdeSprites;
public Sprite[] luftSprites;
public Sprite[] wasserSprites;
private Sprite[] currentSprites;
private int availableCount = 0;
public GameObject[] textBox;
public void UpdateFeuerAnzeige()
{
currentSprites = FeuerSprites;
currentSprites = feuerSprites;
}
public void UpdateErdeAnzeige()
{
currentSprites = ErdeSprites;
currentSprites = erdeSprites;
}
public void UpdateWasserAnzeige()
{
currentSprites = WasserSprites;
currentSprites = wasserSprites;
}
public void UpdateLuftAnzeige()
{
currentSprites = LuftSprites;
currentSprites = luftSprites;
}
public void GetRemainingCharges()
{
availableCount = state.GetCharges();
Debug.Log(availableCount);
switch (availableCount)
{
case 5: ElementBox.GetComponent<Image>().sprite = currentSprites[4];
case 5: GetComponent<Image>().sprite = currentSprites[4];
break;
case 4: ElementBox.GetComponent<Image>().sprite = currentSprites[3];
case 4: GetComponent<Image>().sprite = currentSprites[3];
break;
case 3: ElementBox.GetComponent<Image>().sprite = currentSprites[2];
case 3: GetComponent<Image>().sprite = currentSprites[2];
break;
case 2: ElementBox.GetComponent<Image>().sprite = currentSprites[1];
case 2: GetComponent<Image>().sprite = currentSprites[1];
break;
case 1: ElementBox.GetComponent<Image>().sprite = currentSprites[0];
case 1: GetComponent<Image>().sprite = currentSprites[0];
break;
case 0: ElementBox.GetComponent<Image>().sprite = empty;
case 0: GetComponent<Image>().sprite = empty;
break;
}
}
public void ShowTextBox()
{
if (currentSprites == feuerSprites)
{
textBox[0].SetActive(true);
} else if (currentSprites == erdeSprites)
{
textBox[1].SetActive(true);
} else if (currentSprites == wasserSprites)
{
textBox[2].SetActive(true);
} else if (currentSprites == luftSprites)
{
textBox[3].SetActive(true);
}
}
public void HideTextBox()
{
textBox[0].SetActive(false);
textBox[1].SetActive(false);
textBox[2].SetActive(false);
textBox[3].SetActive(false);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using _Game.Scripts.Scriptable_Object;
public class FaehigkeitenBox : MonoBehaviour
{
[SerializeField] private PlayerState state;
private Image BoxImg;
public Sprite[] Boxen;
public GameObject[] TextBox;
// Start is called before the first frame update
void Start()
{
BoxImg = GetComponent<Image>();
}
// Update is called once per frame
void Update()
{
}
public void SetFeuerBox()
{
BoxImg.sprite = Boxen[1];
}
public void SetErdeBox()
{
BoxImg.sprite = Boxen[2];
}
public void SetWasserBox()
{
BoxImg.sprite = Boxen[3];
}
public void SetLuftBox()
{
BoxImg.sprite = Boxen[4];
}
public void ResetBox()
{
BoxImg.sprite = Boxen[0];
}
public void CheckCharges()
{
if (state.GetCharges() == 0)
{
ResetBox();
}
}
public void ShowTextBox()
{
TextBox[0].SetActive(true);
if (BoxImg.sprite == Boxen[1])
{
TextBox[0].SetActive(true);
} else if (BoxImg.sprite == Boxen[2])
{
TextBox[1].SetActive(true);
} else if (BoxImg.sprite == Boxen[3])
{
TextBox[2].SetActive(true);
} else if (BoxImg.sprite == Boxen[4])
{
TextBox[3].SetActive(true);
}
}
public void HideTextBox()
{
TextBox[0].SetActive(false);
TextBox[1].SetActive(false);
TextBox[2].SetActive(false);
TextBox[3].SetActive(false);
}
}
fileFormatVersion: 2
guid: 58d10beda6ed0de4a8aaf25af9976ee9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment