public void Destroy() { GameManager.ObjectSpawner.Destroy(actor); Inventory = null; actor = null; DestroyEvent?.Invoke(this); }
public void Init() { prefab = GameManager.Properties.characterActorPrefab; }
public GameCharacter(GameCharacterActor prefab) { Inventory = new Inventory(); actor = GameManager.ObjectSpawner.Spawn(prefab, Vector3.zero, Quaternion.identity); actor.Activate(this); }
private void Awake() { actor = GetComponent <GameCharacterActor>(); actor.ActivatedEvent += OnActorActivated; actor.DeactivatedEvent += OnActorDeactivated; }