void doCheckPathAndMove() { if (path != null) { if (targetRigid.transform.position.Equals(path[path.Count - 1])) { // targetRigid.MovePosition(targetRigid.transform.position + targetRigid.transform.forward * Time.deltaTime * moveSpeed); } } else { if (releasePower > 0) { float moveSpeed = 0; if (explosionCube == null) { moveSpeed = myMove.UpdateSpeed(Time.deltaTime); //get speed if (moveSpeed > 0) { float timeScale = myMove.getTimeScaleBySpeed(); Debug.Log("onMoveUpdate moveSpeed? " + moveSpeed + " , releasePower ? " + releasePower); targetRigid.MovePosition(targetRigid.transform.position + targetRigid.transform.forward * (Time.deltaTime * timeScale)); } if (moveSpeed <= 0) { releasePower = 0; } } else { float z_distance = 10; //releasePower effect if (targetRigid != null) { targetRigid.AddExplosionForce(targetMaxCharge, explosionCube.transform.localPosition, z_distance, -1F, ForceMode.Impulse); releasePower = 0; } } } } }