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