Fixed a few things

This commit is contained in:
Hazim Bin Ijaz 2025-08-22 22:16:14 +05:00
parent 204d25f657
commit 729a71ea98
12 changed files with 273 additions and 156 deletions

View File

@ -7155,6 +7155,37 @@ Transform:
type: 3} type: 3}
m_PrefabInstance: {fileID: 57128978} m_PrefabInstance: {fileID: 57128978}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &57565335
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 57565336}
m_Layer: 0
m_Name: ObjectiveManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &57565336
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 57565335}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 76956767}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &57868294 --- !u!1001 &57868294
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -7858,12 +7889,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 59673816} m_GameObject: {fileID: 59673816}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 141.0367, y: 26.4137, z: 389.6348} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 17.00827, y: 2.3127, z: 15.96308} m_LocalScale: {x: 17.00827, y: 2.3127, z: 15.96308}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 538603973}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &59673823 --- !u!114 &59673823
MonoBehaviour: MonoBehaviour:
@ -7890,7 +7921,7 @@ MonoBehaviour:
isInteractable: 1 isInteractable: 1
InfoItem: Info Icon here InfoItem: Info Icon here
OffScreen: 1 OffScreen: 1
DestroyWithObject: 0 DestroyWithObject: 1
BorderOffScreen: 0.01 BorderOffScreen: 0.01
OffScreenSize: 10 OffScreenSize: 10
isHoofdPunt: 0 isHoofdPunt: 0
@ -10001,6 +10032,40 @@ Transform:
type: 3} type: 3}
m_PrefabInstance: {fileID: 76708262} m_PrefabInstance: {fileID: 76708262}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &76956766
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 76956767}
m_Layer: 0
m_Name: Managers
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &76956767
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 76956766}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 127.89, y: 27.502998, z: 358.25}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1308217107}
- {fileID: 1755519505}
- {fileID: 57565336}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &79767207 --- !u!1001 &79767207
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -74617,7 +74682,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 481936153} - component: {fileID: 481936153}
m_Layer: 0 m_Layer: 0
m_Name: Enemies m_Name: EnemiesParent
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -82365,6 +82430,39 @@ Transform:
type: 3} type: 3}
m_PrefabInstance: {fileID: 534081122} m_PrefabInstance: {fileID: 534081122}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &538603972
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 538603973}
m_Layer: 0
m_Name: Level 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &538603973
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 538603972}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 141.0367, y: 26.4137, z: 389.6348}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 59673822}
- {fileID: 1078692958}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &538763307 --- !u!1001 &538763307
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -140350,6 +140448,10 @@ PrefabInstance:
propertyPath: m_Target propertyPath: m_Target
value: value:
objectReference: {fileID: 2042403783257441061} objectReference: {fileID: 2042403783257441061}
- target: {fileID: 11494328, guid: 3645d6c7c45caab4f9b35b7092836a7d, type: 3}
propertyPath: ToogleKey
value: 9
objectReference: {fileID: 0}
- target: {fileID: 11494328, guid: 3645d6c7c45caab4f9b35b7092836a7d, type: 3} - target: {fileID: 11494328, guid: 3645d6c7c45caab4f9b35b7092836a7d, type: 3}
propertyPath: MiniMapLayer propertyPath: MiniMapLayer
value: 6 value: 6
@ -168696,13 +168798,13 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1078692956} m_GameObject: {fileID: 1078692956}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 141.0367, y: 26.4137, z: 389.6348} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 481936153} - {fileID: 481936153}
m_Father: {fileID: 0} m_Father: {fileID: 538603973}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1078692959 --- !u!114 &1078692959
MonoBehaviour: MonoBehaviour:
@ -189842,130 +189944,6 @@ Mesh:
offset: 0 offset: 0
size: 0 size: 0
path: path:
--- !u!1001 &1226853934
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1660212776}
m_Modifications:
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_SizeDelta.x
value: 120
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_SizeDelta.y
value: 157.6877
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8450869184831564982, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
propertyPath: m_Name
value: AbilityUIItem (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d208e0f3e2f10a440a15e9b095c4a0e8, type: 3}
--- !u!224 &1226853935 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4918938079055515515, guid: d208e0f3e2f10a440a15e9b095c4a0e8,
type: 3}
m_PrefabInstance: {fileID: 1226853934}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1227270387 --- !u!1001 &1227270387
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -205520,12 +205498,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1308217105} m_GameObject: {fileID: 1308217105}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 164.4, y: 19.60253, z: 322.1} m_LocalPosition: {x: 36.509995, y: -7.900469, z: -36.149994}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 76956767}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1308645757 --- !u!1001 &1308645757
PrefabInstance: PrefabInstance:
@ -264457,7 +264435,6 @@ RectTransform:
- {fileID: 3533359467842034142} - {fileID: 3533359467842034142}
- {fileID: 1019458778} - {fileID: 1019458778}
- {fileID: 1136520939} - {fileID: 1136520939}
- {fileID: 1226853935}
m_Father: {fileID: 94165390} m_Father: {fileID: 94165390}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
@ -264482,7 +264459,7 @@ MonoBehaviour:
m_Right: 0 m_Right: 0
m_Top: 0 m_Top: 0
m_Bottom: 0 m_Bottom: 0
m_ChildAlignment: 3 m_ChildAlignment: 4
m_Spacing: 77.89 m_Spacing: 77.89
m_ChildForceExpandWidth: 0 m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0 m_ChildForceExpandHeight: 0
@ -294177,12 +294154,12 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1755519503} m_GameObject: {fileID: 1755519503}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 141.0367, y: 26.4137, z: 389.6348} m_LocalPosition: {x: 13.146698, y: -1.0892982, z: 31.384796}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 76956767}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1756934197 --- !u!1001 &1756934197
PrefabInstance: PrefabInstance:
@ -355441,9 +355418,6 @@ MonoBehaviour:
- ability: {fileID: 11400000, guid: 036f9184f5c4730488f8cf0f55598b5d, type: 2} - ability: {fileID: 11400000, guid: 036f9184f5c4730488f8cf0f55598b5d, type: 2}
abilityUiItem: {fileID: 2090201445} abilityUiItem: {fileID: 2090201445}
cdTimer: 0 cdTimer: 0
- ability: {fileID: 0}
abilityUiItem: {fileID: 0}
cdTimer: 0
--- !u!1001 &2612565535725099600 --- !u!1001 &2612565535725099600
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -356583,11 +356557,9 @@ SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_Roots: m_Roots:
- {fileID: 1161484236} - {fileID: 1161484236}
- {fileID: 2042403783257441060} - {fileID: 897625917}
- {fileID: 812152301} - {fileID: 812152301}
- {fileID: 1282845313} - {fileID: 1282845313}
- {fileID: 1308217107} - {fileID: 538603973}
- {fileID: 1078692958} - {fileID: 76956767}
- {fileID: 59673822} - {fileID: 2042403783257441060}
- {fileID: 1755519505}
- {fileID: 897625917}

