public void Init(HandCardUI _handCardUI, bool _isMy) { isMy = _isMy; handCardUI = _handCardUI; image = this.GetComponent <RawImage>(); handCardUI = this.transform.parent.GetComponent <HandCardUI>(); HandCardAnim = transform.FindChild("HandCardAnim").GetComponent <DashedAnim>(); posY = rectTransform.localPosition.y; }
public void Init(FieldMgr field, bool _isMy) { fieldMgr = field; isMy = _isMy; image = transform.FindChild("cardImage").GetComponent <RawImage>(); attackAnimUI = transform.FindChild("attackAnimUI").GetComponent <AttackAnimUI>(); selectAnim = transform.FindChild("selectAnim").GetComponent <DashedAnim>(); foreach (Text t in this.GetComponentsInChildren <Text>()) { if (t.name == "AfkText") { AfkText = t; } if (t.name == "DefText") { DefText = t; } if (t.name == "LevelText") { LevelText = t; } if (t.name == "SpritText") { SpritText = t; } } attackAnimUI.Init(isMy); HideAttackAnim(); isInSelect = false; isSelect = false; AfkText.text = ""; DefText.text = ""; LevelText.text = ""; SpritText.text = ""; }