コード例 #1
0
        private void TweenMask(float from, float to, FCallback.FunVoid fCallback, float time = 1.0f)
        {
            if (_maskGo == null)
            {
                fCallback();
                return;
            }

            _maskGo.SetActive(true);

            BoxCollider box = _maskGo.GetComponent <BoxCollider>();

            if (box != null)
            {
                box.enabled = true;
            }

            UIWidget widget = _maskGo.GetComponent <UIWidget>();

            if (widget == null)
            {
                fCallback();
                return;
            }

            widget.alpha = from;
            iTween.ValueTo(_maskGo, iTween.Hash(
                               "from", from,
                               "to", to,
                               "delay", .1f,
                               "time", time,
                               "easetype", iTween.EaseType.linear,
                               "onupdate", FCallback.CreateAction(delegate(object x)
            {
                float value  = Mathf.Clamp01((float)x);
                widget.alpha = value;
            }),
                               "onupdatetarget", gameObject,
                               "oncomplete", FCallback.CreateAction(delegate()
            {
                if (box != null)
                {
                    box.enabled = false;
                }
                fCallback();
            }),
                               "oncompletetarget", gameObject));
        }
コード例 #2
0
 public CBlink(FCallback Callback_)
 {
     _Callback = Callback_;
 }