GameObject createCharacter() { GameObject characterGO = new GameObject(); characterGO.name = enemy_name; SpriteRenderer spriteRenderer = characterGO.AddComponent <SpriteRenderer> (); spriteRenderer.sprite = characterSprite; spriteRenderer.sortingOrder = 1; Animator animator = characterGO.AddComponent <Animator> (); animator.runtimeAnimatorController = animatorController; characterGO.AddComponent <BoxCollider2D>(); StatePatternEnemy enemyAI = characterGO.AddComponent <StatePatternEnemy> (); enemyAI.isHostile = isHostile; enemyAI.enemy_data = new Enemy(enemy_name, money, health, level, damage, isHostile); return(characterGO); }
public ChaseState(StatePatternEnemy statePatternEnemy) { enemy = statePatternEnemy; }
public FightState(StatePatternEnemy statePatternEnemy) { enemy = statePatternEnemy; }
/// <summary> /// Initializes a new instance of the <see cref="AssemblyCSharp.NaturalState"/> class. /// </summary> /// <param name="statePatternEnemy">State pattern enemy.</param> public NaturalState(StatePatternEnemy statePatternEnemy) { enemy = statePatternEnemy; }
/// <summary> /// Initializes a new instance of the <see cref="AssemblyCSharp.InteractState"/> class. /// </summary> /// <param name="statePatternEnemy">State pattern enemy.</param> public InteractState(StatePatternEnemy statePatternEnemy) { enemy = statePatternEnemy; }