Remove Discord RPC (for 1.8.2 only)
This commit is contained in:
@@ -1276,50 +1276,6 @@ MonoBehaviour:
|
|||||||
invert: 0
|
invert: 0
|
||||||
addMore: {r: 0, g: 0, b: 0, a: 0}
|
addMore: {r: 0, g: 0, b: 0, a: 0}
|
||||||
reverseAdd: 0
|
reverseAdd: 0
|
||||||
--- !u!1 &1178586317
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1178586319}
|
|
||||||
- component: {fileID: 1178586318}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: DiscordRPCHandler
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!114 &1178586318
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1178586317}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 56de20fc3e06f4c9ab65f9280b72723b, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::DiscordRPCHandler
|
|
||||||
--- !u!4 &1178586319
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1178586317}
|
|
||||||
serializedVersion: 2
|
|
||||||
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_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &1201615240
|
--- !u!1 &1201615240
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1624,7 +1580,6 @@ SceneRoots:
|
|||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_Roots:
|
m_Roots:
|
||||||
- {fileID: 705564545}
|
- {fileID: 705564545}
|
||||||
- {fileID: 1178586319}
|
|
||||||
- {fileID: 842325110}
|
- {fileID: 842325110}
|
||||||
- {fileID: 1547097374}
|
- {fileID: 1547097374}
|
||||||
- {fileID: 734849810}
|
- {fileID: 734849810}
|
||||||
|
|||||||
@@ -663,7 +663,6 @@ public class CustomGamePlayer : MonoBehaviour
|
|||||||
score += scoreAddAmount;
|
score += scoreAddAmount;
|
||||||
scoreText.text = $"Score: {Tools.FormatWithCommas(score)}";
|
scoreText.text = $"Score: {Tools.FormatWithCommas(score)}";
|
||||||
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Playing in custom mode", "Score: " + Tools.FormatWithCommas(score));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckIfGrounded()
|
void CheckIfGrounded()
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
using DiscordRPC;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class DiscordRPCHandler : MonoBehaviour
|
|
||||||
{
|
|
||||||
public static DiscordRPCHandler Instance;
|
|
||||||
public DiscordRpcClient client;
|
|
||||||
private readonly Timestamps timestamp = Timestamps.Now;
|
|
||||||
|
|
||||||
private bool isIdle = false;
|
|
||||||
private string savedDetails;
|
|
||||||
private string savedState;
|
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
if (Application.isMobilePlatform || Instance != null)
|
|
||||||
{
|
|
||||||
Destroy(gameObject);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Instance = this;
|
|
||||||
DontDestroyOnLoad(gameObject);
|
|
||||||
|
|
||||||
client = new DiscordRpcClient("1421877993176961155");
|
|
||||||
client.Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnApplicationQuit()
|
|
||||||
{
|
|
||||||
client.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnApplicationPause(bool pause)
|
|
||||||
{
|
|
||||||
isIdle = pause;
|
|
||||||
if (pause)
|
|
||||||
{
|
|
||||||
UpdateRPC("Idle", null, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UpdateRPC(savedDetails, savedState, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateRPC(string details, string state, bool force = false)
|
|
||||||
{
|
|
||||||
if (!force && isIdle)
|
|
||||||
{
|
|
||||||
savedDetails = details;
|
|
||||||
savedState = state;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
client.SetPresence(new RichPresence
|
|
||||||
{
|
|
||||||
Details = details,
|
|
||||||
State = state,
|
|
||||||
Assets = new Assets
|
|
||||||
{
|
|
||||||
LargeImageKey = "https://berrydash.lncvrt.xyz/assets/icon.png",
|
|
||||||
LargeImageText = "Berry Dash",
|
|
||||||
SmallImageKey = "https://cdn.lncvrt.xyz/pfp.png",
|
|
||||||
SmallImageText = "Made by Lncvrt!"
|
|
||||||
},
|
|
||||||
Buttons = new[]
|
|
||||||
{
|
|
||||||
new Button { Label = "Website", Url = "https://berrydash.lncvrt.xyz" },
|
|
||||||
new Button { Label = "Download", Url = "https://berrydash.lncvrt.xyz/download" }
|
|
||||||
},
|
|
||||||
Timestamps = timestamp
|
|
||||||
});
|
|
||||||
|
|
||||||
savedDetails = details;
|
|
||||||
savedState = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 56de20fc3e06f4c9ab65f9280b72723b
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class DiscordRPCUpdater : MonoBehaviour
|
|
||||||
{
|
|
||||||
public string details;
|
|
||||||
public string state;
|
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC(details, state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 74ebfdb8209384c82be16355035de665
|
|
||||||
@@ -678,7 +678,6 @@ public class GamePlayer : MonoBehaviour
|
|||||||
highScoreText.text = prefix + $"High Score: {Tools.FormatWithCommas(highscore) + suffix} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
highScoreText.text = prefix + $"High Score: {Tools.FormatWithCommas(highscore) + suffix} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
||||||
coinText.text = $"Coins: {Tools.FormatWithCommas(totalCoins)}";
|
coinText.text = $"Coins: {Tools.FormatWithCommas(totalCoins)}";
|
||||||
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Playing in normal mode", $"Score: {Tools.FormatWithCommas(score)} | High Score: {Tools.FormatWithCommas(highscore)}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckIfGrounded()
|
void CheckIfGrounded()
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class IconMarketplaceManager : MonoBehaviour
|
|||||||
normalPanel.SetActive(true);
|
normalPanel.SetActive(true);
|
||||||
downloadPanel.SetActive(false);
|
downloadPanel.SetActive(false);
|
||||||
uploadPanel.SetActive(false);
|
uploadPanel.SetActive(false);
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Choosing what to do in the icon marketplace", null);
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
foreach (Transform item in downloadPanelScript.content.transform)
|
foreach (Transform item in downloadPanelScript.content.transform)
|
||||||
@@ -60,14 +59,12 @@ public class IconMarketplaceManager : MonoBehaviour
|
|||||||
downloadPanel.SetActive(true);
|
downloadPanel.SetActive(true);
|
||||||
uploadPanel.SetActive(false);
|
uploadPanel.SetActive(false);
|
||||||
downloadPanelScript.Load();
|
downloadPanelScript.Load();
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Browsing the icon marketplace", "They have " + Tools.FormatWithCommas(BazookaManager.Instance.GetCustomBirdIconData().Balance) + " coins");
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
uploadPanelScript.Reset();
|
uploadPanelScript.Reset();
|
||||||
normalPanel.SetActive(false);
|
normalPanel.SetActive(false);
|
||||||
downloadPanel.SetActive(false);
|
downloadPanel.SetActive(false);
|
||||||
uploadPanel.SetActive(true);
|
uploadPanel.SetActive(true);
|
||||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Uploading an icon to the icon marketplace", null);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.lachee.discordrpc": "https://github.com/Lachee/discord-rpc-unity.git",
|
|
||||||
"com.nobi.roundedcorners": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git",
|
"com.nobi.roundedcorners": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git",
|
||||||
"com.unity.2d.animation": "12.0.2",
|
"com.unity.2d.animation": "12.0.2",
|
||||||
"com.unity.2d.aseprite": "2.0.2",
|
"com.unity.2d.aseprite": "2.0.2",
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.lachee.discordrpc": {
|
|
||||||
"version": "https://github.com/Lachee/discord-rpc-unity.git",
|
|
||||||
"depth": 0,
|
|
||||||
"source": "git",
|
|
||||||
"dependencies": {
|
|
||||||
"com.unity.nuget.newtonsoft-json": "3.0.3"
|
|
||||||
},
|
|
||||||
"hash": "791aa95d2aecac9de423aa260f1f569755308a93"
|
|
||||||
},
|
|
||||||
"com.nobi.roundedcorners": {
|
"com.nobi.roundedcorners": {
|
||||||
"version": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git",
|
"version": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user