Пример #1
0
        static Game()
        {
            Fragment        = Platform.CoreFragment?.GetGameFragment() ?? throw Platform.FragmentException();
            Fragment.Update = args => OnUpdate.SafeInvoke(args);

            NavMesh = new NavMesh(Fragment.GetNavMesh());
        }
Пример #2
0
 static void UpdateDevices(float deltaTime)
 {
     foreach (var device in devices)
     {
         device.Update(_currentTick, deltaTime);
     }
     OnUpdate.SafeInvoke(_currentTick, deltaTime);
 }
        private void Update()
        {
            if (!GameData.Instance || PlayerControl.LocalPlayer?.Data == null || KillButtonManager == null)
            {
                EndEffect(false);

                ApplyCooldown(0F);

                return;
            }

            if (KillButtonManager.transform.localPosition.x > 0F)
            {
                Vector3 vector = KillButtonManager.transform.localPosition;
                vector.x = (vector.x + 1.3F) * -1;

                vector += new Vector3(PositionOffset.x, PositionOffset.y);

                KillButtonManager.transform.localPosition = vector;
            }

            if (IsCoolingDown && (IsEffectActive || Visible && PlayerControl.LocalPlayer.CanMove))
            {
                CooldownTime -= Time.deltaTime;

                if (!IsCoolingDown)
                {
                    if (IsEffectActive)
                    {
                        EndEffect();
                    }
                    else
                    {
                        OnCooldownEnd?.SafeInvoke(this, EventArgs.Empty);
                    }
                }
            }

            if (HudVisible)
            {
                OnUpdate?.SafeInvoke(this, EventArgs.Empty);             // Implementing code can control visibility and appearance.
            }
            if (IsDisposed)
            {
                return;             // Dispose may be called during OnUpdate, resulting exceptions.
            }
            KillButtonManager.gameObject.SetActive(HudVisible && Visible);
            KillButtonManager.renderer.enabled  = HudVisible && Visible;
            KillButtonManager.TimerText.enabled = HudVisible && Visible && IsCoolingDown;

            KillButtonManager.renderer.color = IsCoolingDown || !Clickable ? Palette.DisabledColor : Palette.EnabledColor;

            //KillButtonManager.renderer.material.SetFloat("_Desat", 0F);
            KillButtonManager.renderer.material.SetFloat("_Desat", Clickable ? 0F : 1F);

            //KillButtonManager.SetCoolDown(Timer, MaxTimer);
            UpdateCooldown();
        }
Пример #4
0
        }                                                                                  //Guid.NewGuid().ToString()) { }

        public PointingSession(string id)
        {
            Id                = id;
            _topicStore       = new VotingTopicStore();
            _optionStore      = new ModelStore <PointingOption>();
            _participantStore = new ModelStore <Participant>();

            _topicStore.OnAdd          += t => OnUpdate?.SafeInvoke();
            _topicStore.OnUpdate       += t => OnUpdate?.SafeInvoke();
            _topicStore.OnDelete       += t => OnUpdate?.SafeInvoke();
            _optionStore.OnAdd         += t => OnUpdate?.SafeInvoke();
            _optionStore.OnUpdate      += t => OnUpdate?.SafeInvoke();
            _optionStore.OnDelete      += t => OnUpdate?.SafeInvoke();
            _participantStore.OnAdd    += t => OnUpdate?.SafeInvoke();
            _participantStore.OnUpdate += t => OnUpdate?.SafeInvoke();
            _participantStore.OnDelete += t => OnUpdate?.SafeInvoke();

            // Pre-poplate topics
            _topicStore.Add(new Topic("Default Story 1", "This is some discussion about the topic 1"));
            _topicStore.Add(new Topic("Default Story 2", "This is some discussion about the topic 2"));
            _topicStore.Add(new Topic("Default Story 3", "This is some discussion about the topic 3"));
            _topicStore.Add(new Topic("Default Story 4", "This is some discussion about the topic 4"));
            _topicStore.Add(new Topic("Default Story 5", "This is some discussion about the topic 5"));
            _topicStore.Add(new Topic("Default Story 6", "This is some discussion about the topic 6"));
            _topicStore.Add(new Topic("Default Story 7", "This is some discussion about the topic 7"));
            _topicStore.Add(new Topic("Default Story 8", "This is some discussion about the topic 8"));
            _topicStore.Add(new Topic("Default Story 9", "This is some discussion about the topic 9"));
            _topicStore.Add(new Topic("Default Story 10", "This is some discussion about the topic 10"));
            _topicStore.Add(new Topic("Default Story 11", "This is some discussion about the topic 11"));

            // Pre-populate options
            AddOption(new PointingOption("0 points", "0"));
            AddOption(new PointingOption("1 point", "1"));
            AddOption(new PointingOption("2 points", "2"));
            AddOption(new PointingOption("3 points", "3"));
            AddOption(new PointingOption("5 points", "5"));
            AddOption(new PointingOption("8 points", "8"));
            AddOption(new PointingOption("13 points", "13"));
            AddOption(new PointingOption("20 points", "20"));
            AddOption(new PointingOption("40 points", "40"));
            AddOption(new PointingOption("100 points", "100"));
        }
Пример #5
0
 private void Update()
 {
     OnUpdate.SafeInvoke();
 }