Add minion icon on selector bar
This commit is contained in:
parent
417bcd9485
commit
e470d5e918
@ -114,7 +114,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
m_Color: {r: 0, g: 0, b: 0, a: 0.5019608}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
@ -158,7 +158,7 @@ RectTransform:
|
|||||||
m_GameObject: {fileID: 1979632679604795357}
|
m_GameObject: {fileID: 1979632679604795357}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 2.5, y: 2.5, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1979632678310270258}
|
m_Father: {fileID: 1979632678310270258}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
@ -166,7 +166,7 @@ RectTransform:
|
|||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: -20, y: -20}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &1979632679604795352
|
--- !u!222 &1979632679604795352
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|||||||
@ -41,9 +41,11 @@ public class MinionBar : MonoBehaviour {
|
|||||||
|
|
||||||
public void AddMinionType(Entity newMinionPrefab) {
|
public void AddMinionType(Entity newMinionPrefab) {
|
||||||
minionTypes.Add(newMinionPrefab);
|
minionTypes.Add(newMinionPrefab);
|
||||||
MinionIcon newIcon = Instantiate(minionIconPrefab, transform).GetComponent<MinionIcon>();
|
MinionIcon newIcon = Instantiate(minionIconPrefab, transform)
|
||||||
|
.GetComponent<MinionIcon>();
|
||||||
minionIcons.Add(newIcon);
|
minionIcons.Add(newIcon);
|
||||||
// minionIcons[i].icon = minionTypes.icon; // TODO
|
newIcon.icon.sprite = newMinionPrefab.renderer.sprite;
|
||||||
|
newIcon.icon.preserveAspect = true;
|
||||||
newIcon.indexInMinionList = minionIcons.Count;
|
newIcon.indexInMinionList = minionIcons.Count;
|
||||||
if (currentIndex == minionIcons.Count - 1) {
|
if (currentIndex == minionIcons.Count - 1) {
|
||||||
newIcon.Select();
|
newIcon.Select();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user