Fixed an animation bug
This commit is contained in:
+1
-1
@@ -171,7 +171,7 @@
|
||||
<workItem from="1681479671396" duration="22217000" />
|
||||
<workItem from="1681565663292" duration="642000" />
|
||||
<workItem from="1681648997302" duration="1618000" />
|
||||
<workItem from="1681659517327" duration="3062000" />
|
||||
<workItem from="1681659517327" duration="4109000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -51,17 +51,17 @@ public class NoPlayablePlayer : Player
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// //Animation Control
|
||||
if (Vector3.Distance(transform.position, lastPosAnim) > 0f)
|
||||
{
|
||||
animator.SetInteger("value", 1);
|
||||
}
|
||||
else if (jumpRequest)
|
||||
//Animation Control
|
||||
if (jumpRequest)
|
||||
{
|
||||
jumpRequest = false;
|
||||
animator.SetInteger("value", 2);
|
||||
lastTimeDoneIdleAction = Time.time;
|
||||
}
|
||||
else if (Vector3.Distance(transform.position, lastPosAnim) > 0)
|
||||
{
|
||||
animator.SetInteger("value", 1);
|
||||
}
|
||||
else if (Time.time - lastTimeDoneIdleAction > idleActionDelay)
|
||||
{
|
||||
lastTimeDoneIdleAction = Time.time;
|
||||
|
||||
@@ -64,16 +64,16 @@ public class PlayablePlayer : Player
|
||||
private void Update()
|
||||
{
|
||||
//Animation Control
|
||||
if (Vector3.Distance(transform.position, lastPosAnim) > 0)
|
||||
{
|
||||
animator.SetInteger("value", 1);
|
||||
}
|
||||
else if (jumpRequest)
|
||||
if (jumpRequest)
|
||||
{
|
||||
jumpRequest = false;
|
||||
animator.SetInteger("value", 2);
|
||||
lastTimeDoneIdleAction = Time.time;
|
||||
}
|
||||
else if (Vector3.Distance(transform.position, lastPosAnim) > 0)
|
||||
{
|
||||
animator.SetInteger("value", 1);
|
||||
}
|
||||
else if (Time.time - lastTimeDoneIdleAction > idleActionDelay)
|
||||
{
|
||||
lastTimeDoneIdleAction = Time.time;
|
||||
@@ -109,7 +109,7 @@ public class PlayablePlayer : Player
|
||||
jumpRequest = true;
|
||||
|
||||
wurfelt = true;
|
||||
wurfelZahl = Random.Range(2, 3);
|
||||
wurfelZahl = Random.Range(1, 7);
|
||||
|
||||
switch (activeItem)
|
||||
{
|
||||
@@ -290,15 +290,17 @@ public class PlayablePlayer : Player
|
||||
{
|
||||
if (fieldReturnStatus != 2 && fieldReturnStatus != 3)
|
||||
{
|
||||
Invoke("Finish", 2);
|
||||
Invoke("Finish", 3);
|
||||
}
|
||||
|
||||
activated = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkDoubleDice = false;
|
||||
wurfelt = false;
|
||||
if (fieldReturnStatus != 2 && fieldReturnStatus != 3)
|
||||
{
|
||||
Invoke("RollDiceAgain", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -480,4 +482,10 @@ public class PlayablePlayer : Player
|
||||
client.SendStopRotator(rotatorStopIndex);
|
||||
rotator.Stop(rotatorStopIndex);
|
||||
}
|
||||
|
||||
private void RollDiceAgain()
|
||||
{
|
||||
checkDoubleDice = false;
|
||||
wurfelt = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user