浏览代码

Upgraded Project to 2019.3.0f6

/main
andytouch 5 年前
当前提交
a0898484
共有 10 个文件被更改,包括 159 次插入18 次删除
  1. 58
      InputSystem_LocalMultiplayer_Project/Assets/Input/InputActions_Player.cs
  2. 38
      InputSystem_LocalMultiplayer_Project/Assets/Input/InputActions_Player.inputactions
  3. 20
      InputSystem_LocalMultiplayer_Project/Assets/Scenes/Scene_Example_Warriors.unity
  4. 39
      InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerController.cs
  5. 12
      InputSystem_LocalMultiplayer_Project/Packages/manifest.json
  6. 4
      InputSystem_LocalMultiplayer_Project/ProjectSettings/Packages/com.unity.probuilder/Settings.json
  7. 2
      InputSystem_LocalMultiplayer_Project/ProjectSettings/ProjectSettings.asset
  8. 4
      InputSystem_LocalMultiplayer_Project/ProjectSettings/ProjectVersion.txt
  9. 0
      /InputSystem_LocalMultiplayer_Project/Assets/Editor/ReorderableListUtility.cs
  10. 0
      /InputSystem_LocalMultiplayer_Project/Assets/Editor/ReorderableListUtility.cs.meta

58
InputSystem_LocalMultiplayer_Project/Assets/Input/InputActions_Player.cs


""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": ""Press""
},
{
""name"": ""SwipePosition"",
""type"": ""Value"",
""id"": ""840b80c7-bc6a-4e66-95cd-c42297731b3d"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""SwipeEvent"",
""type"": ""Value"",
""id"": ""f69a88db-b2f5-44ea-a16c-0fba04697410"",
""expectedControlType"": """",
""processors"": """",
""interactions"": ""Press(behavior=2)""
}
],
""bindings"": [

""action"": ""Attack"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""67874717-4feb-488c-9042-8fbd28e61a67"",
""path"": ""<Pointer>/position"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse;Touchscreen"",
""action"": ""SwipePosition"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""4fa2fc10-e314-475c-b919-42646b691646"",
""path"": ""<Pointer>/press"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse;Touchscreen"",
""action"": ""SwipeEvent"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},

m_PlayerControls_Movement = m_PlayerControls.FindAction("Movement", throwIfNotFound: true);
m_PlayerControls_Attack = m_PlayerControls.FindAction("Attack", throwIfNotFound: true);
m_PlayerControls_OpenPauseMenu = m_PlayerControls.FindAction("OpenPauseMenu", throwIfNotFound: true);
m_PlayerControls_SwipePosition = m_PlayerControls.FindAction("SwipePosition", throwIfNotFound: true);
m_PlayerControls_SwipeEvent = m_PlayerControls.FindAction("SwipeEvent", throwIfNotFound: true);
// Menu Controls
m_MenuControls = asset.FindActionMap("Menu Controls", throwIfNotFound: true);
m_MenuControls_ClosePauseMenu = m_MenuControls.FindAction("ClosePauseMenu", throwIfNotFound: true);

private readonly InputAction m_PlayerControls_Movement;
private readonly InputAction m_PlayerControls_Attack;
private readonly InputAction m_PlayerControls_OpenPauseMenu;
private readonly InputAction m_PlayerControls_SwipePosition;
private readonly InputAction m_PlayerControls_SwipeEvent;
public struct PlayerControlsActions
{
private @InputActions_Player m_Wrapper;

public InputAction @OpenPauseMenu => m_Wrapper.m_PlayerControls_OpenPauseMenu;
public InputAction @SwipePosition => m_Wrapper.m_PlayerControls_SwipePosition;
public InputAction @SwipeEvent => m_Wrapper.m_PlayerControls_SwipeEvent;
public InputActionMap Get() { return m_Wrapper.m_PlayerControls; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }

@OpenPauseMenu.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
@OpenPauseMenu.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
@OpenPauseMenu.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
@SwipePosition.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
@SwipePosition.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
@SwipePosition.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
@SwipeEvent.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
@SwipeEvent.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
@SwipeEvent.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
}
m_Wrapper.m_PlayerControlsActionsCallbackInterface = instance;
if (instance != null)

@OpenPauseMenu.started += instance.OnOpenPauseMenu;
@OpenPauseMenu.performed += instance.OnOpenPauseMenu;
@OpenPauseMenu.canceled += instance.OnOpenPauseMenu;
@SwipePosition.started += instance.OnSwipePosition;
@SwipePosition.performed += instance.OnSwipePosition;
@SwipePosition.canceled += instance.OnSwipePosition;
@SwipeEvent.started += instance.OnSwipeEvent;
@SwipeEvent.performed += instance.OnSwipeEvent;
@SwipeEvent.canceled += instance.OnSwipeEvent;
}
}
}

void OnMovement(InputAction.CallbackContext context);
void OnAttack(InputAction.CallbackContext context);
void OnOpenPauseMenu(InputAction.CallbackContext context);
void OnSwipePosition(InputAction.CallbackContext context);
void OnSwipeEvent(InputAction.CallbackContext context);
}
public interface IMenuControlsActions
{

38
InputSystem_LocalMultiplayer_Project/Assets/Input/InputActions_Player.inputactions


"expectedControlType": "Button",
"processors": "",
"interactions": "Press"
},
{
"name": "SwipePosition",
"type": "Value",
"id": "840b80c7-bc6a-4e66-95cd-c42297731b3d",
"expectedControlType": "Vector2",
"processors": "",
"interactions": ""
},
{
"name": "SwipeEvent",
"type": "Value",
"id": "f69a88db-b2f5-44ea-a16c-0fba04697410",
"expectedControlType": "",
"processors": "",
"interactions": "Press(behavior=2)"
}
],
"bindings": [

"processors": "",
"groups": "",
"action": "Attack",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "67874717-4feb-488c-9042-8fbd28e61a67",
"path": "<Pointer>/position",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse;Touchscreen",
"action": "SwipePosition",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "4fa2fc10-e314-475c-b919-42646b691646",
"path": "<Pointer>/press",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse;Touchscreen",
"action": "SwipeEvent",
"isComposite": false,
"isPartOfComposite": false
}

