private void RefreshStateText(object eventData = null) { if (cardObject.GetIsDeployed())…
- User
private void RefreshStateText(object eventData = null) { if (cardObject.GetIsDeployed()) { m_stateText.gameObject.SetActive(false); } else { GameTimeSpan deployTimer = cardObject.DeployTimer.TimeLeftTillNextTick; m_stateText.text = $"{deployTimer.Value.Num + 1}"; }
m_costText.text = $"{cardObject.GetCost().Value.Value.Num}"; m_nameText.text = m_nameTextTrap.text = $"{cardObject.GetName()}"; m_descriptionText.text = $"{cardObject.GetDescription()}"; if (cardObject.GetAvatar() != null) { UpdateCardImage(cardObject.GetAvatar().name); } UpdateCardFaceImage(cardObject.GetCardType(),cardObject.GetFaceRankType()); m_btnActiveTrap.gameObject.SetActive(cardObject.GetIsDeployed() && IsInTrapField && IsLocalPlayer); m_nameTextTrap.gameObject.SetActive(IsLocalPlayer && cardObject.GetCardPosition().CardPositionType != CardPositionTypes.CPChain); } 帮忙优化这段代码 - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.