Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Updating XboxCtrlrInput for Unity 5.5. Unity Web Player no longer sup…
Browse files Browse the repository at this point in the history
…ported
  • Loading branch information
Jibran Syed committed Jan 10, 2017
1 parent fa35408 commit 7ece072
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 48 deletions.
37 changes: 21 additions & 16 deletions XboxCtrlrInput/Assets/Plugins/XboxCtrlrInput.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using XInputDotNetPure;

namespace XboxCtrlrInput
Expand Down Expand Up @@ -1006,26 +1007,19 @@ private static bool OnMac()
// http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver
// http://wiki.unity3d.com/index.php?title=Xbox360Controller
return (Application.platform == RuntimePlatform.OSXEditor ||
Application.platform == RuntimePlatform.OSXPlayer ||
Application.platform == RuntimePlatform.OSXWebPlayer);
Application.platform == RuntimePlatform.OSXPlayer );
}

private static bool OnWindows()
{
return (Application.platform == RuntimePlatform.WindowsEditor ||
Application.platform == RuntimePlatform.WindowsPlayer ||
Application.platform == RuntimePlatform.WindowsWebPlayer);
Application.platform == RuntimePlatform.WindowsPlayer );
}

private static bool OnWindowsWebPlayer()
{
return (Application.platform == RuntimePlatform.WindowsWebPlayer);
}

private static bool OnWindowsNative()

private static bool OnWindowsNative()
{
return (Application.platform == RuntimePlatform.WindowsEditor ||
Application.platform == RuntimePlatform.WindowsPlayer);
Application.platform == RuntimePlatform.WindowsPlayer );
}

private static bool OnLinux()
Expand Down Expand Up @@ -1755,10 +1749,21 @@ void Awake()
DontDestroyOnLoad(this.gameObject);
}

void OnLevelWasLoaded(int level)
{
this.ResetTriggerTouches();
}
void OnEnable()
{
SceneManager.sceneLoaded += OnSceneFinishedLoading;
}

void OnDisable()
{
SceneManager.sceneLoaded -= OnSceneFinishedLoading;
}

// Callback made to replace obsolete method OnLevelWasLoaded(int)
void OnSceneFinishedLoading(Scene currentScene, LoadSceneMode mode)
{
this.ResetTriggerTouches();
}

void OnApplicationFocus(bool isWindowInFocusNow)
{
Expand Down
4 changes: 2 additions & 2 deletions XboxCtrlrInput/Assets/XboxCtrlrInputExample/MovePlayer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using XboxCtrlrInput; // Be sure to include this if you want an object to have Xbox input

public class MovePlayer : MonoBehaviour
Expand Down Expand Up @@ -243,7 +243,7 @@ void OnTriggerEnter(Collider other)
{
if(other.gameObject.CompareTag("KillField"))
{
Application.LoadLevel(Application.loadedLevel);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}

Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions XboxCtrlrInput/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
m_EditorVersion: 5.2.0f3
m_StandardAssetsVersion: 0
m_EditorVersion: 5.5.0f3
11 changes: 0 additions & 11 deletions XboxCtrlrInput/ProjectSettings/UnityAdsSettings.asset

This file was deleted.

10 changes: 0 additions & 10 deletions XboxCtrlrInput/ProjectSettings/UnityAnalyticsManager.asset

This file was deleted.

15 changes: 15 additions & 0 deletions XboxCtrlrInput/ProjectSettings/UnityConnectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
--- !u!310 &1
UnityConnectSettings:
m_ObjectHideFlags: 0
m_Enabled: 0
m_TestMode: 0
m_TestEventUrl:
m_TestConfigUrl:
CrashReportingSettings:
m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes
m_Enabled: 0
m_CaptureEditorExceptions: 1
UnityPurchasingSettings:
m_Enabled: 0
m_TestMode: 0
Expand All @@ -12,3 +20,10 @@ UnityConnectSettings:
m_TestMode: 0
m_TestEventUrl:
m_TestConfigUrl:
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_EnabledPlatforms: 4294967295
m_IosGameId:
m_AndroidGameId:

2 comments on commit 7ece072

@tregonzales
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyway to keep web support with new versions?

@JISyed
Copy link
Owner

@JISyed JISyed commented on 7ece072 Apr 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply. Unfortunately, Unity stopped supporting their Web Player plugin as stated on their site. If your project is still using Web Player, you would have to use the last version of XboxCtrlrInput that still supported it, which was v1.5.0.1.

Hope that helps a little bit.

Please sign in to comment.