예제 #1
0
    public void onReloadLevel(Vector3 spawnPos)
    {
        GameObjectTools.setActive(gameObject, true);

        if (bounce.isBouncing())
        {
            bounce.stop();
        }
        patrol.enablePatrol();
        patrol.setDir(1f);         // initialize patrol direction
        patrol.setMoveSpeed(initialPatrolSpeed);
        if (_hide.isHidden())
        {
            _hide.unHide();
        }
        chase.stop();
        chase.setOperable(true);
        if (jump != null)
        {
            jump.setForeverJump(jumpInLoop);
        }

        transform.position = spawnPos;
        shape.body._UpdatedTransform();         // update the body position
    }