This commit is contained in:
2025-05-10 18:06:44 +08:00
parent e010759358
commit dea9a4f58e
47 changed files with 421 additions and 359 deletions

View File

@@ -49,7 +49,7 @@ namespace Rewired.Demos {
private bool setupFinished;
// Editor state management
[NonSerialized]
[System.NonSerialized]
private bool initialized;
private bool isCompiling;
@@ -1009,7 +1009,7 @@ namespace Rewired.Demos {
case ElementAssignmentChangeType.ConflictCheck:
return ProcessElementAssignmentConflictCheck(entry);
default:
throw new NotImplementedException();
throw new System.NotImplementedException();
}
}
@@ -1141,7 +1141,7 @@ namespace Rewired.Demos {
conflictFoundEventData.responseCallback(InputMapper.ConflictResponse.Replace);
} else if(entry.response == UserResponse.Custom1) { // add without removing
conflictFoundEventData.responseCallback(InputMapper.ConflictResponse.Add);
} else throw new NotImplementedException();
} else throw new System.NotImplementedException();
return true; // finished
}
@@ -1338,11 +1338,11 @@ namespace Rewired.Demos {
#region Mapping Listener Event Handlers
private void OnConflictFound(InputMapper.ConflictFoundEventData data) {
conflictFoundEventData = data;
this.conflictFoundEventData = data;
}
private void OnStopped(InputMapper.StoppedEventData data) {
conflictFoundEventData = null;
this.conflictFoundEventData = null;
}
#endregion
@@ -1677,7 +1677,7 @@ namespace Rewired.Demos {
bool assign
)
: base(QueueActionType.JoystickAssignment) {
playerId = newPlayerId;
this.playerId = newPlayerId;
this.joystickId = joystickId;
this.assign = assign;
}

View File

@@ -10,6 +10,6 @@ namespace Rewired.Demos.CustomPlatform {
[System.Serializable]
public class CustomPlatformHardwareJoystickMapPlatformDataSet : UnityEngine.ScriptableObject {
public System.Collections.Generic.List<Platforms.Custom.HardwareJoystickMapCustomPlatformMapSO> platformMaps;
public System.Collections.Generic.List<Rewired.Platforms.Custom.HardwareJoystickMapCustomPlatformMapSO> platformMaps;
}
}

View File

@@ -9,14 +9,14 @@ namespace Rewired.Demos.CustomPlatform {
/// Finds the matching platform map for the controller in question for the current custom platform.
/// </summary>
[System.Serializable]
public class CustomPlatformHardwareJoystickMapProvider : Platforms.Custom.IHardwareJoystickMapCustomPlatformMapProvider {
public class CustomPlatformHardwareJoystickMapProvider : Rewired.Platforms.Custom.IHardwareJoystickMapCustomPlatformMapProvider {
/// <summary>
/// The list of Platform joystick data sets.
/// </summary>
public System.Collections.Generic.List<PlatformDataSet> platformJoystickDataSets;
public Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap(int customPlatformId, System.Guid hardwareTypeGuid) {
public Rewired.Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap(int customPlatformId, System.Guid hardwareTypeGuid) {
var platformDataSet = GetPlatformDataSet(customPlatformId);
if (platformDataSet == null) return null;
return GetPlatformMap(platformDataSet, hardwareTypeGuid);
@@ -32,7 +32,7 @@ namespace Rewired.Demos.CustomPlatform {
return null;
}
static private Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap(CustomPlatformHardwareJoystickMapPlatformDataSet platformDataSet, System.Guid hardwareTypeGuid) {
static private Rewired.Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap(CustomPlatformHardwareJoystickMapPlatformDataSet platformDataSet, System.Guid hardwareTypeGuid) {
if (platformDataSet == null || platformDataSet.platformMaps == null) return null;
int count = platformDataSet.platformMaps.Count;
for (int i = 0; i < count; i++) {

View File

@@ -12,7 +12,7 @@ namespace Rewired.Demos.CustomPlatform {
/// found that returns a non-null <see cref="Rewired.Platforms.Custom.CustomPlatformInitOptions"/> will be used by
/// Rewired during initialization to set the custom platform.
/// </summary>
public sealed class CustomPlatformManager : UnityEngine.MonoBehaviour, Platforms.Custom.ICustomPlatformInitializer {
public sealed class CustomPlatformManager : UnityEngine.MonoBehaviour, Rewired.Platforms.Custom.ICustomPlatformInitializer {
/// <summary>
/// Provides custom platform joystick definition maps.
@@ -25,12 +25,12 @@ namespace Rewired.Demos.CustomPlatform {
/// Return null to not use a custom platform.
/// </summary>
/// <returns>Custom platform init options</returns>
public Platforms.Custom.CustomPlatformInitOptions GetCustomPlatformInitOptions() {
public Rewired.Platforms.Custom.CustomPlatformInitOptions GetCustomPlatformInitOptions() {
// You can use #if conditionals or other means to determine which custom platform to initialize, if any.
// Create platform options
var options = new Platforms.Custom.CustomPlatformInitOptions();
var options = new Rewired.Platforms.Custom.CustomPlatformInitOptions();
// Set the platform id
options.platformId = (int)CustomPlatformType.MyPlatform;
@@ -42,7 +42,7 @@ namespace Rewired.Demos.CustomPlatform {
options.hardwareJoystickMapCustomPlatformMapProvider = mapProvider;
// Create platform configuration values
var configVars = new Platforms.Custom.CustomPlatformConfigVars() {
var configVars = new Rewired.Platforms.Custom.CustomPlatformConfigVars() {
ignoreInputWhenAppNotInFocus = true,
useNativeKeyboard = true,
useNativeMouse = true

View File

@@ -7,7 +7,7 @@ namespace Rewired.Demos.CustomPlatform {
/// This allows supporting special features such as vibration and other custom functionality.
/// Implementing Rewired.Interfaces.IControllerVibrator allows Rewired's Controller and Player vibration function calls to work.
/// </summary>
public sealed class MyPlatformControllerExtension : ControllerExtensions.CustomControllerExtension, Interfaces.IControllerVibrator {
public sealed class MyPlatformControllerExtension : ControllerExtensions.CustomControllerExtension, Rewired.Interfaces.IControllerVibrator {
/// <summary>
/// Constructor.
@@ -62,7 +62,7 @@ namespace Rewired.Demos.CustomPlatform {
((Source)GetSource()).sourceJoystick.StopVibration();
}
class Source : Interfaces.IControllerExtensionSource {
class Source : Rewired.Interfaces.IControllerExtensionSource {
public readonly MyPlatformInputSource.Joystick sourceJoystick;

View File

@@ -19,7 +19,7 @@ namespace Rewired.Demos.CustomPlatform {
/// This requires no code. Simply create an instance from the right-click menu:
/// Create -> Rewired -> Custom Platform -> Simple Joystick Platform Map
/// </summary>
public sealed class MyPlatformHardwareJoystickMapPlatformMap : Platforms.Custom.HardwareJoystickMapCustomPlatformMapSO {
public sealed class MyPlatformHardwareJoystickMapPlatformMap : Rewired.Platforms.Custom.HardwareJoystickMapCustomPlatformMapSO {
/// <summary>
/// The platform map.
@@ -33,7 +33,7 @@ namespace Rewired.Demos.CustomPlatform {
/// Returns the Platform Map.
/// </summary>
/// <returns>Platform Map</returns>
public override Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap() {
public override Rewired.Data.Mapping.HardwareJoystickMap.Platform GetPlatformMap() {
return platformMap;
}
@@ -46,7 +46,7 @@ namespace Rewired.Demos.CustomPlatform {
/// Variants must be serialized in the child class below to avoid infinite recursion.
/// </summary>
[System.Serializable]
public class PlatformMapBase : Platforms.Custom.HardwareJoystickMapCustomPlatformMap<MatchingCriteria> {
public class PlatformMapBase : Rewired.Platforms.Custom.HardwareJoystickMapCustomPlatformMap<MatchingCriteria> {
/// <summary>
/// Creates a new instance of this object.
@@ -79,7 +79,7 @@ namespace Rewired.Demos.CustomPlatform {
/// This function must be implemented if using variants.
/// </summary>
/// <returns></returns>
public override System.Collections.Generic.IList<Data.Mapping.HardwareJoystickMap.Platform> GetVariants() { return variants; }
public override System.Collections.Generic.IList<Rewired.Data.Mapping.HardwareJoystickMap.Platform> GetVariants() { return variants; }
/// <summary>
/// Creates a new instance of this object.

View File

@@ -13,7 +13,7 @@ namespace Rewired.Demos.CustomPlatform {
/// If multi-threaded input is required, input should be read on a separate thread, enqueued,
/// and consumed by the Joystick/Controller on Update in a thread-safe manner (mutex).
/// </summary>
public sealed class MyPlatformInputSource : Platforms.Custom.CustomPlatformInputSource {
public sealed class MyPlatformInputSource : Rewired.Platforms.Custom.CustomPlatformInputSource {
/// <summary>
/// Source of joysticks. This is just for this example.
@@ -40,7 +40,7 @@ namespace Rewired.Demos.CustomPlatform {
/// Constructor.
/// </summary>
/// <param name="configVars">Custom platform configuration variables</param>
public MyPlatformInputSource(Platforms.Custom.CustomPlatformConfigVars configVars) :
public MyPlatformInputSource(Rewired.Platforms.Custom.CustomPlatformConfigVars configVars) :
base(
configVars,
new InitOptions() {
@@ -184,7 +184,7 @@ namespace Rewired.Demos.CustomPlatform {
/// <summary>
/// Example Joystick implementation that supports vibration.
/// </summary>
new public sealed class Joystick : Rewired.Platforms.Custom.CustomPlatformInputSource.Joystick, Interfaces.IControllerVibrator {
new public sealed class Joystick : Rewired.Platforms.Custom.CustomPlatformInputSource.Joystick, Rewired.Interfaces.IControllerVibrator {
private UnityInputJoystickSource.Joystick _sourceJoystick;

View File

@@ -5,9 +5,9 @@ namespace Rewired.Demos.CustomPlatform {
/// <summary>
/// An example custom keyboard input source that wraps UnityEngine.Input.
/// </summary>
public class MyPlatformUnifiedKeyboardSource : Platforms.Custom.CustomPlatformUnifiedKeyboardSource {
public class MyPlatformUnifiedKeyboardSource : Rewired.Platforms.Custom.CustomPlatformUnifiedKeyboardSource {
private static readonly KeyboardKeyCode[] keyCodes = (KeyboardKeyCode[])System.Enum.GetValues(typeof(KeyboardKeyCode));
private static readonly Rewired.KeyboardKeyCode[] keyCodes = (Rewired.KeyboardKeyCode[])System.Enum.GetValues(typeof(Rewired.KeyboardKeyCode));
protected override void OnInitialize() {
base.OnInitialize();
@@ -24,7 +24,7 @@ namespace Rewired.Demos.CustomPlatform {
// Set a single key label
map.Set(
new KeyPropertyMap.Key() {
keyCode = KeyboardKeyCode.A,
keyCode = Rewired.KeyboardKeyCode.A,
label = "[A]"
}
);
@@ -32,9 +32,9 @@ namespace Rewired.Demos.CustomPlatform {
// Set multiple of key labels at the same time
map.Set(
new [] {
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.B, label = "[B]" },
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.C, label = "[C]" },
new KeyPropertyMap.Key() { keyCode = KeyboardKeyCode.D, label = "[D]" }
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.B, label = "[B]" },
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.C, label = "[C]" },
new KeyPropertyMap.Key() { keyCode = Rewired.KeyboardKeyCode.D, label = "[D]" }
}
);

View File

@@ -5,7 +5,7 @@ namespace Rewired.Demos.CustomPlatform {
/// <summary>
/// An example custom mouse input source that wraps UnityEngine.Input.
/// </summary>
public class MyPlatformUnifiedMouseSource : Platforms.Custom.CustomPlatformUnifiedMouseSource {
public class MyPlatformUnifiedMouseSource : Rewired.Platforms.Custom.CustomPlatformUnifiedMouseSource {
/// <summary>
/// Mouse screen position in pixels.

View File

@@ -37,7 +37,7 @@ namespace Rewired.Demos.CustomPlatform {
}
private void CheckForJoystickChanges() {
double time = ReInput.time.unscaledTime;
double time = Rewired.ReInput.time.unscaledTime;
if (time >= _nextJoystickCheckTime) {
_nextJoystickCheckTime = time + joystickCheckInterval;
if (DidJoysticksChange()) {
@@ -159,7 +159,7 @@ namespace Rewired.Demos.CustomPlatform {
/// A represenatation of low-level system joystick.
/// This could provide an interface to a native input API, for example.
/// </summary>
public class Joystick : Interfaces.IControllerVibrator {
public class Joystick : Rewired.Interfaces.IControllerVibrator {
private const int maxJoysticks = 8;
private const int maxAxes = 10;

View File

@@ -52,7 +52,7 @@
namespace Rewired.Demos {
using UnityEngine;
using System.Collections.Generic;
using ControllerExtensions;
using Rewired.ControllerExtensions;
[AddComponentMenu("")]
public class DualShock4SpecialFeaturesExample : MonoBehaviour {

View File

@@ -105,125 +105,13 @@ MonoBehaviour:
_userData:
configVars:
updateLoop: 7
alwaysUseUnityInput: 1
windowsStandalonePrimaryInputSource: 0
osx_primaryInputSource: 0
linux_primaryInputSource: 0
windowsUWP_primaryInputSource: 0
xboxOne_primaryInputSource: 0
ps4_primaryInputSource: 0
webGL_primaryInputSource: 0
stadia_primaryInputSource: 0
useXInput: 1
useNativeMouse: 1
useEnhancedDeviceSupport: 1
windowsStandalone_useSteamRawInputControllerWorkaround: 0
osxStandalone_useEnhancedDeviceSupport: 1
android_supportUnknownGamepads: 1
ps4_assignJoysticksByPS4JoyId: 1
useSteamControllerSupport: 1
logToScreen: 0
runInEditMode: 0
allowInputInEditorSceneView: 0
platformVars_windowsStandalone:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
useNativeKeyboard: 1
joystickRefreshRate: 240
platformVars_linuxStandalone:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_osxStandalone:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_windows8Store:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_windowsUWP:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
useGamepadAPI: 1
useHIDAPI: 1
platformVars_iOS:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_tvOS:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_android:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_ps3:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_ps4:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_psVita:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_xbox360:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_xboxOne:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_wii:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_wiiu:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_switch:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_webGL:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
platformVars_stadia:
disableKeyboard: 0
ignoreInputWhenAppNotInFocus: 1
useNativeKeyboard: 1
useNativeMouse: 1
alwaysUseUnityInput: 1
maxJoysticksPerPlayer: 1
autoAssignJoysticks: 1
assignJoysticksToPlayingPlayersOnly: 0
distributeJoysticksEvenly: 1
reassignJoystickToPreviousOwnerOnReconnect: 1
defaultJoystickAxis2DDeadZoneType: 1
defaultJoystickAxis2DSensitivityType: 0
defaultAxisSensitivityType: 0
force4WayHats: 0
throttleCalibrationMode: 0
activateActionButtonsOnNegativeValue: 0
deferControllerConnectedEventsOnStart: 0
logLevel: 7
editorSettings:
exportConsts_useParentClass: 0
exportConsts_parentClassName: RewiredConsts
exportConsts_useNamespace: 1
exportConsts_namespace: RewiredConsts
exportConsts_actions: 1
exportConsts_actionsClassName: Action
exportConsts_actionsIncludeActionCategory: 0
exportConsts_actionsCreateClassesForActionCategories: 0
exportConsts_mapCategories: 1
exportConsts_mapCategoriesClassName: Category
exportConsts_layouts: 1
exportConsts_layoutsClassName: Layout
exportConsts_players: 1
exportConsts_playersClassName: Player
exportConsts_inputBehaviors: 0
exportConsts_inputBehaviorsClassName: InputBehavior
exportConsts_customControllers: 1
exportConsts_customControllersClassName: CustomController
exportConsts_customControllersAxesClassName: Axis
exportConsts_customControllersButtonsClassName: Button
exportConsts_layoutManagerRuleSets: 1
exportConsts_layoutManagerRuleSetsClassName: LayoutManagerRuleSet
exportConsts_mapEnablerRuleSets: 1
exportConsts_mapEnablerRuleSetsClassName: MapEnablerRuleSet
exportConsts_allCapsConstantNames: 0
players:
- _id: 0
_name: System
@@ -247,15 +135,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 5
_name: Player0
_descriptiveName: Player 1
@@ -305,15 +184,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 1
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 10
_name: Player1
_descriptiveName: Player 2
@@ -351,15 +221,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 17
_name: Player2
_descriptiveName: Player 3
@@ -397,15 +258,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 18
_name: Player3
_descriptiveName: Player 4
@@ -443,15 +295,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 19
_name: Player4
_descriptiveName: Player 5
@@ -489,15 +332,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 20
_name: Player5
_descriptiveName: Player 6
@@ -535,15 +369,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
- _id: 21
_name: Player6
_descriptiveName: Player 7
@@ -581,15 +406,6 @@ MonoBehaviour:
_defaultCustomControllerMaps: []
_startingCustomControllers: []
_assignMouseOnStart: 0
_assignKeyboardOnStart: 1
_excludeFromControllerAutoAssignment: 0
_controllerMapLayoutManagerSettings:
_enabled: 1
_loadFromUserDataStore: 1
_ruleSets: []
_controllerMapEnablerSettings:
_enabled: 1
_ruleSets: []
actions:
- _id: 3
_name: Vertical
@@ -979,8 +795,6 @@ MonoBehaviour:
inputBehaviors:
- _id: 0
_name: Default
_joystickAxisSensitivity: 1
_digitalAxisSimulation: 1
_digitalAxisSnap: 1
_digitalAxisInstantReverse: 0
_digitalAxisGravity: 3
@@ -990,16 +804,9 @@ MonoBehaviour:
_mouseXYAxisSensitivity: 1
_mouseXYAxisDeltaCalc: 1
_mouseOtherAxisSensitivity: 1
_customControllerAxisSensitivity: 1
_buttonDoublePressSpeed: .300000012
_buttonShortPressTime: .25
_buttonShortPressExpiresIn: 0
_buttonLongPressTime: 1
_buttonLongPressExpiresIn: 0
_buttonDeadZone: .5
_buttonDownBuffer: 0
_buttonRepeatRate: 30
_buttonRepeatDelay: 0
mapCategories:
- _name: Default
_descriptiveName: Default
@@ -2081,8 +1888,6 @@ MonoBehaviour:
actionElementMaps: []
customControllerMaps: []
customControllers: []
controllerMapLayoutManagerRuleSets: []
controllerMapEnablerRuleSets: []
playerIdCounter: 22
actionIdCounter: 47
actionCategoryIdCounter: 7
@@ -2097,8 +1902,6 @@ MonoBehaviour:
mouseMapIdCounter: 12
customControllerMapIdCounter: 7
customControllerIdCounter: 4
controllerMapLayoutManagerSetIdCounter: 0
controllerMapEnablerSetIdCounter: 0
_controllerDataFiles: {fileID: 11400000, guid: d21d2b20df8369642b76aafbb2576ba7,
type: 2}
--- !u!4 &220370785
@@ -2112,6 +1915,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!1 &311824353
GameObject:
m_ObjectHideFlags: 0
@@ -2151,6 +1955,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!1001 &420069592
Prefab:
m_ObjectHideFlags: 0
@@ -2208,6 +2013,7 @@ GameObject:
m_Component:
- 4: {fileID: 2100927960}
- 20: {fileID: 2100927959}
- 92: {fileID: 2100927958}
- 124: {fileID: 2100927957}
- 81: {fileID: 2100927956}
m_Layer: 0
@@ -2225,6 +2031,13 @@ AudioListener:
m_GameObject: {fileID: 2100927955}
m_Enabled: 1
--- !u!124 &2100927957
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2100927955}
m_Enabled: 1
--- !u!92 &2100927958
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
@@ -2258,8 +2071,11 @@ Camera:
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
--- !u!4 &2100927960
Transform:
m_ObjectHideFlags: 0
@@ -2271,3 +2087,4 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0

View File

@@ -126,7 +126,7 @@ namespace Rewired.Demos {
void Awake() {
pointer = (GameObject)Instantiate(pointerPrefab);
pointer = (GameObject)GameObject.Instantiate(pointerPrefab);
pointer.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
#if UNITY_5_PLUS
@@ -190,11 +190,11 @@ namespace Rewired.Demos {
}
void CreateClickEffect(Color color) {
GameObject go = (GameObject)Instantiate(clickEffectPrefab);
GameObject go = (GameObject)GameObject.Instantiate(clickEffectPrefab);
go.transform.localScale = new Vector3(spriteScale, spriteScale, spriteScale);
go.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(mouse.screenPosition.x, mouse.screenPosition.y, distanceFromCamera));
go.GetComponentInChildren<SpriteRenderer>().color = color;
Destroy(go, 0.5f);
Object.Destroy(go, 0.5f);
}
// Callback when the screen position changes

View File

@@ -10,7 +10,7 @@ namespace Rewired.Demos {
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using Integration.UnityUI;
using Rewired.Integration.UnityUI;
/// <summary>
/// Example handler of Player Pointer Events.

View File

@@ -46,7 +46,7 @@ namespace Rewired.Demos {
// and re-connected and disable this script
if(DoAllPlayersHaveJoysticks()) {
ReInput.configuration.autoAssignJoysticks = true;
enabled = false; // disable this script
this.enabled = false; // disable this script
}
}

View File

@@ -19,7 +19,7 @@ namespace Rewired.Demos {
private Vector3 moveVector;
private bool fire;
private Player player { get { return ReInput.isReady ? ReInput.players.GetPlayer(playerId) : null; } }
private Rewired.Player player { get { return ReInput.isReady ? ReInput.players.GetPlayer(playerId) : null; } }
void OnEnable() {
// Get the character controller

View File

@@ -25,8 +25,8 @@ namespace Rewired.Demos {
private static PressStartToJoinExample_Assigner instance;
public static Player GetRewiredPlayer(int gamePlayerId) {
if(!ReInput.isReady) return null;
public static Rewired.Player GetRewiredPlayer(int gamePlayerId) {
if(!Rewired.ReInput.isReady) return null;
if(instance == null) {
Debug.LogError("Not initialized. Do you have a PressStartToJoinPlayerSelector in your scehe?");
return null;

View File

@@ -18,7 +18,7 @@ namespace Rewired.Demos {
private Vector3 moveVector;
private bool fire;
private Player player { get { return PressStartToJoinExample_Assigner.GetRewiredPlayer(gamePlayerId); } }
private Rewired.Player player { get { return PressStartToJoinExample_Assigner.GetRewiredPlayer(gamePlayerId); } }
void OnEnable() {
// Get the character controller

View File

@@ -134,10 +134,10 @@ namespace Rewired.Demos {
// Delete placeholders
foreach(Transform t in actionGroupTransform) {
Destroy(t.gameObject);
Object.Destroy(t.gameObject);
}
foreach(Transform t in fieldGroupTransform) {
Destroy(t.gameObject);
Object.Destroy(t.gameObject);
}
// Create Action fields and input field buttons
@@ -158,13 +158,13 @@ namespace Rewired.Demos {
private void CreateUIRow(InputAction action, AxisRange actionRange, string label) {
// Create the Action label
GameObject labelGo = Instantiate<GameObject>(textPrefab);
GameObject labelGo = Object.Instantiate<GameObject>(textPrefab);
labelGo.transform.SetParent(actionGroupTransform);
labelGo.transform.SetAsLastSibling();
labelGo.GetComponent<Text>().text = label;
// Create the input field button
GameObject buttonGo = Instantiate<GameObject>(buttonPrefab);
GameObject buttonGo = Object.Instantiate<GameObject>(buttonPrefab);
buttonGo.transform.SetParent(fieldGroupTransform);
buttonGo.transform.SetAsLastSibling();

View File

@@ -126,10 +126,10 @@ namespace Rewired.Demos {
// Delete placeholders
foreach(Transform t in actionGroupTransform) {
Destroy(t.gameObject);
Object.Destroy(t.gameObject);
}
foreach(Transform t in fieldGroupTransform) {
Destroy(t.gameObject);
Object.Destroy(t.gameObject);
}
// Create Action fields and input field buttons
@@ -150,13 +150,13 @@ namespace Rewired.Demos {
private void CreateUIRow(InputAction action, AxisRange actionRange, string label) {
// Create the Action label
GameObject labelGo = Instantiate<GameObject>(textPrefab);
GameObject labelGo = Object.Instantiate<GameObject>(textPrefab);
labelGo.transform.SetParent(actionGroupTransform);
labelGo.transform.SetAsLastSibling();
labelGo.GetComponent<Text>().text = label;
// Create the input field button
GameObject buttonGo = Instantiate<GameObject>(buttonPrefab);
GameObject buttonGo = Object.Instantiate<GameObject>(buttonPrefab);
buttonGo.transform.SetParent(fieldGroupTransform);
buttonGo.transform.SetAsLastSibling();