예제 #1
0
 public void setHasEnemy(bool value)
 {
     hasEnemy = value;
     if (hasEnemy)
     {
         enemyManager = new EnemyTriggerManager();
     }
 }
예제 #2
0
        public EnemyColliderModel(EnemyView view1, EnemyTriggerManager manager)
        {
            view     = view1;
            name     = view.gameObject.name;
            collider = view.GetComponent <BoxCollider2D> ();

            _state   = CharacterStates.CREATE;
            _manager = manager;

            isPlayerTrigger  = false;
            triggerKeyBefore = null;
            triggerKeyAfter  = null;
        }
예제 #3
0
        public override void OnRegister()
        {
            _enemyModel   = gameModel.roomModel.getEnemyModelById(gameModel.createEnemyId);
            _startHp      = _enemyModel.hp;
            _hp           = _startHp;
            _damage       = _enemyModel.damage;
            _cooldown     = _enemyModel.cooldown;
            _expGive      = _enemyModel.exp_give;
            _enemyManager = gameModel.roomModel.enemyManager;
            _viewKey      = view.gameObject.name;

            _goldDrop = UnityEngine.Random.Range(_enemyModel.gold_drop_min, _enemyModel.gold_drop_max);

            view.init();
            view.moveSpeed = _enemyModel.speed;
            view.updateHp(_hp, _startHp);

            //_enemyManager.setState (_viewKey, CharacterStates.MOVE);

            UpdateListeners(true);
        }