public static Chesser Create(Entity domain, long id) { Chesser chesser = EntityFactory.CreateWithId <Chesser>(domain, id); ChesserComponent playerComponent = Game.Scene.GetComponent <ChesserComponent>(); playerComponent.Add(chesser); return(chesser); }
protected override async ETTask Run(ETModel.Session session, M2C_BroadcastAddGold message) { ChesserComponent chesserComponent = ETModel.Game.Scene.GetComponent <ChesserComponent>(); foreach (AddGold gold in message.Golds) { Chesser chesser = chesserComponent.Get(gold.Id); chesser.Gold = gold.Gold; } await ETTask.CompletedTask; }
public void Run(long id, int value) { ChesserComponent ChesserComponent = ETModel.Game.Scene.GetComponent <ChesserComponent>(); if (ChesserComponent.MyChesser.Id == id) //本人金币变化 { FUIComponent fUIComponent = Game.Scene.GetComponent <FUIComponent>(); FUI ui = fUIComponent.Get(FUIType.UIChessStore); FUI goldText = ui.GetComponent <FUIChessStoreComponent>().GoldText; goldText.Get("gold").GObject.asLabel.text = string.Format("%d", value); } }