public static void Show(string prompt, string defaultInput, OnEnter successCallback, OnCancel failCallback)
 {
     EditorTextPrompt window = GetWindow<EditorTextPrompt>();
     window._displayedInput = defaultInput;
     window._windowPrompt = prompt;
     window._enterCB = successCallback;
     window._cancelCB = failCallback;
     window.Show();
 }
Esempio n. 2
0
 public virtual void Enter()
 {
     OnEnter?.Invoke();
 }
Esempio n. 3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     OnEnter?.Invoke(other);
 }
Esempio n. 4
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     OnEnter?.Invoke(eventData);
 }
Esempio n. 5
0
 public void AddEnterFunction(Delegate d)
 {
     onEnter += d as OnEnter;
 }
Esempio n. 6
0
 internal static void Enter(_OuiJournal journal, Oui from)
 => OnEnter?.Invoke(journal, from);
    public virtual void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        var info = new StateBehaviourInfo(animator, stateInfo, layerIndex);

        OnEnter?.Invoke(info);
    }
Esempio n. 8
0
 protected override void StateEnter()
 {
     base.StateEnter();
     OnEnter?.Invoke(this);
 }
Esempio n. 9
0
        protected override void CheckTootipArea(Vector2 local)
        {
            if (local.x < zeroX || local.x > zeroX + coordinateWid ||
                local.y < zeroY || local.y > zeroY + coordinateHig)
            {
                tooltip.DataIndex = 0;
                RefreshTooltip();
            }
            else
            {
                if (xAxis.type == AxisType.value)
                {
                    float splitWid = yAxis.GetDataWidth(coordinateHig);
                    for (int i = 0; i < yAxis.GetDataNumber(); i++)
                    {
                        float pY = zeroY + i * splitWid;
                        if (yAxis.boundaryGap)
                        {
                            if (local.y > pY && local.y <= pY + splitWid)
                            {
                                tooltip.DataIndex = i + 1;
                                break;
                            }
                        }
                        else
                        {
                            if (local.y > pY - splitWid / 2 && local.y <= pY + splitWid / 2)
                            {
                                tooltip.DataIndex = i + 1;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    float splitWid = xAxis.GetDataWidth(coordinateWid);
                    for (int i = 0; i < xAxis.GetDataNumber(); i++)
                    {
                        float pX = zeroX + i * splitWid;
                        if (xAxis.boundaryGap)
                        {
                            if (local.x > pX && local.x <= pX + splitWid)
                            {
                                tooltip.DataIndex = i + 1;
                                break;
                            }
                        }
                        else
                        {
                            if (local.x > pX - splitWid / 2 && local.x <= pX + splitWid / 2)
                            {
                                tooltip.DataIndex = i + 1;
                                break;
                            }
                        }
                    }
                }
            }
            if (tooltip.DataIndex > 0)
            {
                tooltip.UpdatePos(new Vector2(local.x + 18, local.y - 25));
                RefreshTooltip();
                if (tooltip.LastDataIndex != tooltip.DataIndex)
                {
                    RefreshChart();

                    string lastDataCode = xAxis.GetKeyData(tooltip.LastDataIndex);
                    if (!string.IsNullOrEmpty(lastDataCode))
                    {
                        OnExit?.Invoke(lastDataCode);
                    }

                    string dataCode = xAxis.GetKeyData(tooltip.DataIndex);
                    if (!string.IsNullOrEmpty(dataCode))
                    {
                        OnEnter?.Invoke(dataCode);
                    }
                }
                tooltip.LastDataIndex = tooltip.DataIndex;
            }
        }
Esempio n. 10
0
 private void OnMouseEnter()
 {
     OnEnter.Invoke();
     IsOver = true;
 }
Esempio n. 11
0
        protected void HandleEnter(IReference refback, bool appear)
        {
            //SetTransition(refback, GetEnterDuration(), TransitionDelay);

            OnEnter?.Invoke(refback, appear);
        }
Esempio n. 12
0
        public virtual void Enter()
        {
            OnEnter?.Invoke();

            ElapsedTime = 0f;
        }
 public void OnPointerEnter(PointerEventData eventData)
 {
     OnEnter.Invoke(effects);
 }
Esempio n. 14
0
 public void OnEndEdit()
 {
     OnEnter?.Invoke(inputField.text);
     Focus();
 }
Esempio n. 15
0
        public override void Update(GameTime gameTime, MouseState mouseState, KeyboardState keyboardState)
        {
            if (!Enabled)
            {
                return;
            }

            if (Active)
            {
                if (caretStopwatch.ElapsedMilliseconds >= 500)
                {
                    showCaret = !showCaret;
                    caretStopwatch.Restart();
                }

                if (oldKeyboardState == null)
                {
                    oldKeyboardState = keyboardState;
                }

                if (keyboardState.IsKeyDown(Keys.Right) && !oldKeyboardState.IsKeyDown(Keys.Right) && caretPosition < (Text.Length))
                {
                    caretPosition += 1;
                    caretStopwatch.Restart();
                    showCaret = true;
                }
                if (keyboardState.IsKeyDown(Keys.Left) && !oldKeyboardState.IsKeyDown(Keys.Left) && caretPosition > 0)
                {
                    caretPosition -= 1;
                    caretStopwatch.Restart();
                    showCaret = true;
                }


                foreach (var pressedKey in keyboardState.GetPressedKeys())
                {
                    if (oldKeyboardState.IsKeyUp(pressedKey))
                    {
                        if (pressedKey == Keys.Delete && Text.Length > 0 && caretPosition < Text.Length)
                        {
                            RealText = RealText.Remove(caretPosition, 1);
                            UpdateVisualText();
                        }
                        else if (pressedKey == Keys.Enter)
                        {
                            OnEnter?.Invoke();
                        }
                    }
                }

                oldKeyboardState = keyboardState;
            }

            if (oldMouseState == null)
            {
                oldMouseState = mouseState;
            }

            if (mouseState.LeftButton == ButtonState.Pressed && oldMouseState.LeftButton != ButtonState.Pressed)
            {
                if (Rectangle.Contains(mouseState.Position))
                {
                    Active = true;

                    if (mouseState.X >= Rectangle.X + textXAddition)
                    {
                        for (int i = 0; i < Text.Length; i++)
                        {
                            var x     = Rectangle.X + textXAddition + (int)font.MeasureString(Text.Substring(0, i)).X;
                            var width = (int)font.MeasureString(Text.Substring(i, 1)).X;

                            if (mouseState.X >= x && mouseState.X <= (x + width))
                            {
                                caretPosition = i;
                                caretStopwatch.Restart();
                                showCaret = true;
                                break;
                            }
                            else if (mouseState.X >= (Rectangle.X + textXAddition + font.MeasureString(Text).X))
                            {
                                caretPosition = Text.Length;
                                caretStopwatch.Restart();
                                showCaret = true;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    Active = false;
                }
            }


            oldMouseState = mouseState;
        }
Esempio n. 16
0
 protected override void ExecuteOnEnter(Collider2D other)
 {
     m_CanExecuteButtons = true;
     OnEnter.Invoke();
 }
Esempio n. 17
0
 public void Enter()
 {
     //Log.Information($"Fsm: {Fsm} State {StateEnum};Enter");
     OnEnter?.Invoke(this, null);
 }
Esempio n. 18
0
 protected void CastEnterEvent(Collider2D collider)
 {
     OnEnter?.Invoke(collider);
 }
Esempio n. 19
0
 public virtual void Enter(IState from, Dictionary <string, object> transitionParameters = null)
 {
     OnEnter?.Invoke(from, this);
     HasStarted = true;
 }
Esempio n. 20
0
        protected async Task HandleEnterAsync(IReference refback, bool appear)
        {
            await SlideHelper.SetSlideTranslateValueAsync(Placement, refback.Current);

            OnEnter?.Invoke(refback, appear);
        }
Esempio n. 21
0
 private void Awake()
 {
     //_uberApp = FindObjectOfType<UberApplication>();
     //_navListProvider = _uberApp.ListProvider;
     OnEnter.AddListener(ButtonClicked);
 }
Esempio n. 22
0
 void _FireEvent_OnEnter(GameObject obj)
 {
     OnEnter?.Invoke(obj);
 }
Esempio n. 23
0
 internal static void Enter(Session session, bool fromSaveData)
 => OnEnter?.Invoke(session, fromSaveData);
Esempio n. 24
0
 private void OnCollisionEnter2D(Collision2D collision) => OnEnter?.Invoke(collision);
Esempio n. 25
0
 public FSM.State Enter()
 {
     OnEnter?.Invoke();
     return(this);
 }
Esempio n. 26
0
 private void TriggerEnterCallback(GameObject newSelection)
 {
     OnEnter?.Invoke(newSelection);
 }
Esempio n. 27
0
 public void MainMenu()
 {
     OnEnter.setCount(1);
     SceneManager.LoadScene(0, LoadSceneMode.Single);
     Time.timeScale = 1;
 }
Esempio n. 28
0
 protected override void OnMouseLeave(UIMouseEventParameter p)
 {
     base.OnMouseLeave(p);
     OnEnter?.Invoke(this, p);
 }
Esempio n. 29
0
 /// <summary>
 /// 进入状态时的回调
 /// </summary>
 /// <param name="prev">上一个状态</param>
 public virtual void EnterCallback(IState prev)
 {
     OnEnter?.Invoke(prev);
     //重置计时器
     Timer = 0f;
 }
Esempio n. 30
0
 public void EnterBase()
 {
     Enter();
     OnEnter?.Invoke(this, EventArgs.Empty);
 }