Example #1
0
 public void Init(string text, Action onClick = null)
 {
     RectTrans.Find("Text").GetComponent <Text>().text = text;
     if (onClick != null)
     {
         GetComponent <Button>().onClick.AddListener(new UnityAction(onClick));
     }
 }
Example #2
0
        protected override void Awake()
        {
            base.Awake();
            meshFilter   = GetComponent <MeshFilter>();
            meshRenderer = GetComponent <MeshRenderer>();
            aimPoint     = RectTrans.Find("aimPoint");
            ringMaterial = meshRenderer.material;
            color        = ringMaterial.GetColor("_Color");

            if (Detail > 2)
            {
                SetMesh(Detail);
            }
        }
Example #3
0
        protected override void Awake()
        {
            base.Awake();

            _BatterText          = RectTrans.Find("BatterText").GetComponent <TextMeshProUGUI>();
            _BatterTextRectTrans = _BatterText.rectTransform;
            _ScoreText           = RectTrans.Find("ScoreText").GetComponent <TextMeshProUGUI>();

            _HitJumpBaseColor = _BatterText.color;
            _HitJumpBaseSize  = _BatterTextRectTrans.rect.Size();

            _HitJumpTween = DOTween.Sequence();
            _HitJumpTween.Append(_BatterTextRectTrans.DOSizeDelta(_HitJumpBaseSize * HitJumpSizeScale, HitJumpTime.x));
            _HitJumpTween.Append(_BatterTextRectTrans.DOSizeDelta(_HitJumpBaseSize, HitJumpTime.y));
            _HitJumpTween.SetAutoKill(false);
            _HitJumpTween.Pause();

            UpdateData(0, 0, 0);
        }