View File

@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Channel Heal Ability m_Name: Channel Heal Ability
m_EditorClassIdentifier: m_EditorClassIdentifier:
displayName: Channel Heal displayName: Channel Heal
key: E
icon: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} icon: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
manaCost: 10 manaCost: 10
cooldown: 2 cooldown: 2

View File

@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Fireball Ability m_Name: Fireball Ability
m_EditorClassIdentifier: m_EditorClassIdentifier:
displayName: Fireball displayName: Fireball
key: Q
icon: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} icon: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
manaCost: 5 manaCost: 5
cooldown: 2 cooldown: 2

View File

@ -13,6 +13,7 @@ MonoBehaviour:
m_Name: Freeze Shard Ability m_Name: Freeze Shard Ability
m_EditorClassIdentifier: m_EditorClassIdentifier:
displayName: Freeze Shard displayName: Freeze Shard
key: R
icon: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} icon: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0}
manaCost: 10 manaCost: 10
cooldown: 2 cooldown: 2

View File

@ -4,6 +4,7 @@ public abstract class Ability : ScriptableObject
{ {
[Header("Meta")] [Header("Meta")]
public string displayName = "Ability"; public string displayName = "Ability";
public string key = "";
public Sprite icon; public Sprite icon;
[Header("Cost & Cooldown")] [Header("Cost & Cooldown")]

View File

@ -44,6 +44,9 @@ public class LevelStartTrigger : MonoBehaviour
} }
} }
if (oneShot) gameObject.SetActive(false); if (oneShot)
{
gameObject.SetActive(false);
}
} }
} }

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b753d8c903a3aa449bf601c2ef7de570
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,95 @@
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class ObjectiveManager : MonoBehaviour
{
[System.Serializable]
public class Objective
{
[TextArea] public string text;
public bool completed;
}
public static ObjectiveManager Instance { get; private set; }
[Header("UI")]
public TextMeshProUGUI objectiveText; // Assign a TMP Text in Canvas
[Tooltip("Prefix/suffix for visual flair")]
public string prefix = "Objective: ";
public string completedPrefix = "✔ ";
public string incompletePrefix = "• ";
[Header("Data")]
public List<Objective> objectives = new List<Objective>();
public int activeIndex = 0; // Which objective is currently shown
public bool autoAdvanceOnComplete = true;
void Awake()
{
if (Instance != null && Instance != this) { Destroy(gameObject); return; }
Instance = this;
}
void Start() => RefreshUI();
// ----- Public API -----
public void SetSingle(string text)
{
objectives.Clear();
objectives.Add(new Objective { text = text, completed = false });
activeIndex = 0;
RefreshUI();
}
public void SetList(IEnumerable<string> list, int startIndex = 0)
{
objectives.Clear();
foreach (var s in list) objectives.Add(new Objective { text = s, completed = false });
activeIndex = Mathf.Clamp(startIndex, 0, Mathf.Max(0, objectives.Count - 1));
RefreshUI();
}
public void SetActive(int index)
{
activeIndex = Mathf.Clamp(index, 0, Mathf.Max(0, objectives.Count - 1));
RefreshUI();
}
public void MarkComplete(int index)
{
if (index < 0 || index >= objectives.Count) return;
objectives[index].completed = true;
if (autoAdvanceOnComplete && index == activeIndex)
Advance();
RefreshUI();
}
public void Advance()
{
// Jump to next incomplete objective if any
for (int i = activeIndex + 1; i < objectives.Count; i++)
{
if (!objectives[i].completed) { activeIndex = i; RefreshUI(); return; }
}
// Nothing left → keep last shown as completed
RefreshUI();
}
public void RefreshUI()
{
if (objectiveText == null) return;
if (objectives.Count == 0)
{
objectiveText.text = "";
return;
}
var o = objectives[Mathf.Clamp(activeIndex, 0, objectives.Count - 1)];
var statePrefix = o.completed ? completedPrefix : incompletePrefix;
objectiveText.text = prefix + statePrefix + o.text;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56157be1953f02648967607499db7db9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,6 +14,6 @@ public class AbilityUIItem : MonoBehaviour
{ {
this.abilityIcon.sprite = ability.icon; this.abilityIcon.sprite = ability.icon;
this.abilityName.text = ability.displayName; this.abilityName.text = ability.displayName;
this.abilityKeyText = abilityKeyText; this.abilityKeyText.text = ability.key;
} }
} }

