Пример #1
0
 public Engine()
 {
     _timerTracker        = new TimerTracker();
     _nodeCreationService = new NodeCreationService(_timerTracker);
     _calculator          = new StatisticsCalculator();
     _CSVWriteService     = new CSVWriteService();
 }
Пример #2
0
        private void Awake()
        {
            blockMovementTimerID = gameObject.GetInstanceID() + "Block Movement Timer";
            TimerTracker.AddTimer(blockMovementTimerID, 0f, null, null);
            deactivateColliderTimerID = gameObject.GetInstanceID() + "Deactivate Collider Timer";
            TimerTracker.AddTimer(deactivateColliderTimerID, 0f, () => EnableCollider = true, null);

            FaceDirection(initialFacingDirection);
        }
    public Run()
    {
        var nextSecond   = MilliUntilNextSecond();
        var timerTracker = new TimerTracker()
        {
            StartDate = DateTime.Now.AddMilliseconds(nextSecond),
            Interval  = 1000,
            Number    = 0
        };

        timer = new Timer(TimerCallback, timerTracker, nextSecond, -1);
    }
Пример #4
0
    protected override void Awake()
    {
        base.Awake();
        itemUseCooldownTimerID = gameObject.GetInstanceID() + "Item Use Cooldown Timer";
        TimerTracker.AddTimer(itemUseCooldownTimerID, 0f, null, null);
        shieldComponent?.SetToUpperLimit();
        if (!inventories.Contains(DefaultInventory))
        {
            inventories.Add(DefaultInventory);
        }

        SteamPunkConsole.GetCommandsFromType(GetType());
    }
Пример #5
0
        private void Awake()
        {
            Follow.PhysicsController.CanMove = false;
            float angle      = Random.value * 360f;
            float startSpeed = Random.Range(minStartSpeed, maxStartSpeed);

            Follow.PhysicsController.SetVelocity(
                angle.DegreeAngleToVector2() * startSpeed);
            idleWaitTimerID = "Idle Wait Timer" + gameObject.GetInstanceID();
            TimerTracker.AddTimer(idleWaitTimerID, 0f, StartFollowing, null);
            pickupTrail = Instantiate(pickupTrailPrefab, transform.position,
                                      Quaternion.identity, ParticleGenerator.holder);
            pickupTrail.SetTarget(transform);
            Color col = Color.white;

            pickupTrail.SetColor(col);
            pickupGlow.color = col;
        }
Пример #6
0
        private void Update()
        {
            if (IsWaiting)
            {
                return;
            }

            if (following)
            {
                Follow.TriggerUpdate();
            }
            else
            {
                Vector3 velocity = Follow.PhysicsController.CurrentVelocity;
                if (velocity == Vector3.zero)
                {
                    TimerTracker.SetTimer(idleWaitTimerID, idleWaitDuration);
                }
            }
        }
Пример #7
0
    protected bool UseItem(Item.Type type)
    {
        bool used       = false;
        int  amountUsed = 0;

        switch (type)
        {
        default: break;

        case Item.Type.RepairKit:
            used       = true;
            amountUsed = 1;
            break;
        }
        if (used)
        {
            TimerTracker.SetTimer(itemUseCooldownTimerID, itemUseCooldownDuration);
            OnItemUsed?.Invoke(type, amountUsed);
        }
        return(used);
    }
Пример #8
0
        public void Activate()
        {
            if (isActivated || ignore)
            {
                return;
            }
            if (!isRepeatable && activationCount > 0)
            {
                return;
            }

            if (isTimedPrompt)
            {
                PR.PromptSendRequest(text, text);
                TimerTracker.SetTimer(text, promptDuration);
                TimerTracker.SetFinishAction(text, Deactivate);
            }
            else
            {
                PR.PromptSendRequest(text, text);
            }
            SetIsActivated(true);
            activationCount++;
        }
Пример #9
0
 private void Awake()
 {
     blockMovementTimerID = gameObject.GetInstanceID() + "Block Movement Timer";
     TimerTracker.AddTimer(blockMovementTimerID, 0f, null, null);
 }