예제 #1
0
        void    TargetInflictedDamage(NetworkConnection conn, float damage, float timeToDisplay, float velocity)
        {
            if (!this.isLocalPlayer)
            {
                return;
            }

            var msg = new OnScreenMessage();

            msg.text = damage.ToString();

            Vector2 dir = Random.insideUnitCircle;

            msg.screenPos = new Vector2(0.5f, 0.5f) + dir * Random.Range(0f, 0.2f);

            msg.velocity = dir * velocity;

            msg.timeLeft = timeToDisplay;

            msg.color           = this.color;
            msg.backgroundColor = this.backgroundColor;

            OnScreenMessageManager.AddMessage(msg);
        }
예제 #2
0
 public static void    RemoveMessage(OnScreenMessage msg)
 {
     m_onScreenMessages.Remove(msg);
 }
예제 #3
0
        public static void    AddMessage(OnScreenMessage msg)
        {
            m_onScreenMessages.Add(msg);

            onMessageAdded(msg);
        }