コード例 #1
0
 public void Init(IMovementData movementData, IAttackHandler attackHandler, IDamageHanalder damageHanalder,
                  IDefenseHandler defenseHandler)
 {
     MovementData                     = movementData;
     AttackHandler                    = attackHandler;
     AttackHandler.OnAttack          += Attack;
     AttackHandler.PunchStateChange  += OnPunchStateChange;
     MovementData.OnDashStateChanged += DashStateChanged;
     MovementData.OnJump             += OnJump;
     MovementData.OnLand             += OnLand;
     DamageHanalder                   = damageHanalder;
     DamageHanalder.OnDamage         += OnPlayerHit;
     DefenseHandler                   = defenseHandler;
     DefenseHandler.DefenseStarted   += OnDefense;
 }
コード例 #2
0
        private void Awake()
        {
            _stats         = GetComponent <StatsBehaviour>();
            _attackInvoker = GetComponent <IAttackHandler>();
            _avoidTarget   = GetComponent <IDamagable>();
            _attackInvoker.OnAttackTrigger      += HandleAttack;
            _attackInvoker.OnAttackCancel       += AttackCancel;
            PlayerHealthBehaviour.OnPlayerDeath += () => _nextAttackTime = float.PositiveInfinity;

            if (!_projectilePool)
            {
                _projectilePool =
                    GameObject.FindGameObjectWithTag("EnemyProjectilesPool").GetComponent <ProjectilePool>();
            }

            foreach (Turret turret in GetComponentsInChildren <Turret>())
            {
                _turrets.Add(turret);
            }
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: eric7237cire/GeneticAlgo
        public Game(IContainer container, IGameMessages messages, IAttackHandler actionHandler, IRandomNumberGenerator randomNumberGenerator)
        {
            Container = container;
            this.GameMessages = messages;
            this._actionHandler = actionHandler;
            this._randomNumberGenerator = randomNumberGenerator;

            Interlocked.Increment(ref _counter);

            _gameId = _counter;
        }
コード例 #4
0
ファイル: BattleHandler.cs プロジェクト: BeresU/RoboDashGame
 public void Init(IDamageHanalder damageHanalder, IDefenseHandler defenseHandler, IAttackHandler attackHandler)
 {
     _damageHanalder = damageHanalder;
     _defenseHandler = defenseHandler;
     _attackHandler  = attackHandler;
 }