private void OnRecvCoin(IChannel channel, Message message) { CCoinMessage request = message as CCoinMessage; SCoinMessage reply = new SCoinMessage(); var conn = db.Instance.Connect(); reply.gold = db.Instance.GetGoldCoins(request.userdbid, conn); reply.silver = db.Instance.GetSilverCoins(request.userdbid, conn); channel.Send(reply); }
private void OnEnable() { PlayerMyController.Instance.EnabledWindowCount++; if (m_controller == null || m_damageable == null) { m_controller = PlayerController.Mine; m_damageable = PlayerController.Mine.GetComponent <Damageable>(); } CCoinMessage m = new CCoinMessage(); m.userdbid = World.Instance.selfDbid; Client.Instance.Send(m); string hp = string.Format("{0}/{1}", m_damageable.currentHitPoints, m_damageable.maxHitPoints); HPValue.SetText(hp, true); SpeedValue.SetText(Convert.ToString(World.Instance.count_speed), true); AttackValue.SetText(Convert.ToString(World.Instance.count_attack), true); GameObject.Find("MarketItemImage").SetActive(true); GameObject.Find("MarketItemText").SetActive(true); GameObject.Find("MarketItemImage").GetComponent <Image>().sprite = init; GameObject.Find("MarketItemValue").GetComponent <Text>().text = "Value"; GameObject.Find("MarketItemEffect").GetComponent <Text>().text = "Function"; GameObject.Find("MarketItemPrice").GetComponent <Text>().text = "Price"; GameObject.Find("MarketItemText").GetComponent <Text>().text = World.Instance.selfName; foreach (var i in World.Instance.occupied) { if (i.Value == 1) { foreach (var j in World.Instance.position) { if (j.Value == i.Key) { Sprite icon = GetAllIcons.icons[getname(j.Key)]; GameObject.Find(string.Format("Market{0}", i.Key)).GetComponent <Image>().sprite = icon; Debug.Log(i.Key); } } } } }
private void OnEnable() { PlayerMyController.Instance.EnabledWindowCount++; if (m_controller == null || m_damageable == null) { m_controller = PlayerController.Mine; m_damageable = PlayerController.Mine.GetComponent <Damageable>(); } string hp = string.Format("{0}/{1}", m_damageable.currentHitPoints, m_damageable.maxHitPoints); CCoinMessage m = new CCoinMessage(); m.userdbid = World.Instance.selfDbid; Client.Instance.Send(m); HPValue.SetText(hp, true); SpeedValue.SetText(Convert.ToString(World.Instance.count_speed), true); AttackValue.SetText(Convert.ToString(World.Instance.count_attack), true); GameObject.Find("ItemImage").SetActive(true); GameObject.Find("ItemText").SetActive(true); GameObject.Find("ItemImage").GetComponent <Image>().sprite = init; GameObject.Find("ItemValue").GetComponent <Text>().text = "Value"; GameObject.Find("ItemEffect").GetComponent <Text>().text = "Function"; GameObject.Find("ItemText").GetComponent <Text>().text = World.Instance.selfName; }