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); }
public static void RemoveMessage(OnScreenMessage msg) { m_onScreenMessages.Remove(msg); }
public static void AddMessage(OnScreenMessage msg) { m_onScreenMessages.Add(msg); onMessageAdded(msg); }