View File

@ -1,4 +1,5 @@
using UnityEngine; using System;
using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections; using System.Collections;
using UGUIMiniMap; using UGUIMiniMap;
@ -50,10 +51,7 @@ public class bl_MiniMapItem : MonoBehaviour {
private Vector3 position; private Vector3 position;
private bl_MiniMap MiniMap; private bl_MiniMap MiniMap;
/// <summary> private void OnEnable()
/// Get all required component in start
/// </summary>
void Start()
{ {
MiniMap = bl_MiniMapUtils.GetMiniMap(); MiniMap = bl_MiniMapUtils.GetMiniMap();
if (bl_MiniMap.MapUIRoot != null) if (bl_MiniMap.MapUIRoot != null)
@ -63,6 +61,19 @@ public class bl_MiniMapItem : MonoBehaviour {
else { Debug.Log("You need a MiniMap in scene for use MiniMap Items."); } else { Debug.Log("You need a MiniMap in scene for use MiniMap Items."); }
} }
/// <summary>
/// Get all required component in start
/// </summary>
void Start()
{
// MiniMap = bl_MiniMapUtils.GetMiniMap();
// if (bl_MiniMap.MapUIRoot != null)
// {
// CreateIcon();
// }
// else { Debug.Log("You need a MiniMap in scene for use MiniMap Items."); }
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -213,6 +224,11 @@ public class bl_MiniMapItem : MonoBehaviour {
} }
} }
private void OnDisable()
{
DestroyItem(true);
}
/// <summary> /// <summary>
/// When player or the target die,desactive,remove,etc.. /// When player or the target die,desactive,remove,etc..
/// call this for remove the item UI from Map /// call this for remove the item UI from Map

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4426f62d3607eb94e890a5c22ab547b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: