Add selected clear sounter highlight
This commit is contained in:
parent
5772da3965
commit
989648c00b
18 changed files with 352 additions and 127 deletions
2
.erp
2
.erp
|
@ -5,7 +5,7 @@
|
|||
<resetOnSceneChange>false</resetOnSceneChange>
|
||||
<debugMode>false</debugMode>
|
||||
<EditorClosed>true</EditorClosed>
|
||||
<LastTimestamp>1677518740</LastTimestamp>
|
||||
<LastTimestamp>1677527499</LastTimestamp>
|
||||
<LastSessionID>522683637854076046</LastSessionID>
|
||||
<Errored>false</Errored>
|
||||
</ERPSettings>
|
|
@ -1,15 +1,11 @@
|
|||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using ERP.Discord;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
namespace ERP
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ERP
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ERP
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
namespace ERP.Discord
|
||||
namespace ERP.Discord
|
||||
{
|
||||
public partial class ActivityManager
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
namespace ERP.Discord
|
||||
namespace ERP.Discord
|
||||
{
|
||||
static class Constants
|
||||
{
|
||||
|
|
|
@ -1041,7 +1041,8 @@ namespace ERP.Discord
|
|||
Marshal.FreeHGlobal(StoreEventsPtr);
|
||||
Marshal.FreeHGlobal(VoiceEventsPtr);
|
||||
Marshal.FreeHGlobal(AchievementEventsPtr);
|
||||
if (setLogHook.HasValue) {
|
||||
if (setLogHook.HasValue)
|
||||
{
|
||||
setLogHook.Value.Free();
|
||||
}
|
||||
}
|
||||
|
@ -1065,7 +1066,8 @@ namespace ERP.Discord
|
|||
|
||||
public void SetLogHook(LogLevel minLevel, SetLogHookHandler callback)
|
||||
{
|
||||
if (setLogHook.HasValue) {
|
||||
if (setLogHook.HasValue)
|
||||
{
|
||||
setLogHook.Value.Free();
|
||||
}
|
||||
setLogHook = GCHandle.Alloc(callback);
|
||||
|
@ -1074,7 +1076,8 @@ namespace ERP.Discord
|
|||
|
||||
public ApplicationManager GetApplicationManager()
|
||||
{
|
||||
if (ApplicationManagerInstance == null) {
|
||||
if (ApplicationManagerInstance == null)
|
||||
{
|
||||
ApplicationManagerInstance = new ApplicationManager(
|
||||
Methods.GetApplicationManager(MethodsPtr),
|
||||
ApplicationEventsPtr,
|
||||
|
@ -1086,7 +1089,8 @@ namespace ERP.Discord
|
|||
|
||||
public UserManager GetUserManager()
|
||||
{
|
||||
if (UserManagerInstance == null) {
|
||||
if (UserManagerInstance == null)
|
||||
{
|
||||
UserManagerInstance = new UserManager(
|
||||
Methods.GetUserManager(MethodsPtr),
|
||||
UserEventsPtr,
|
||||
|
@ -1098,7 +1102,8 @@ namespace ERP.Discord
|
|||
|
||||
public ImageManager GetImageManager()
|
||||
{
|
||||
if (ImageManagerInstance == null) {
|
||||
if (ImageManagerInstance == null)
|
||||
{
|
||||
ImageManagerInstance = new ImageManager(
|
||||
Methods.GetImageManager(MethodsPtr),
|
||||
ImageEventsPtr,
|
||||
|
@ -1110,7 +1115,8 @@ namespace ERP.Discord
|
|||
|
||||
public ActivityManager GetActivityManager()
|
||||
{
|
||||
if (ActivityManagerInstance == null) {
|
||||
if (ActivityManagerInstance == null)
|
||||
{
|
||||
ActivityManagerInstance = new ActivityManager(
|
||||
Methods.GetActivityManager(MethodsPtr),
|
||||
ActivityEventsPtr,
|
||||
|
@ -1122,7 +1128,8 @@ namespace ERP.Discord
|
|||
|
||||
public RelationshipManager GetRelationshipManager()
|
||||
{
|
||||
if (RelationshipManagerInstance == null) {
|
||||
if (RelationshipManagerInstance == null)
|
||||
{
|
||||
RelationshipManagerInstance = new RelationshipManager(
|
||||
Methods.GetRelationshipManager(MethodsPtr),
|
||||
RelationshipEventsPtr,
|
||||
|
@ -1134,7 +1141,8 @@ namespace ERP.Discord
|
|||
|
||||
public LobbyManager GetLobbyManager()
|
||||
{
|
||||
if (LobbyManagerInstance == null) {
|
||||
if (LobbyManagerInstance == null)
|
||||
{
|
||||
LobbyManagerInstance = new LobbyManager(
|
||||
Methods.GetLobbyManager(MethodsPtr),
|
||||
LobbyEventsPtr,
|
||||
|
@ -1146,7 +1154,8 @@ namespace ERP.Discord
|
|||
|
||||
public NetworkManager GetNetworkManager()
|
||||
{
|
||||
if (NetworkManagerInstance == null) {
|
||||
if (NetworkManagerInstance == null)
|
||||
{
|
||||
NetworkManagerInstance = new NetworkManager(
|
||||
Methods.GetNetworkManager(MethodsPtr),
|
||||
NetworkEventsPtr,
|
||||
|
@ -1158,7 +1167,8 @@ namespace ERP.Discord
|
|||
|
||||
public OverlayManager GetOverlayManager()
|
||||
{
|
||||
if (OverlayManagerInstance == null) {
|
||||
if (OverlayManagerInstance == null)
|
||||
{
|
||||
OverlayManagerInstance = new OverlayManager(
|
||||
Methods.GetOverlayManager(MethodsPtr),
|
||||
OverlayEventsPtr,
|
||||
|
@ -1170,7 +1180,8 @@ namespace ERP.Discord
|
|||
|
||||
public StorageManager GetStorageManager()
|
||||
{
|
||||
if (StorageManagerInstance == null) {
|
||||
if (StorageManagerInstance == null)
|
||||
{
|
||||
StorageManagerInstance = new StorageManager(
|
||||
Methods.GetStorageManager(MethodsPtr),
|
||||
StorageEventsPtr,
|
||||
|
@ -1182,7 +1193,8 @@ namespace ERP.Discord
|
|||
|
||||
public StoreManager GetStoreManager()
|
||||
{
|
||||
if (StoreManagerInstance == null) {
|
||||
if (StoreManagerInstance == null)
|
||||
{
|
||||
StoreManagerInstance = new StoreManager(
|
||||
Methods.GetStoreManager(MethodsPtr),
|
||||
StoreEventsPtr,
|
||||
|
@ -1194,7 +1206,8 @@ namespace ERP.Discord
|
|||
|
||||
public VoiceManager GetVoiceManager()
|
||||
{
|
||||
if (VoiceManagerInstance == null) {
|
||||
if (VoiceManagerInstance == null)
|
||||
{
|
||||
VoiceManagerInstance = new VoiceManager(
|
||||
Methods.GetVoiceManager(MethodsPtr),
|
||||
VoiceEventsPtr,
|
||||
|
@ -1206,7 +1219,8 @@ namespace ERP.Discord
|
|||
|
||||
public AchievementManager GetAchievementManager()
|
||||
{
|
||||
if (AchievementManagerInstance == null) {
|
||||
if (AchievementManagerInstance == null)
|
||||
{
|
||||
AchievementManagerInstance = new AchievementManager(
|
||||
Methods.GetAchievementManager(MethodsPtr),
|
||||
AchievementEventsPtr,
|
||||
|
@ -1293,12 +1307,14 @@ namespace ERP.Discord
|
|||
|
||||
internal ApplicationManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -1431,12 +1447,14 @@ namespace ERP.Discord
|
|||
|
||||
internal UserManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -1558,12 +1576,14 @@ namespace ERP.Discord
|
|||
|
||||
internal ImageManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -1734,12 +1754,14 @@ namespace ERP.Discord
|
|||
|
||||
internal ActivityManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -1963,12 +1985,14 @@ namespace ERP.Discord
|
|||
|
||||
internal RelationshipManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -2372,12 +2396,14 @@ namespace ERP.Discord
|
|||
|
||||
internal LobbyManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -2972,12 +2998,14 @@ namespace ERP.Discord
|
|||
|
||||
internal NetworkManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -3196,12 +3224,14 @@ namespace ERP.Discord
|
|||
|
||||
internal OverlayManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -3399,12 +3429,14 @@ namespace ERP.Discord
|
|||
|
||||
internal StorageManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -3656,12 +3688,14 @@ namespace ERP.Discord
|
|||
|
||||
internal StoreManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -3903,12 +3937,14 @@ namespace ERP.Discord
|
|||
|
||||
internal VoiceManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
@ -4110,12 +4146,14 @@ namespace ERP.Discord
|
|||
|
||||
internal AchievementManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
|
||||
{
|
||||
if (eventsPtr == IntPtr.Zero) {
|
||||
if (eventsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
InitEvents(eventsPtr, ref events);
|
||||
MethodsPtr = ptr;
|
||||
if (MethodsPtr == IntPtr.Zero) {
|
||||
if (MethodsPtr == IntPtr.Zero)
|
||||
{
|
||||
throw new ResultException(Result.InternalError);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
using UnityEngine;
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ERP.Discord
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ERP.Discord
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@ Transform:
|
|||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 3231759315905380366}
|
||||
- {fileID: 4409201660398974582}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: -180.325, z: 0}
|
||||
|
@ -67,6 +68,150 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: bb159edc225081c408fe7a01d52732e4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1001 &180516218137596637
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 6371086230447438899}
|
||||
m_Modifications:
|
||||
- target: {fileID: 3984833892277163771, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 1a0afd856a35421469b28b916116fd9c, type: 2}
|
||||
- target: {fileID: 4589716710238282922, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Selected
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282922, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 1.01
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 1.01
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 1.01
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8489276541531669327, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 4589716710238282922, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 6941436636027395465}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 0004cb1e11ad014419b943c7da960724, type: 3}
|
||||
--- !u!4 &4409201660398974582 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4589716710238282923, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 180516218137596637}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &4409201660398974583 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 4589716710238282922, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 180516218137596637}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &6941436636027395465
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4409201660398974583}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6b8e4c74ab1ad4b4a8c3676f33904e52, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
clearCounter: {fileID: 7837983985068458341}
|
||||
visualGameObject: {fileID: 8596996214292255122}
|
||||
--- !u!1 &8596996214292255122 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 8489276541531669327, guid: 0004cb1e11ad014419b943c7da960724,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 180516218137596637}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1398491922627355813
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ClearCounter : MonoBehaviour
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameInput : MonoBehaviour
|
||||
|
|
|
@ -1,16 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
public class Player : MonoBehaviour
|
||||
{
|
||||
|
||||
public static Player Instance { get; private set; }
|
||||
|
||||
public event EventHandler<OnSelectedCounterChangedEventArgs> OnSelectedcounterChanged;
|
||||
public class OnSelectedCounterChangedEventArgs : EventArgs
|
||||
{
|
||||
public ClearCounter selectedCounter;
|
||||
}
|
||||
|
||||
[SerializeField] private float moveSpeed = 7f;
|
||||
[SerializeField] private GameInput gameInput;
|
||||
[SerializeField] private LayerMask countersLayerMask;
|
||||
|
||||
private bool isWalking;
|
||||
private Vector3 lastInteractDir;
|
||||
private ClearCounter selectedCounter;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
@ -19,26 +28,19 @@ public class Player : MonoBehaviour
|
|||
|
||||
private void GameInput_OnInteractAction(object sender, System.EventArgs e)
|
||||
{
|
||||
Vector2 inputVector = gameInput.GetMovementVectorNormalized();
|
||||
|
||||
Vector3 moveDir = new Vector3(inputVector.x, 0f, inputVector.y);
|
||||
|
||||
// Kepp a constantly updating record of the last move direction.
|
||||
// This means you can interact without holding down a direction.
|
||||
if (moveDir != Vector3.zero)
|
||||
if (selectedCounter != null)
|
||||
{
|
||||
lastInteractDir = moveDir;
|
||||
}
|
||||
|
||||
float interactDistance = 2f;
|
||||
if (Physics.Raycast(transform.position, lastInteractDir, out RaycastHit raycastHit, interactDistance, countersLayerMask))
|
||||
{
|
||||
if (raycastHit.transform.TryGetComponent(out ClearCounter clearCounter))
|
||||
{
|
||||
// Has Clear Counter
|
||||
clearCounter.Interact();
|
||||
selectedCounter.Interact();
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
Debug.LogError("There is more than one player instance!");
|
||||
}
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
@ -74,9 +76,21 @@ public class Player : MonoBehaviour
|
|||
if (raycastHit.transform.TryGetComponent(out ClearCounter clearCounter))
|
||||
{
|
||||
// Has Clear Counter
|
||||
//clearCounter.Interact();
|
||||
if (clearCounter != selectedCounter)
|
||||
{
|
||||
SetSelectedCounter(clearCounter);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSelectedCounter(null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSelectedCounter(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -131,4 +145,14 @@ public class Player : MonoBehaviour
|
|||
transform.forward = Vector3.Slerp(transform.forward, moveDir, Time.deltaTime * rotateSpeed);
|
||||
}
|
||||
|
||||
private void SetSelectedCounter(ClearCounter selectedCounter)
|
||||
{
|
||||
this.selectedCounter = selectedCounter;
|
||||
|
||||
OnSelectedcounterChanged?.Invoke(this, new OnSelectedCounterChangedEventArgs
|
||||
{
|
||||
selectedCounter = selectedCounter,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerAnimator : MonoBehaviour
|
||||
|
|
34
Assets/Scripts/SelectedCounterVisual.cs
Normal file
34
Assets/Scripts/SelectedCounterVisual.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class SelectedCounterVisual : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] private ClearCounter clearCounter;
|
||||
[SerializeField] private GameObject visualGameObject;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Player.Instance.OnSelectedcounterChanged += Player_OnSelectedcounterChanged;
|
||||
}
|
||||
|
||||
private void Player_OnSelectedcounterChanged(object sender, Player.OnSelectedCounterChangedEventArgs e)
|
||||
{
|
||||
if (e.selectedCounter == clearCounter)
|
||||
{
|
||||
Show();
|
||||
} else
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void Show()
|
||||
{
|
||||
visualGameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
visualGameObject.SetActive(false);
|
||||
}
|
||||
}
|
11
Assets/Scripts/SelectedCounterVisual.cs.meta
Normal file
11
Assets/Scripts/SelectedCounterVisual.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b8e4c74ab1ad4b4a8c3676f33904e52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in a new issue