Bonjour à tous

J'ai fait un script qui permet de faire du combat "Turn based system"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
private float Cur_CollDown = 0.0f;
         private float Max_CollDown = 5.0f;
         public float SpeedAttack = 5.0f ;
         public Transform OffsetEnemy;
 
 
 
    public enum TurnState
        {
            PROCESSING ,
            ADDTOLIST ,
            WAITING ,
            SELECCTION ,
            ACTION,
            DEAD,
        }
 
        public TurnState CurrentState;
 
 
 
 
public void Attack(){
        StartCoroutine (AttackCouroutine());
 
    }
 
 
    IEnumerator AttackCouroutine((){
 
          anim.Play ("wait");
 
            yield return new WaitForSeconds( 2.0f );
                     anim.Play ("shiftingtoAttack");
 
            float Step = SpeedAttack * Time.deltaTime;
            transform.position = Vector3.MoveTowards (transform.position, OffsetEnemy.position , Step );
 
            yield return new WaitForSeconds( 1.0f );
 
            anim.Play ("Attacking");
 
 
 
    yield return new WaitForSeconds( 2.0f );
 
            float StepReturn = SpeedAttack * Time.deltaTime;
            transform.position = Vector3.MoveTowards (transform.position, -OffsetEnemy.position , StepReturn );
 
    Cur_CollDown = 0.0f;
            CurrentState = TurnState.PROCESSING;
    }
 
 
 
 
 
    void Start () {
 
            CurrentState = TurnState.PROCESSING;
 
 
    }
 
 
 
 
    void Update () {
 
            switch (CurrentState) {
 
 
            case (TurnState .PROCESSING):
                UpgradePrgressBar ();
 
                break ;
            case (TurnState.ADDTOLIST):
 
                InputCombatSelectionDisplay ();
 
                break;
 
            case (TurnState.WAITING):
 
 
                break;
 
            case (TurnState.SELECCTION):
 
                break;
 
            case (TurnState.ACTION):
 
                break;
 
            case (TurnState.DEAD):
 
                break;
 
 
            }
 
    }

le problème c'est que mon personnage reste à sa place et n'applique plus sa première ligne pour sa première destination ni la deuxième