浏览代码

Fix: Odd Transform Rotation of Warrior Visuals

/V2
andytouch 4 年前
当前提交
0632c0b6
共有 4 个文件被更改,包括 12 次插入269 次删除
  1. 6
      InputSystem_Warriors_Project/Assets/Prefabs/Warrior/Player_Warrior.prefab
  2. 263
      InputSystem_Warriors_Project/Assets/Scenes/Scene_Example_Warriors.unity
  3. 2
      InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerMovementBehaviour.cs
  4. 10
      InputSystem_Warriors_Project/Assets/Scripts/Editor/DeviceDisplayConfiguratorEditor.cs

6
InputSystem_Warriors_Project/Assets/Prefabs/Warrior/Player_Warrior.prefab


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1743518200780429236}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.12, y: 2.079, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2693099407422876726}
m_LocalRotation: {x: 0, y: -0.959314, z: 0.28234145, w: 0}
m_LocalRotation: {x: -0, y: -0.959314, z: 0.28234145, w: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.0035760803, y: 0.0035760803, z: 0.0035760803}
m_Children:

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7582353321118191810}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

263
InputSystem_Warriors_Project/Assets/Scenes/Scene_Example_Warriors.unity


type: 3}
m_PrefabInstance: {fileID: 280609174585779900}
m_PrefabAsset: {fileID: 0}
--- !u!114 &16277602 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1743518200311987065, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
m_PrefabInstance: {fileID: 280609174585779900}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 16277595}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e20fb9a3b0e7eae4e9e630fc6e8b1a3f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &31590763
GameObject:
m_ObjectHideFlags: 3

m_Name:
m_EditorClassIdentifier:
m_BindingMode: 5
m_FollowOffset: {x: 0, y: 2.034772, z: -5.753515}
m_FollowOffset: {x: 0, y: 1.680325, z: -5.680587}
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1

m_Name:
m_EditorClassIdentifier:
m_BindingMode: 5
m_FollowOffset: {x: 0, y: 2.034772, z: -5.753515}
m_FollowOffset: {x: 0, y: 1.680325, z: -5.680587}
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1

m_Name:
m_EditorClassIdentifier:
m_BindingMode: 5
m_FollowOffset: {x: 0, y: 2.034772, z: -5.753515}
m_FollowOffset: {x: 0, y: 1.680325, z: -5.680587}
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1

m_EditorClassIdentifier:
currentGameMode: 0
inScenePlayer: {fileID: 16277595}
singlePlayerCameraMode: 0
singlePlayerCameraMode: 1
playerPrefab: {fileID: 1743518200311987069, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
numberOfPlayers: 3

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1833978498}
m_LocalRotation: {x: 0.16914704, y: -0.002150739, z: 0.0003691106, w: 0.98558843}
m_LocalRotation: {x: 0.16914704, y: -0.002150739, z: 0.00036911067, w: 0.98558843}
m_LocalPosition: {x: 0.01616344, y: -4.7452283, z: -3.7034783}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

- target: {fileID: 1743518200311987014, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987014, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}

- target: {fileID: 1743518200311987014, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987014, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}

- target: {fileID: 1743518200311987014, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
value: 180
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[1].m_PersistentCalls.m_Calls.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DefaultControlScheme
value:
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_NotificationBehavior
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[1].m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[1].m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnMovement
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[0].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnAttack
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[2].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnTogglePause
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[3].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnTogglePause
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ActionEvents.Array.data[4].m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnDeviceLost
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceLostEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnDeviceRegained
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_DeviceRegainedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 16277602}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OnControlsChanged
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987064, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}
propertyPath: m_ControlsChangedEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1743518200311987069, guid: ca9ee4e0ea2b85646be0b08bab27e559,
type: 3}

2
InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerMovementBehaviour.cs


{
if(movementDirection.sqrMagnitude > 0.01f)
{
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (CameraDirection(-movementDirection)), rotationSpeed);
transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (CameraDirection(movementDirection)), rotationSpeed);
}
}

10
InputSystem_Warriors_Project/Assets/Scripts/Editor/DeviceDisplayConfiguratorEditor.cs


return new Rect(xPosition, rect.y, rect.width / 2 - xWidth, EditorGUIUtility.singleLineHeight);
}
/*
void CalculateColumnSizes(Rect rect, int extraPadding)
{
rawPathColumn = new Rect(rect.x + extraPadding, rect.y, rect.width / 2 - 10, EditorGUIUtility.singleLineHeight);
deviceDisplaySettingsColumn = new Rect(rect.x + rect.width / 2 + extraPadding, rect.y, rect.width/2, EditorGUIUtility.singleLineHeight);
}
*/
}
正在加载...
取消
保存