/// <summary>
        /// 移动方式变更
        /// </summary>
        private void MoveFuncChange()
        {
            if (rB_Jog.Checked)
            {
                MoveFunc = MoveFunc.Jog;
                bXY_Mode.ContextMenuStrip   = this.selectSpeedMode;
                bZ_Mode.ContextMenuStrip    = this.selectSpeedMode;
                bU_Mode.ContextMenuStrip    = this.selectSpeedMode;
                bTurn_Mode.ContextMenuStrip = this.selectSpeedMode;

                bXY_Mode.Text   = "中速";
                bZ_Mode.Text    = "中速";
                bU_Mode.Text    = "中速";
                bTurn_Mode.Text = "中速";
            }
            else
            {
                MoveFunc = MoveFunc.MoveTrim;
                bXY_Mode.ContextMenuStrip = this.selectMoveDist;
                bZ_Mode.ContextMenuStrip  = this.selectMoveDist;
                bU_Mode.ContextMenuStrip  = this.selectMoveDist;

                bXY_Mode.Text   = "0.1";
                bZ_Mode.Text    = "0.1";
                bU_Mode.Text    = "0.1";
                bTurn_Mode.Text = "0.1";
            }
        }
Beispiel #2
0
    /// <summary>
    /// 根据状态表和移动回调创建移动结构
    /// </summary>
    private MoveFunc CreateMoveFunc(StateTable table, Action moveFunc)
    {
        var mf = new MoveFunc();

        mf.mode     = (EMoveMode)table.moveMode;
        mf.priority = table.movePriority;
        mf.func     = moveFunc;
        return(mf);
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        MoveFunc[] functions = { lineMove, swirlMove, sineMove };
        startTime = Time.time;

        int moveIdx = Random.Range(0, functions.Length);

        move  = functions[moveIdx];
        enemy = GetComponent <Enemy>();
    }
Beispiel #4
0
    private IEnumerator scaling(MoveFunc func, float animTime)
    {
        func(0f, MoveState.START);
        float t = 0f;

        while (t <= animTime)
        {
            func(t / animTime, MoveState.MOVE);
            t += Time.deltaTime;
            yield return(null);
        }
        func(1f, MoveState.END);
    }
Beispiel #5
0
 public Coroutine scale(MoveFunc func, float animTime)
 {
     return(StartCoroutine(moving(func, animTime)));
 }