|
@@ -34,10 +34,13 @@ public class BeHitTrigger : MonoBehaviour
|
|
|
|
|
|
|
|
public void FreezeFrame(int frame)
|
|
public void FreezeFrame(int frame)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (!isFreeze)
|
|
|
|
|
+ {
|
|
|
|
|
+ origRC = owner.rb.constraints;
|
|
|
|
|
+ }
|
|
|
isFreeze = true;
|
|
isFreeze = true;
|
|
|
freezeFrame = frame;
|
|
freezeFrame = frame;
|
|
|
owner.ani.speed = 0;
|
|
owner.ani.speed = 0;
|
|
|
- origRC = owner.rb.constraints;
|
|
|
|
|
owner.rb.constraints = RigidbodyConstraints.FreezeAll;
|
|
owner.rb.constraints = RigidbodyConstraints.FreezeAll;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -49,7 +52,10 @@ public class BeHitTrigger : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
isFreeze = false;
|
|
isFreeze = false;
|
|
|
owner.ani.speed = 1;
|
|
owner.ani.speed = 1;
|
|
|
- owner.rb.constraints = origRC;
|
|
|
|
|
|
|
+ if (owner.rb.constraints == RigidbodyConstraints.FreezeAll)
|
|
|
|
|
+ {
|
|
|
|
|
+ owner.rb.constraints = origRC;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
freezeFrame -= 1;
|
|
freezeFrame -= 1;
|
|
|
}
|
|
}
|