party #15
13
Assets/Prefabs/Hero.prefab
generated
13
Assets/Prefabs/Hero.prefab
generated
@ -31,7 +31,7 @@ Transform:
|
||||
m_Children:
|
||||
- {fileID: 4157508313357080045}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &7347972816793018538
|
||||
MonoBehaviour:
|
||||
@ -45,11 +45,12 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 583304b24f3e6394f9e4d49747e22193, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Name:
|
||||
Class: {fileID: 0}
|
||||
Level: 0
|
||||
XP: 0
|
||||
Attrs: {fileID: 0}
|
||||
name:
|
||||
class_: {fileID: 0}
|
||||
level: 0
|
||||
xp: 0
|
||||
attrs: {fileID: 0}
|
||||
party: {fileID: 11400000, guid: c9a46588e6ec04d4d91bb80fdffd7869, type: 2}
|
||||
--- !u!1 &4632618406133265053
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -13,4 +13,16 @@ public class HeroUnit : MonoBehaviour
|
||||
[SerializeField] private long level;
|
||||
[SerializeField] private long xp;
|
||||
[SerializeField] private HeroAttributesSO attrs;
|
||||
[SerializeField] private HeroPartySO party;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// NOTE(zeph): Party is mandatory. If none is set, we want an exception.
|
||||
party.Add(this);
|
||||
}
|
||||
|
||||
zephyr marked this conversation as resolved
|
||||
private void OnDisable()
|
||||
{
|
||||
party.Remove(this);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
I think its clearer to make these types of notes into assertions.
Assert.IsNotNull(party)
or something like it.