コード例 #1
0
 public void OnDrag(PointerEventData eventData)
 {
     if (_startPoints.ContainsKey(eventData.pointerId))
     {
         var staminaUsage = _startPoints[eventData.pointerId].ReplacePointer(eventData);
         GameLogicManager.UseStamina(staminaUsage);
     }
 }
コード例 #2
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (_startPoints.Count < MaxTouchesCount && !_startPoints.ContainsKey(eventData.pointerId))
     {
         _startPoints.Add(eventData.pointerId, new TouchPoint(eventData.position));
         GameLogicManager.StopStaminaRecovery();
     }
 }
コード例 #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);
        }
コード例 #4
0
 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();
         }
     }
 }
コード例 #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);
        }