public override void LateSetState() { ObjectsTimelineManager _t = GameManager.Instance.GetManager <ObjectsTimelineManager>(); if (_t != null) { if (_targetGlobalId > 0) { GameObject currentEnemy = _t.GetGameObjectByGlobalId(_targetGlobalId); _currentEnemyComponent = currentEnemy.GetComponent <GoblinBehaviour>(); } else { _currentEnemyComponent = null; } _enemies.Clear(); foreach (int id in _enemiesGlobalId) { GameObject enemy = _t.GetGameObjectByGlobalId(id); _enemies.Add(enemy.GetComponent <GoblinBehaviour>()); } } }
public override void LateSetState() { ObjectsTimelineManager _t = GameManager.Instance.GetManager<ObjectsTimelineManager>(); if (_t != null) { GameObject target = _t.GetGameObjectByGlobalId(_targetGlobalId); if (target != null) { _enemy = target.GetComponent<GoblinBehaviour>(); _targetTransform = target.transform; } } }