mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-26 02:00:54 -05:00
Merge branch 'grayboxPlains' into main
This commit is contained in:
commit
edb74552c4
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 030501df3472751448be6a9bab0b7f7d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 15600000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9ba744b232877e84b9a2770e60e57c0d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 15600000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
132
Assets/Scripts/ControllsGamePadControlls.cs
Normal file
132
Assets/Scripts/ControllsGamePadControlls.cs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
// GENERATED AUTOMATICALLY FROM 'Assets/Scripts/ControllsGamePadControlls.inputactions'
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
||||
public class @ControllsGamePadControlls : IInputActionCollection, IDisposable
|
||||
{
|
||||
public InputActionAsset asset { get; }
|
||||
public @ControllsGamePadControlls()
|
||||
{
|
||||
asset = InputActionAsset.FromJson(@"{
|
||||
""name"": ""ControllsGamePadControlls"",
|
||||
""maps"": [
|
||||
{
|
||||
""name"": ""RunnerGamePad"",
|
||||
""id"": ""04979d69-e216-469f-817d-0a874e345751"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Jump"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""7a804743-c0f5-41cc-af8d-d108aa08c712"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """"
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""8a6737f7-66b7-4bdb-a7f4-822c756a7b53"",
|
||||
""path"": ""<Gamepad>/buttonSouth"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Jump"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
""controlSchemes"": []
|
||||
}");
|
||||
// RunnerGamePad
|
||||
m_RunnerGamePad = asset.FindActionMap("RunnerGamePad", throwIfNotFound: true);
|
||||
m_RunnerGamePad_Jump = m_RunnerGamePad.FindAction("Jump", throwIfNotFound: true);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UnityEngine.Object.Destroy(asset);
|
||||
}
|
||||
|
||||
public InputBinding? bindingMask
|
||||
{
|
||||
get => asset.bindingMask;
|
||||
set => asset.bindingMask = value;
|
||||
}
|
||||
|
||||
public ReadOnlyArray<InputDevice>? devices
|
||||
{
|
||||
get => asset.devices;
|
||||
set => asset.devices = value;
|
||||
}
|
||||
|
||||
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
||||
|
||||
public bool Contains(InputAction action)
|
||||
{
|
||||
return asset.Contains(action);
|
||||
}
|
||||
|
||||
public IEnumerator<InputAction> GetEnumerator()
|
||||
{
|
||||
return asset.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public void Enable()
|
||||
{
|
||||
asset.Enable();
|
||||
}
|
||||
|
||||
public void Disable()
|
||||
{
|
||||
asset.Disable();
|
||||
}
|
||||
|
||||
// RunnerGamePad
|
||||
private readonly InputActionMap m_RunnerGamePad;
|
||||
private IRunnerGamePadActions m_RunnerGamePadActionsCallbackInterface;
|
||||
private readonly InputAction m_RunnerGamePad_Jump;
|
||||
public struct RunnerGamePadActions
|
||||
{
|
||||
private @ControllsGamePadControlls m_Wrapper;
|
||||
public RunnerGamePadActions(@ControllsGamePadControlls wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @Jump => m_Wrapper.m_RunnerGamePad_Jump;
|
||||
public InputActionMap Get() { return m_Wrapper.m_RunnerGamePad; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(RunnerGamePadActions set) { return set.Get(); }
|
||||
public void SetCallbacks(IRunnerGamePadActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_RunnerGamePadActionsCallbackInterface != null)
|
||||
{
|
||||
@Jump.started -= m_Wrapper.m_RunnerGamePadActionsCallbackInterface.OnJump;
|
||||
@Jump.performed -= m_Wrapper.m_RunnerGamePadActionsCallbackInterface.OnJump;
|
||||
@Jump.canceled -= m_Wrapper.m_RunnerGamePadActionsCallbackInterface.OnJump;
|
||||
}
|
||||
m_Wrapper.m_RunnerGamePadActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@Jump.started += instance.OnJump;
|
||||
@Jump.performed += instance.OnJump;
|
||||
@Jump.canceled += instance.OnJump;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RunnerGamePadActions @RunnerGamePad => new RunnerGamePadActions(this);
|
||||
public interface IRunnerGamePadActions
|
||||
{
|
||||
void OnJump(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/ControllsGamePadControlls.cs.meta
Normal file
11
Assets/Scripts/ControllsGamePadControlls.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2fa44697960ae5f41bd367e6d38531ab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
// GENERATED AUTOMATICALLY FROM 'Assets/Scripts/PlayerScripts/MovementAbilities/GamePadControlls.inputactions'
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
||||
public class @GamePadControlls : IInputActionCollection, IDisposable
|
||||
{
|
||||
public InputActionAsset asset { get; }
|
||||
public @GamePadControlls()
|
||||
{
|
||||
asset = InputActionAsset.FromJson(@"{
|
||||
""name"": ""GamePadControlls"",
|
||||
""maps"": [
|
||||
{
|
||||
""name"": ""Runner"",
|
||||
""id"": ""5b72a223-d8e7-4904-bda9-b7bc5bf92850"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Jump"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""bd111e05-cd62-4634-ac88-eb948971f528"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """"
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""9fde690f-bb27-4b3c-a7e4-4354283ff9da"",
|
||||
""path"": ""<Gamepad>/buttonSouth"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Jump"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
""controlSchemes"": []
|
||||
}");
|
||||
// Runner
|
||||
m_Runner = asset.FindActionMap("Runner", throwIfNotFound: true);
|
||||
m_Runner_Jump = m_Runner.FindAction("Jump", throwIfNotFound: true);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
UnityEngine.Object.Destroy(asset);
|
||||
}
|
||||
|
||||
public InputBinding? bindingMask
|
||||
{
|
||||
get => asset.bindingMask;
|
||||
set => asset.bindingMask = value;
|
||||
}
|
||||
|
||||
public ReadOnlyArray<InputDevice>? devices
|
||||
{
|
||||
get => asset.devices;
|
||||
set => asset.devices = value;
|
||||
}
|
||||
|
||||
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
||||
|
||||
public bool Contains(InputAction action)
|
||||
{
|
||||
return asset.Contains(action);
|
||||
}
|
||||
|
||||
public IEnumerator<InputAction> GetEnumerator()
|
||||
{
|
||||
return asset.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public void Enable()
|
||||
{
|
||||
asset.Enable();
|
||||
}
|
||||
|
||||
public void Disable()
|
||||
{
|
||||
asset.Disable();
|
||||
}
|
||||
|
||||
// Runner
|
||||
private readonly InputActionMap m_Runner;
|
||||
private IRunnerActions m_RunnerActionsCallbackInterface;
|
||||
private readonly InputAction m_Runner_Jump;
|
||||
public struct RunnerActions
|
||||
{
|
||||
private @GamePadControlls m_Wrapper;
|
||||
public RunnerActions(@GamePadControlls wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @Jump => m_Wrapper.m_Runner_Jump;
|
||||
public InputActionMap Get() { return m_Wrapper.m_Runner; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(RunnerActions set) { return set.Get(); }
|
||||
public void SetCallbacks(IRunnerActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_RunnerActionsCallbackInterface != null)
|
||||
{
|
||||
@Jump.started -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump;
|
||||
@Jump.performed -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump;
|
||||
@Jump.canceled -= m_Wrapper.m_RunnerActionsCallbackInterface.OnJump;
|
||||
}
|
||||
m_Wrapper.m_RunnerActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@Jump.started += instance.OnJump;
|
||||
@Jump.performed += instance.OnJump;
|
||||
@Jump.canceled += instance.OnJump;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RunnerActions @Runner => new RunnerActions(this);
|
||||
public interface IRunnerActions
|
||||
{
|
||||
void OnJump(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3698cf5288c74ad41ba892329e2fb719
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "GamePadControlls",
|
||||
"maps": [
|
||||
{
|
||||
"name": "Runner",
|
||||
"id": "5b72a223-d8e7-4904-bda9-b7bc5bf92850",
|
||||
"actions": [
|
||||
{
|
||||
"name": "Jump",
|
||||
"type": "Button",
|
||||
"id": "bd111e05-cd62-4634-ac88-eb948971f528",
|
||||
"expectedControlType": "Button",
|
||||
"processors": "",
|
||||
"interactions": ""
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
{
|
||||
"name": "",
|
||||
"id": "9fde690f-bb27-4b3c-a7e4-4354283ff9da",
|
||||
"path": "<Gamepad>/buttonSouth",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Jump",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"controlSchemes": []
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3d6a5f3edd2f9d4693efbb2085dde9c
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||
generateWrapperCode: 1
|
||||
wrapperCodePath:
|
||||
wrapperClassName:
|
||||
wrapperCodeNamespace:
|
||||
|
|
@ -3,10 +3,12 @@ using System.Collections.Generic;
|
|||
using MLAPI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class PlayerMovement : NetworkBehaviour
|
||||
{
|
||||
|
||||
//Controller object
|
||||
new GamePadControlls controler;
|
||||
//Scripts
|
||||
public PlayerStats pStats;
|
||||
|
||||
|
|
@ -88,6 +90,8 @@ public class PlayerMovement : NetworkBehaviour
|
|||
capCol = GetComponent<CapsuleCollider>();
|
||||
pStats = GetComponent<PlayerStats>();
|
||||
parentObj = transform.parent.gameObject;
|
||||
controler = new GamePadControlls();
|
||||
controler.Runner.Enable();
|
||||
|
||||
capCol.enabled = false;
|
||||
//Wallrun
|
||||
|
|
@ -237,7 +241,7 @@ public class PlayerMovement : NetworkBehaviour
|
|||
private void Jump()
|
||||
{
|
||||
//If space is pressed apply an upwards force to the player
|
||||
if (Input.GetAxis("Jump") != 0 && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding)
|
||||
if ((Input.GetAxis("Jump") != 0) && !jumpPressed && curJumpNum + 1 < pStats.JumpNum && !isSliding)
|
||||
{
|
||||
AddImpact(transform.up, pStats.JumpPow);
|
||||
curJumpNum++;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public class Spin : MonoBehaviour
|
|||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"com.unity.ide.rider": "2.0.7",
|
||||
"com.unity.ide.visualstudio": "2.0.11",
|
||||
"com.unity.ide.vscode": "1.2.4",
|
||||
"com.unity.inputsystem": "1.0.2",
|
||||
"com.unity.multiplayer.mlapi": "https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi.git?path=/com.unity.multiplayer.mlapi#release/0.1.0",
|
||||
"com.unity.test-framework": "1.1.29",
|
||||
"com.unity.textmeshpro": "3.0.6",
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@
|
|||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.inputsystem": {
|
||||
"version": "1.0.2",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.multiplayer.mlapi": {
|
||||
"version": "https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi.git?path=/com.unity.multiplayer.mlapi#release/0.1.0",
|
||||
"depth": 0,
|
||||
|
|
|
|||
|
|
@ -152,7 +152,8 @@ PlayerSettings:
|
|||
resolutionScalingMode: 0
|
||||
androidSupportedAspectRatio: 1
|
||||
androidMaxAspectRatio: 2.1
|
||||
applicationIdentifier: {}
|
||||
applicationIdentifier:
|
||||
Standalone: com.DefaultCompany.TheKingsRace
|
||||
buildNumber:
|
||||
Standalone: 0
|
||||
iPhone: 0
|
||||
|
|
@ -681,7 +682,7 @@ PlayerSettings:
|
|||
m_VersionCode: 1
|
||||
m_VersionName:
|
||||
apiCompatibilityLevel: 6
|
||||
activeInputHandler: 0
|
||||
activeInputHandler: 2
|
||||
cloudProjectId:
|
||||
framebufferDepthMemorylessMode: 0
|
||||
qualitySettingsNames: []
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user