public void OnDrag(PointerEventData eventData)
 {
     if (_startPoints.ContainsKey(eventData.pointerId))
     {
         var staminaUsage = _startPoints[eventData.pointerId].ReplacePointer(eventData);
         GameLogicManager.UseStamina(staminaUsage);
     }
 }
 public void OnPointerDown(PointerEventData eventData)
 {
     if (_startPoints.Count < MaxTouchesCount && !_startPoints.ContainsKey(eventData.pointerId))
     {
         _startPoints.Add(eventData.pointerId, new TouchPoint(eventData.position));
         GameLogicManager.StopStaminaRecovery();
     }
 }
Exemple #3
0
        private void Spawn()
        {
            Enemy enemy;

            if (CurrentEnemyLevel < 1)
            {
                enemy = GetNextEnemy(0, 0).GetComponent <Enemy>();
            }
            else
            {
                enemy = GetNextEnemy(1, Enemies.Length).GetComponent <Enemy>();
            }
            GameLogicManager.RefreshHealthBar(enemy.MaxHealth, enemy.DisplayName);
        }
 public void OnPointerUp(PointerEventData eventData)
 {
     if (_startPoints.ContainsKey(eventData.pointerId))
     {
         var touch        = _startPoints[eventData.pointerId];
         var staminaUsage = touch.ReplacePointer(eventData);
         GameLogicManager.UseStamina(staminaUsage);
         touch.Dispose();
         _startPoints.Remove(eventData.pointerId);
         if (_startPoints.Count == 0)
         {
             GameLogicManager.StartStaminaRecovery();
         }
     }
 }
Exemple #5
0
        private GameObject CreateEnemy(int enemyNumber)
        {
            var tmp = CurrentEnemyLevel;

            CurrentEnemyLevel = GetCurrentLevel();
            if (CurrentEnemyLevel > tmp)
            {
                while (tmp <= CurrentEnemyLevel)
                {
                    GameLogicManager.RandomLevelUp();
                    tmp++;
                }
            }
            var enemy = Instantiate(Enemies[enemyNumber], GameLogicManager.GetEnemyLayer());

            CurrentEnemyName = enemy.GetComponent <Enemy>().DisplayName;
            LevelUp(enemy.GetComponent <Enemy>());
            return(enemy);
        }