public void Initialize() { SessionID = IDFactory.GenerateEntityID(); stats = new StatCollection(); stats.Initialize(statTemplate); SpriteRenderer = GetComponentInChildren <SpriteRenderer>(); MyAnimator = GetComponentInChildren <Animator>(); AbilityManager = GetComponent <AbilityManager>(); inventory = GetComponent <Inventory>(); movement = GetComponent <EntityMovement>(); healthDeathManager = GetComponent <HealthDeathManager>(); if (inventory != null) { inventory.Initialize(this); } if (AbilityManager != null) { AbilityManager.Initialize(this); } if (movement != null) { movement.Initialize(); } if (healthDeathManager != null) { healthDeathManager.Initialize(this); } AIBrain testBrain = GetComponent <AIBrain>(); if (testBrain != null) { testBrain.Initialize(); } GameManager.RegisterEntity(this); }
protected virtual void Awake() { SessionID = IDFactory.GenerateEntityID(); GameManager.RegisterEntity(this); }
private void Register() { EntityID = IDFactory.GenerateEntityID(); EntityManager.RegisterEntity(this); }