|
@@ -95,23 +95,23 @@ public class AttributeStatus : MonoBehaviour
|
|
|
switch (floatingState)
|
|
switch (floatingState)
|
|
|
{
|
|
{
|
|
|
case 1:
|
|
case 1:
|
|
|
- transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
|
|
|
|
+ character.transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
curHeight = Mathf.SmoothDamp(curHeight, height, ref rise, riseTime);
|
|
curHeight = Mathf.SmoothDamp(curHeight, height, ref rise, riseTime);
|
|
|
- transform.position = new Vector3(origPos.x, curHeight, origPos.z);
|
|
|
|
|
|
|
+ character.transform.position = new Vector3(origPos.x, curHeight, origPos.z);
|
|
|
if (curHeight >= height - 0.02f)
|
|
if (curHeight >= height - 0.02f)
|
|
|
{
|
|
{
|
|
|
floatingState = 2;
|
|
floatingState = 2;
|
|
|
- height = transform.position.y;
|
|
|
|
|
|
|
+ height = character.transform.position.y;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 2:
|
|
case 2:
|
|
|
- transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
|
|
|
|
+ character.transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
break;
|
|
break;
|
|
|
case 3:
|
|
case 3:
|
|
|
- if (transform.position.y >= origPos.y + 0.05f)
|
|
|
|
|
|
|
+ if (character.transform.position.y >= origPos.y + 0.05f)
|
|
|
{
|
|
{
|
|
|
curHeight -= normalFallSpeed * Time.deltaTime;
|
|
curHeight -= normalFallSpeed * Time.deltaTime;
|
|
|
- transform.position = new Vector3(origPos.x, curHeight, origPos.z);
|
|
|
|
|
|
|
+ character.transform.position = new Vector3(origPos.x, curHeight, origPos.z);
|
|
|
}
|
|
}
|
|
|
else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
|
|
else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
|
|
|
{
|
|
{
|
|
@@ -132,14 +132,14 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
if (playerController.lostMp >= playerController.addMp)
|
|
if (playerController.lostMp >= playerController.addMp)
|
|
|
{
|
|
{
|
|
|
- Instantiate(playerController.soul, transform.position, new Quaternion(0, 0, 0, 0), null);
|
|
|
|
|
|
|
+ Instantiate(playerController.soul, character.transform.position, new Quaternion(0, 0, 0, 0), null);
|
|
|
playerController.lostMp = 0;
|
|
playerController.lostMp = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
attributeTime -= Time.deltaTime;
|
|
attributeTime -= Time.deltaTime;
|
|
|
if (attributeTime <= 0)
|
|
if (attributeTime <= 0)
|
|
|
{
|
|
{
|
|
|
- transform.localEulerAngles = Vector3.zero;
|
|
|
|
|
|
|
+ character.transform.localEulerAngles = Vector3.zero;
|
|
|
floatingState = 3;
|
|
floatingState = 3;
|
|
|
rb.useGravity = true;
|
|
rb.useGravity = true;
|
|
|
}
|
|
}
|
|
@@ -260,7 +260,7 @@ public class AttributeStatus : MonoBehaviour
|
|
|
|
|
|
|
|
rb.useGravity = false;
|
|
rb.useGravity = false;
|
|
|
floatingState = 1;
|
|
floatingState = 1;
|
|
|
- origPos = transform.position;
|
|
|
|
|
|
|
+ origPos = character.transform.position;
|
|
|
curHeight = origPos.y;
|
|
curHeight = origPos.y;
|
|
|
riseTime = UnityEngine.Random.Range(floatState.upTime.x, floatState.upTime.y);
|
|
riseTime = UnityEngine.Random.Range(floatState.upTime.x, floatState.upTime.y);
|
|
|
backSpeed = UnityEngine.Random.Range(floatState.backSpeed.x, floatState.backSpeed.y);
|
|
backSpeed = UnityEngine.Random.Range(floatState.backSpeed.x, floatState.backSpeed.y);
|