Beispiel #1
0
        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);
        }
Beispiel #2
0
 public ChaseState(StatePatternEnemy statePatternEnemy)
 {
     enemy = statePatternEnemy;
 }
Beispiel #3
0
 public FightState(StatePatternEnemy statePatternEnemy)
 {
     enemy = statePatternEnemy;
 }
Beispiel #4
0
 /// <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;
 }
Beispiel #5
0
 /// <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;
 }