Exemplo n.º 1
0
    private void ExecutePatterns()
    {
        bool hasArrived = MoveMyself(patterns[patternIndex]);

        if (hasArrived)
        {
            patternIndex++;
            hasArrived = false;
            if (patternIndex == patterns.Length)
            {
                state = PatternStates.FINISH;
            }
        }
    }
Exemplo n.º 2
0
    public virtual void Update()
    {
        switch (state)
        {
        case PatternStates.WORKING: {
            ExecutePatterns();
            break;
        }

        case PatternStates.FINISH: {
            PatternFinished();
            state = PatternStates.END;
            break;
        }
        }
    }
Exemplo n.º 3
0
 public void InitPatterns()
 {
     patternIndex = 0;
     patterns     = GetPattern();
     state        = PatternStates.WORKING;
 }