void Start() { maxHP = hp; if (!isEnemy) { playerIndex = transform.GetComponent <Player>().playerIndex; gui = transform.GetComponent <Player>().playerGUI; } }
private void M_iq_UpdatePrices(PriceUpdateIQ update) { //Console.WriteLine("{0} {1}:{2}-{3}:{4} {5}", update.Symbol, update.BidSize, update.Bid, update.Ask, update.AskSize, update.LastTradeTime); if (update.Symbol.StartsWith("@BTC")) { m_baBtc.Update(this, update); if (m_prevBtc != null) { if (update.LastTradePrice > decimal.Parse(m_prevBtc)) { GUi.SetLabelColor(this, lblFutBTC, Color.Green); } else if (update.LastTradePrice < decimal.Parse(m_prevBtc)) { GUi.SetLabelColor(this, lblFutBTC, Color.Red); } } GUi.SetLabelText(this, lblFutBTC, update.LastTradePrice.ToString()); m_prevBtc = update.LastTradePrice.ToString(); } else if (update.Symbol.StartsWith("@XBT")) { m_baXbt.Update(this, update); if (m_prevXbt != null) { if (update.LastTradePrice > decimal.Parse(m_prevXbt)) { GUi.SetLabelColor(this, lblFutXBT, Color.Green); } else if (update.LastTradePrice < decimal.Parse(m_prevXbt)) { GUi.SetLabelColor(this, lblFutXBT, Color.Red); } } GUi.SetLabelText(this, lblFutXBT, update.LastTradePrice.ToString()); m_prevXbt = update.LastTradePrice.ToString(); } }