예제 #1
0
    public void Down(PointerEventData eventData)
    {
        IsActive = true;
        SwiperTimer.Reset();
        SwiperTimer.Start();
        currentPointerID = eventData.pointerId;

        currPos       =
            lastPos   =
                start = GetCurrentPointerPosition();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        if (DestoryObject)
        {
            timer = new ActionTimer(TimeToExpire, ExpireSelf);
        }
        else
        {
            timer = new ActionTimer(TimeToExpire, DisableSelf);
        }

        timer.Reset();
        timer.Start();
    }
예제 #3
0
파일: TextInput.cs 프로젝트: rettoph/Guppy
        /// <summary>
        /// Handle the element focused state changed event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="which"></param>
        /// <param name="value"></param>
        private void HandleFocused(IElement sender, ElementState which, bool value)
        {
            if (value)
            {
                _window.TextInput += this.HandleTextInput;
                this.OnDraw       += this.DrawCarret;

                _renderCarret = false;
                _carretTimer.Reset();
            }
            else
            {
                _window.TextInput -= this.HandleTextInput;
                this.OnDraw       -= this.DrawCarret;
            }
        }
예제 #4
0
        public void StartTransition()
        {
            var from = GetScreenByName(TransitioningOut);
            var to   = GetScreenByName(TransitioningIn);

            TransitionTimer.TimeLimit = TransitionDuration;
            TransitionTimer.Reset();
            TransitionTimer.Start();

            //to.rotation = Quaternion.identity;
            to.gameObject.SetActive(true);

            toStart             = CurrentTransitionIsBack ? new Vector2(-Screen.width, 0) : new Vector2(Screen.width, 0);
            toEnd               = new Vector2(0, 0);
            to.anchoredPosition = toStart;

            toRotate   = CurrentTransitionIsBack ? rotateLeft : rotateRight;
            fromRotate = !CurrentTransitionIsBack ? rotateLeft : rotateRight;

            fromStart = new Vector2(0, 0);
            fromEnd   = CurrentTransitionIsBack ? new Vector2(Screen.width, 0) : new Vector2(-Screen.width, 0);
        }