20
InputSystem_LocalMultiplayer_Project/Assets/Scenes/Scene_Example_Warriors.unity


- target: {fileID: 3528249008770642978, guid: 7040c04d00ad25e4cad0ba1b7d40c3c0,
type: 3}
propertyPath: m_DefaultControlScheme
value: Gamepad
value:
objectReference: {fileID: 0}
- target: {fileID: 3528249008770642978, guid: 7040c04d00ad25e4cad0ba1b7d40c3c0,
type: 3}

spawnMultiplePlayers: 1
playerPrefab: {fileID: 8145840457835730771, guid: 7040c04d00ad25e4cad0ba1b7d40c3c0,
type: 3}
numberOfPlayers: 3
numberOfPlayers: 1
spawnArea: {x: 4, y: 0, z: 4}
pauseMenu: {fileID: 1854239559}
--- !u!4 &1134540116

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &1912423614
MonoBehaviour:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 782418257}
m_Modifications:
- target: {fileID: 189306772, guid: 1ff0ff9fe1f589244aee9d67ce1c6e58, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1864481344318969274, guid: 1ff0ff9fe1f589244aee9d67ce1c6e58,
type: 3}
propertyPath: m_LocalPosition.x

type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2481451024144240066, guid: 1ff0ff9fe1f589244aee9d67ce1c6e58,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4047100248330977748, guid: 1ff0ff9fe1f589244aee9d67ce1c6e58,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4771699827640259325, guid: 1ff0ff9fe1f589244aee9d67ce1c6e58,
type: 3}

39
InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerController.cs


MoveThePlayer();
AnimatePlayerMovement();
TurnThePlayer();
}
void CalculateMovementInput()

}
}
//Device Callbacks from the new Input System ----
private Vector3 swipeStartPosition;
private Vector3 swipeEndPosition;
private Vector3 swipeCurrentPosition;
private Vector3 directionOfSwipe;
private bool swipeActive = false;
private void OnSwipePosition(InputValue value)
{
swipeCurrentPosition = value.Get<Vector2>();
}
private void OnDeviceLost()
private void OnSwipeEvent(InputValue value)
Debug.Log("Goodbye");
if(value.isPressed)
{
swipeActive = true;
swipeStartPosition = new Vector3(swipeCurrentPosition.x, 0, swipeCurrentPosition.y);
Debug.Log("Start");
} else {
swipeActive = false;
swipeEndPosition = new Vector3(swipeCurrentPosition.x, 0, swipeCurrentPosition.y);
CalculateSwipeLogic();
}
private void OnDeviceRegained()
void CalculateSwipeLogic()
Debug.Log("Hello Again");
//Debug.Log("Swipe --- Start: " + swipeStartPosition + " End: " + swipeEndPosition);
//Destination - Origin --> Normalized
Debug.Log("Swipe --- Direction: " + (swipeStartPosition-swipeEndPosition).normalized);
//directionOfSwipe = -(swipeStartPosition-swipeEndPosition).normalized;
//Debug.Log("Swipe --- Distance: " + (Vector2.Distance(swipeStartPosition, swipeEndPosition)));

12
InputSystem_LocalMultiplayer_Project/Packages/manifest.json


{
"dependencies": {
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.0",
"com.unity.ide.vscode": "1.1.3",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.1.4",
"com.unity.probuilder": "4.1.2",
"com.unity.render-pipelines.universal": "7.1.6",
"com.unity.test-framework": "1.1.3",
"com.unity.probuilder": "4.2.3",
"com.unity.render-pipelines.universal": "7.1.8",
"com.unity.test-framework": "1.1.9",
"com.unity.timeline": "1.2.6",
"com.unity.timeline": "1.2.10",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

4
InputSystem_LocalMultiplayer_Project/ProjectSettings/Packages/com.unity.probuilder/Settings.json


{
"type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "about.identifier",
"value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":1,\"m_Patch\":0,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"2019/07/03\"}}"
"value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":2,\"m_Patch\":3,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
"value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":1,\"m_Patch\":0,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"2019/07/03\"}}"
"value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":2,\"m_Patch\":3,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}"
},
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",

2
InputSystem_LocalMultiplayer_Project/ProjectSettings/ProjectSettings.asset


bundleVersion: 0.1
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1

4
InputSystem_LocalMultiplayer_Project/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2019.3.0f1
m_EditorVersionWithRevision: 2019.3.0f1 (ffacea4b84e7)
m_EditorVersion: 2019.3.0f6
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)

/InputSystem_LocalMultiplayer_Project/Assets/Scripts/ReorderableListUtility.cs → /InputSystem_LocalMultiplayer_Project/Assets/Editor/ReorderableListUtility.cs

/InputSystem_LocalMultiplayer_Project/Assets/Scripts/ReorderableListUtility.cs.meta → /InputSystem_LocalMultiplayer_Project/Assets/Editor/ReorderableListUtility.cs.meta

正在加载...
取消
保存