protected override void InitControl(Entities.ISceneObject me) { this.obj = me.GetControlOfType <IHpControl>(); if (this.obj == null) { throw new Exception("HpBarControl must be attached to object containing HpControl"); } }
public static void WriteHealthControl(this NetOutgoingMessage msg, IHpControl c) { msg.WriteControl(c as Control); msg.Write(c.Hp); msg.Write(c.MaxHp); }
protected override void InitControl(ISceneObject me) { hpControl = me.GetControlOfType <IHpControl>(); }
public static void ReadHealthControl(this NetIncomingMessage msg, IHpControl c) { msg.ReadControl(c as Control); c.Hp = msg.ReadInt32(); c.MaxHp = msg.ReadInt32(); }