Beispiel #1
0
 private void howToPlayToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (HelpEvent != null)
     {
         HelpEvent.Invoke();
     }
 }
        internal void Visit(HelpEvent @event)
        {
            lock (_lock)
            {
                var context = new RoomContext(@event.Broker, @event.Bot, @event.Room);

                var commands = new Dictionary <string, string>();
                foreach (var command in _parts.OfType <CommandPart>())
                {
                    var name = command.Aliases.FirstOrDefault() ?? string.Empty;
                    if (!string.IsNullOrWhiteSpace(name.Trim()) && !string.IsNullOrWhiteSpace(command.Help))
                    {
                        commands[name] = command.Help.Trim();
                    }
                }

                var builder = new StringBuilder();
                var index   = 1;
                foreach (var command in commands)
                {
                    builder.AppendLine($"{index}. `{command.Key}` {command.Value}");
                    index++;
                }

                context.Broadcast(builder.ToString());
            }
        }
Beispiel #3
0
    public static HelpEvent GetInstance() // 싱글턴
    {
        if (instance == null)
        {
            instance = FindObjectOfType <HelpEvent>();

            if (instance == null)
            {
                GameObject container = new GameObject("HelpEvent");

                instance = container.AddComponent <HelpEvent>();
            }
        }
        return(instance);
    }
    private void Update()
    {
        if (moveStart)
        {
            if (fsm._CurrentState == Player_State.Damaged)
            {
                force = 0;
            }

            if (this.transform.rotation.y == 0 && HelpEvent.GetInstance().MoveCorrection(Vector2.right, this.transform.position, 0.6f))
            {
                this.transform.position += Vector3.right * force * Time.deltaTime;
            }
            else if (this.transform.rotation.y == 1 && HelpEvent.GetInstance().MoveCorrection(Vector2.left, this.transform.position, 0.6f))
            {
                this.transform.position += Vector3.left * force * Time.deltaTime;
            }
        }
    }
    void Skill()
    {
        if (_manager.anim.GetCurrentAnimatorStateInfo(0).IsName("Skill"))
        {
            if (_manager.anim.GetCurrentAnimatorStateInfo(0).normalizedTime < 0.9f)
            {
                Vector3 move = this.transform.parent.transform.position;
                move += inputMoveXY * speed;

                if (HelpEvent.GetInstance().MoveCorrection(inputMoveXY, move, 0.4f))
                {
                    this.transform.parent.transform.position = move;
                }
            }
            else
            {
                _manager.ChScript(Player_State.Idle);
                _manager.notGavityTime = notGavityTimer;
            }
        }
    }
    void Move() // 이동
    {
        move = this.transform.position;

        if (Input.GetKey(KeyCode.RightArrow)) // 오른쪽이동
        {
            if (HelpEvent.GetInstance().MoveCorrection(Vector2.right, this.transform.position, 0.3f))
            {
                if (groundChack)
                {
                    moveEffect.SetActive(true);
                }
                anim.SetFloat("Forward", 1);
                move.x += state.warkSpeed * Time.deltaTime;
                this.transform.rotation = Quaternion.Euler(0, 0, 0);
            }
        }
        else if (Input.GetKey(KeyCode.LeftArrow)) // 왼쪽이동
        {
            if (HelpEvent.GetInstance().MoveCorrection(Vector2.left, this.transform.position, 0.3f))
            {
                if (groundChack)
                {
                    moveEffect.SetActive(true);
                }
                anim.SetFloat("Forward", 1);
                move.x -= state.warkSpeed * Time.deltaTime;
                this.transform.rotation = Quaternion.Euler(0, -180, 0);
            }
        }
        else
        {
            moveEffect.SetActive(false);
            anim.SetFloat("Forward", 0);
        }

        this.transform.position = move;
    }
Beispiel #7
0
 public void RaiseHelpEvent(object sender, System.Windows.RoutedEventArgs e)
 {
     // Your logic
     HelpEvent?.Invoke();
 }
Beispiel #8
0
 private void btnHelp_Click(object sender, System.EventArgs e)
 {
     HelpEvent?.Invoke();
 }