/// <summary> /// Sets new enemy type. /// </summary> /// <param name="dfUnity">DaggerfallUnity singleton. Required for content readers and settings.</param> /// <param name="enemyType">Enemy type.</param> public void SetEnemy(DaggerfallUnity dfUnity, MobileEnemy enemy, MobileReactions reaction) { // Initial enemy settings summary.Enemy = enemy; summary.EnemyState = MobileStates.Move; summary.Enemy.Reactions = reaction; // Load enemy content int archive = GetTextureArchive(); summary.CustomMaterial.isCustom = TextureReplacement.EnemyHasCustomMaterial(archive); CacheRecordSizesAndFrames(dfUnity, archive); AssignMeshAndMaterial(dfUnity, archive); // Apply enemy state and update orientation lastOrientation = -1; ApplyEnemyState(); // Raise setup flag summary.IsSetup = true; }