예제 #1
0
        private void Update()
        {
            //health reporting
            float currentHealthFraction = ActorController.Health / ActorController.MaxHealth;

            if (!Mathf.Approximately(currentHealthFraction, LastKnownHealth))
            {
                //signal health change
                if (EnableMessaging && EnableHealthUpdates && !DeathKnown)
                {
                    var message = new QdmsKeyValueMessage(new Dictionary <string, object>()
                    {
                        { "Target", GetTooltip() }, { "Health", currentHealthFraction }
                    }, "RpgBossHealthUpdate");
                    QdmsMessageBus.Instance.PushBroadcast(message);
                }
            }

            LastKnownHealth = currentHealthFraction;

            //death reporting
            if (LastKnownHealth <= 0 && !DeathKnown)
            {
                if (EnableMessaging)
                {
                    QdmsMessageBus.Instance.PushBroadcast(new QdmsKeyValueMessage("RpgBossDead", "Target", GetTooltip()));
                }

                DeathKnown = true;
            }
        }
예제 #2
0
        private void PushViewChangeMessage(PlayerViewType newView)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict["ViewType"] = newView;
            QdmsKeyValueMessage msg = new QdmsKeyValueMessage(dict, "PlayerChangeView");

            QdmsMessageBus.Instance.PushBroadcast(msg);
        }