public AIAgent(EnemyController enemyController) { // Cache everything once and for all Logger = Debugger.Default.GetLogger(enemyController.gameObject.name + "/AI Log", unityLog: false); EnemyController = enemyController; Transform = enemyController.gameObject.transform; CharacterState = enemyController.GetComponent <CharacterState>(); Movement = enemyController.GetComponent <MovementController>(); AnimationController = enemyController.GetComponent <AnimationController>(); SpellBook = enemyController.GetComponent <SpellbookState>(); Config = CharacterState.character; }
void Awake() { #if DEBUG_COMBAT _combatLog = Debugger.Default.GetLogger(gameObject.name + "/StatLog", unityLog: false); #endif _baseScale = transform.localScale; IsAlive = true; _movement = GetComponent <MovementController>(); _spellBook = GetComponent <SpellbookState>(); _spellManager = SpellManager.Instance; _animationController = GetComponent <AnimationController>(); _hp = character.HealthModifier * MaxHealth; if (CurrentTeam == Team.Undefined) { Debug.LogError("Team not set!", this); } transform.localScale = _baseScale * Size; }