public override void restoreSaveGameData(FPEDoorSaveData data)
        {
            currentDoorState = data.DoorState;
            internallyLocked = data.IsInternallyLocked;
            externallyLocked = data.IsExternallyLocked;
            setDoorHandleInteractionStrings(data.DoorHandleString);

            switch (currentDoorState)
            {
            case eDoorState.CLOSING:
            case eDoorState.BLOCKED_PARTLY_CLOSED:
                swingingPart.localRotation = closedRotation * Quaternion.Euler(data.CustomDoorVector);
                break;

            case eDoorState.CLOSED:
                swingingPart.localRotation = closedRotation;
                break;

            case eDoorState.OPENING:
            case eDoorState.BLOCKED_PARTLY_OPEN:
                swingingPart.localRotation = closedRotation * Quaternion.Euler(data.CustomDoorVector);
                break;

            case eDoorState.OPEN:
                swingingPart.localRotation = openRotation;
                break;

            default:
                Debug.LogError("FPESwingingDoor.restoreSaveGameData():: Given bad door state '" + currentDoorState + "'");
                break;
            }
        }
Ejemplo n.º 2
0
        public override void restoreSaveGameData(FPEDoorSaveData data)
        {
            currentDoorState = data.DoorState;
            internallyLocked = data.IsInternallyLocked;
            externallyLocked = data.IsExternallyLocked;
            setDoorHandleInteractionStrings(data.DoorHandleString);

            switch (currentDoorState)
            {
            case eDoorState.CLOSED:
                swingingPart.localRotation = closedRotation;
                break;

            case eDoorState.CLOSING:
            case eDoorState.BLOCKED_PARTLY_CLOSED:
                swingingPart.localRotation = closedRotation * Quaternion.Euler(data.CustomDoorVector);
                break;

            case eDoorState.OPENING:
                swingingPart.localRotation = closedRotation * Quaternion.Euler(data.CustomDoorVector);
                // Pick closest openRotation, and set target to that
                if (Quaternion.Angle(swingingPart.localRotation, openRotationLeft) < Quaternion.Angle(swingingPart.localRotation, openRotationRight))
                {
                    currentSwingOpenRotation = openRotationLeft;
                }
                else
                {
                    currentSwingOpenRotation = openRotationRight;
                }
                break;

            case eDoorState.OPEN:
            case eDoorState.BLOCKED_PARTLY_OPEN:
                swingingPart.localRotation = closedRotation * Quaternion.Euler(data.CustomDoorVector);
                break;

            default:
                Debug.LogError("FPEAlwaysSwingOutDoor.restoreSaveGameData():: Given bad door state '" + currentDoorState + "'");
                break;
            }
        }
        public override void restoreSaveGameData(FPEDoorSaveData data)
        {
            currentDoorState = data.DoorState;
            setDoorHandleInteractionStrings(data.DoorHandleString);

            switch (currentDoorState)
            {
            case eDoorState.CLOSING:
            case eDoorState.CLOSED:
                setDoorClosed(Vector3.zero);
                break;

            case eDoorState.OPENING:
            case eDoorState.OPEN:
                setDoorOpen(Vector3.zero);
                break;

            default:
                Debug.LogError("FPESimpleDoor.restoreSaveGameData():: Given bad door state '" + currentDoorState + "'");
                break;
            }
        }
Ejemplo n.º 4
0
 public abstract void restoreSaveGameData(FPEDoorSaveData data);