예제 #1
0
        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);
        }
예제 #2
0
        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;
        }
예제 #3
0
        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);
            }
        }