fixed issues with triggers at witch house
This commit is contained in:
@@ -3,7 +3,7 @@ guid: 13b0b2580c6a0ac409e4c872eb2276c2
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 13
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 1
|
enableMipMap: 1
|
||||||
@@ -20,11 +20,12 @@ TextureImporter:
|
|||||||
externalNormalMap: 0
|
externalNormalMap: 0
|
||||||
heightScale: 0.25
|
heightScale: 0.25
|
||||||
normalMapFilter: 0
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
isReadable: 0
|
isReadable: 0
|
||||||
streamingMipmaps: 0
|
streamingMipmaps: 0
|
||||||
streamingMipmapsPriority: 0
|
streamingMipmapsPriority: 0
|
||||||
vTOnly: 0
|
vTOnly: 0
|
||||||
ignoreMasterTextureLimit: 0
|
ignoreMipmapLimit: 0
|
||||||
grayScaleToAlpha: 0
|
grayScaleToAlpha: 0
|
||||||
generateCubemap: 6
|
generateCubemap: 6
|
||||||
cubemapConvolution: 0
|
cubemapConvolution: 0
|
||||||
@@ -53,7 +54,7 @@ TextureImporter:
|
|||||||
alphaUsage: 1
|
alphaUsage: 1
|
||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 1
|
||||||
textureShape: 1
|
textureShape: 1
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
@@ -63,8 +64,10 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 0
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -74,9 +77,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -86,10 +90,11 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: iPhone
|
buildTarget: iOS
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: 31
|
textureFormat: 31
|
||||||
@@ -98,9 +103,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 1
|
overridden: 1
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -110,10 +116,11 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Windows Store Apps
|
buildTarget: WindowsStoreApps
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
@@ -122,9 +129,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Server
|
buildTarget: Server
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -134,12 +142,14 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
outline: []
|
outline: []
|
||||||
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID:
|
spriteID:
|
||||||
@@ -149,10 +159,11 @@ TextureImporter:
|
|||||||
edges: []
|
edges: []
|
||||||
weights: []
|
weights: []
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
|
spriteCustomMetadata:
|
||||||
|
entries: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable: {}
|
||||||
spritePackingTag:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
pSDShowRemoveMatteOption: 0
|
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ guid: 9b2b239ac9a1c9a4e9dd08c571fb7a24
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 13
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 1
|
enableMipMap: 1
|
||||||
@@ -20,11 +20,12 @@ TextureImporter:
|
|||||||
externalNormalMap: 0
|
externalNormalMap: 0
|
||||||
heightScale: 0.25
|
heightScale: 0.25
|
||||||
normalMapFilter: 0
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
isReadable: 0
|
isReadable: 0
|
||||||
streamingMipmaps: 0
|
streamingMipmaps: 0
|
||||||
streamingMipmapsPriority: 0
|
streamingMipmapsPriority: 0
|
||||||
vTOnly: 0
|
vTOnly: 0
|
||||||
ignoreMasterTextureLimit: 0
|
ignoreMipmapLimit: 0
|
||||||
grayScaleToAlpha: 0
|
grayScaleToAlpha: 0
|
||||||
generateCubemap: 6
|
generateCubemap: 6
|
||||||
cubemapConvolution: 0
|
cubemapConvolution: 0
|
||||||
@@ -53,7 +54,7 @@ TextureImporter:
|
|||||||
alphaUsage: 1
|
alphaUsage: 1
|
||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 1
|
||||||
textureShape: 1
|
textureShape: 1
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
@@ -63,8 +64,10 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 0
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -74,9 +77,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -86,10 +90,11 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: iPhone
|
buildTarget: iOS
|
||||||
maxTextureSize: 1024
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: 30
|
textureFormat: 30
|
||||||
@@ -98,9 +103,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 1
|
overridden: 1
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -110,10 +116,11 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Windows Store Apps
|
buildTarget: WindowsStoreApps
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
@@ -122,9 +129,10 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 4
|
||||||
buildTarget: Server
|
buildTarget: Server
|
||||||
maxTextureSize: 8192
|
maxTextureSize: 8192
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
@@ -134,12 +142,14 @@ TextureImporter:
|
|||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
outline: []
|
outline: []
|
||||||
|
customData:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID:
|
spriteID:
|
||||||
@@ -149,10 +159,11 @@ TextureImporter:
|
|||||||
edges: []
|
edges: []
|
||||||
weights: []
|
weights: []
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
|
spriteCustomMetadata:
|
||||||
|
entries: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable: {}
|
||||||
spritePackingTag:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
pSDShowRemoveMatteOption: 0
|
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -29,88 +29,16 @@ namespace Beyond
|
|||||||
|
|
||||||
public static Action<TriggerDescriptor> ActionTriggerEnter;
|
public static Action<TriggerDescriptor> ActionTriggerEnter;
|
||||||
public static Action<TriggerDescriptor> ActionTriggerExit;
|
public static Action<TriggerDescriptor> ActionTriggerExit;
|
||||||
/*
|
|
||||||
public static Action<GameObject> LadderTriggerEnter;
|
|
||||||
public static Action<GameObject> LadderTriggerExit;
|
|
||||||
|
|
||||||
public static Action<GameObject> FootbridgeTriggerEnter;
|
|
||||||
public static Action<GameObject> FootbridgeTriggerExit;
|
|
||||||
|
|
||||||
public static Action<GameObject> EnterFootbridge;
|
|
||||||
public static Action<GameObject> ExitFootbridge;
|
|
||||||
public UnityEvent OnHideOnTriggerEnter;
|
|
||||||
public UnityEvent OnHideOnTriggerExit;
|
|
||||||
|
|
||||||
public UnityEvent OnActionTriggerEnter;
|
|
||||||
public UnityEvent OnActionTriggerExit;
|
|
||||||
|
|
||||||
public UnityEvent OnLadderTriggerEnter;
|
|
||||||
public UnityEvent OnLadderTriggerExit;
|
|
||||||
|
|
||||||
public UnityEvent OnFootbridgeTriggerEnter;
|
|
||||||
public UnityEvent OnFootbridgeTriggerExit;
|
|
||||||
|
|
||||||
public UnityEvent OnEnterFootbridge;
|
|
||||||
public UnityEvent OnExitFootbridge;
|
|
||||||
*/
|
|
||||||
|
|
||||||
private bool usingFootbridge;
|
private bool usingFootbridge;
|
||||||
|
|
||||||
private TriggerDescriptor m_currentDesc;
|
private TriggerDescriptor m_currentDesc;
|
||||||
|
|
||||||
private List<TriggerDescriptor> m_Triggers = new List<TriggerDescriptor>();
|
private List<TriggerDescriptor> m_Triggers = new List<TriggerDescriptor>();
|
||||||
|
|
||||||
|
// NEW: Dictionary for reference counting to handle multiple colliders
|
||||||
|
private Dictionary<TriggerDescriptor, int> m_TriggerCounts = new Dictionary<TriggerDescriptor, int>();
|
||||||
|
|
||||||
private GameStateManager.State m_prevGameState = GameStateManager.State.NORMAL;
|
private GameStateManager.State m_prevGameState = GameStateManager.State.NORMAL;
|
||||||
|
|
||||||
/*
|
|
||||||
private List<TriggerObject> m_triggers = new List<TriggerObject>();
|
|
||||||
public enum TriggerType
|
|
||||||
{
|
|
||||||
Dialogue,
|
|
||||||
Ladder,
|
|
||||||
Generic,
|
|
||||||
Collectable,
|
|
||||||
COUNT
|
|
||||||
};
|
|
||||||
|
|
||||||
public struct TriggerObject : IComparable<TriggerObject>, IComparable
|
|
||||||
{
|
|
||||||
public GameObject obj;
|
|
||||||
public TriggerType type;
|
|
||||||
|
|
||||||
public int CompareTo(TriggerObject other)
|
|
||||||
{
|
|
||||||
return type.CompareTo(other.type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int CompareTo(object obj)
|
|
||||||
{
|
|
||||||
if (ReferenceEquals(null, obj)) return 1;
|
|
||||||
return obj is TriggerObject other ? CompareTo(other) : throw new ArgumentException($"Object must be of type {nameof(TriggerObject)}");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator <(TriggerObject left, TriggerObject right)
|
|
||||||
{
|
|
||||||
return left.CompareTo(right) < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator >(TriggerObject left, TriggerObject right)
|
|
||||||
{
|
|
||||||
return left.CompareTo(right) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator <=(TriggerObject left, TriggerObject right)
|
|
||||||
{
|
|
||||||
return left.CompareTo(right) <= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator >=(TriggerObject left, TriggerObject right)
|
|
||||||
{
|
|
||||||
return left.CompareTo(right) >= 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
private void Initialize()
|
private void Initialize()
|
||||||
{
|
{
|
||||||
if (LadderButton)
|
if (LadderButton)
|
||||||
@@ -133,11 +61,6 @@ return left.CompareTo(right) >= 0;
|
|||||||
}
|
}
|
||||||
if (RunButton)
|
if (RunButton)
|
||||||
RunButton.gameObject.SetActive(!disableRun);
|
RunButton.gameObject.SetActive(!disableRun);
|
||||||
|
|
||||||
//if (TargetButton)
|
|
||||||
// TargetButton.gameObject.SetActive(true);
|
|
||||||
//if (JumpButton)
|
|
||||||
// JumpButton.gameObject.SetActive(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnActionTrigger(bool activate, TriggerDescriptor.TriggerType type)
|
private void OnActionTrigger(bool activate, TriggerDescriptor.TriggerType type)
|
||||||
@@ -162,37 +85,21 @@ return left.CompareTo(right) >= 0;
|
|||||||
AttackButton.gameObject.SetActive(!activate);
|
AttackButton.gameObject.SetActive(!activate);
|
||||||
if (SpellButton)
|
if (SpellButton)
|
||||||
SpellButton.gameObject.SetActive(!activate);
|
SpellButton.gameObject.SetActive(!activate);
|
||||||
//if (ComsumableButton)
|
|
||||||
// ComsumableButton.gameObject.SetActive(!activate);
|
|
||||||
//if (ComsumableFaithButton)
|
|
||||||
// ComsumableFaithButton.gameObject.SetActive(!activate);
|
|
||||||
if (powerButtonsParent)
|
if (powerButtonsParent)
|
||||||
{
|
{
|
||||||
powerButtonsParent.SetActive(!activate);
|
powerButtonsParent.SetActive(!activate);
|
||||||
}
|
}
|
||||||
if (RunButton && !disableRun)
|
if (RunButton && !disableRun)
|
||||||
RunButton.interactable = !activate;
|
RunButton.interactable = !activate;
|
||||||
//if (TargetButton)
|
|
||||||
// TargetButton.interactable = !activate;
|
|
||||||
//if (JumpButton)
|
|
||||||
// JumpButton.interactable = !activate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
ActionTriggerEnter += OnInvokeActionTriggerEnter;
|
ActionTriggerEnter += OnInvokeActionTriggerEnter;
|
||||||
ActionTriggerExit += OnInvokeActionTriggerExit;
|
ActionTriggerExit += OnInvokeActionTriggerExit;
|
||||||
GameStateManager.Instance.m_OnStateChanged.AddListener(OnGameStateChanged);
|
if (GameStateManager.Instance)
|
||||||
|
GameStateManager.Instance.m_OnStateChanged.AddListener(OnGameStateChanged);
|
||||||
|
|
||||||
/*
|
|
||||||
LadderTriggerEnter += OnInvokeLadderTriggerEnter;
|
|
||||||
LadderTriggerExit += OnInvokeLadderTriggerExit;
|
|
||||||
FootbridgeTriggerEnter += OnInvokeFootbridgeTriggerEnter;
|
|
||||||
FootbridgeTriggerExit += OnInvokeFootbridgeTriggerExit;
|
|
||||||
EnterFootbridge += OnInvokeEnterFootbridge;
|
|
||||||
ExitFootbridge += OnInvokeExitFootbridge;
|
|
||||||
*/
|
|
||||||
//OnInvokeActionTriggerExit(gameObject);
|
|
||||||
Initialize();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,14 +109,6 @@ return left.CompareTo(right) >= 0;
|
|||||||
ActionTriggerExit -= OnInvokeActionTriggerExit;
|
ActionTriggerExit -= OnInvokeActionTriggerExit;
|
||||||
if (GameStateManager.Instance)
|
if (GameStateManager.Instance)
|
||||||
GameStateManager.Instance.m_OnStateChanged.RemoveListener(OnGameStateChanged);
|
GameStateManager.Instance.m_OnStateChanged.RemoveListener(OnGameStateChanged);
|
||||||
/*
|
|
||||||
LadderTriggerEnter -= OnInvokeLadderTriggerEnter;
|
|
||||||
LadderTriggerExit -= OnInvokeLadderTriggerExit;
|
|
||||||
FootbridgeTriggerEnter -= OnInvokeFootbridgeTriggerEnter;
|
|
||||||
FootbridgeTriggerExit -= OnInvokeFootbridgeTriggerExit;
|
|
||||||
EnterFootbridge -= OnInvokeEnterFootbridge;
|
|
||||||
ExitFootbridge -= OnInvokeExitFootbridge;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGameStateChanged(GameStateManager.State state)
|
void OnGameStateChanged(GameStateManager.State state)
|
||||||
@@ -234,99 +133,48 @@ return left.CompareTo(right) >= 0;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// CORRECTED: Handles multiple colliders entering the same trigger.
|
||||||
private void OnInvokeHideOnTriggerEnter()
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeHideOnTriggerEnter");
|
|
||||||
OnHideOnTriggerEnter?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeHideOnTriggerExit()
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeHideOnTriggerExit");
|
|
||||||
OnHideOnTriggerExit?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeEnterFootbridge(GameObject gameObject)
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeEnterFootbridge");
|
|
||||||
usingFootbridge = true;
|
|
||||||
OnInvokeHideOnTriggerEnter();
|
|
||||||
OnEnterFootbridge?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeExitFootbridge(GameObject gameObject)
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeExitFootbridge");
|
|
||||||
usingFootbridge = false;
|
|
||||||
OnInvokeHideOnTriggerExit();
|
|
||||||
OnExitFootbridge?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeFootbridgeTriggerEnter(GameObject gameObject)
|
|
||||||
{
|
|
||||||
if (usingFootbridge) return;
|
|
||||||
DebugLog("OnInvokeFootbridgeTriggerEnter");
|
|
||||||
OnFootbridgeTriggerEnter?.Invoke();
|
|
||||||
OnInvokeHideOnTriggerEnter();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeFootbridgeTriggerExit(GameObject gameObject)
|
|
||||||
{
|
|
||||||
if (usingFootbridge) return;
|
|
||||||
DebugLog("OnInvokeFootbridgeTriggerExit");
|
|
||||||
OnFootbridgeTriggerExit?.Invoke();
|
|
||||||
OnInvokeHideOnTriggerExit();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
private void OnInvokeActionTriggerEnter(TriggerDescriptor to)
|
private void OnInvokeActionTriggerEnter(TriggerDescriptor to)
|
||||||
{
|
{
|
||||||
DebugLog("OnInvokeActionTriggerEnter");
|
DebugLog("OnInvokeActionTriggerEnter for: " + to.obj.name);
|
||||||
//OnActionTrigger(true, to.type);
|
if (!m_TriggerCounts.ContainsKey(to))
|
||||||
//OnActionTriggerEnter?.Invoke();
|
{
|
||||||
//OnInvokeHideOnTriggerEnter();
|
|
||||||
if (!m_Triggers.Contains(to))
|
|
||||||
m_Triggers.Add(to);
|
m_Triggers.Add(to);
|
||||||
|
m_TriggerCounts.Add(to, 1); // Add to dictionary with a count of 1.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_TriggerCounts[to]++; // If already present, just increment the count.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CORRECTED: Handles multiple colliders exiting the same trigger.
|
||||||
private void OnInvokeActionTriggerExit(TriggerDescriptor to)
|
private void OnInvokeActionTriggerExit(TriggerDescriptor to)
|
||||||
{
|
{
|
||||||
//OnActionTrigger(false, to.type);
|
DebugLog("OnInvokeActionTriggerExit for: " + to.obj.name);
|
||||||
DebugLog("OnInvokeActionTriggerExit");
|
if (m_TriggerCounts.ContainsKey(to))
|
||||||
//OnActionTriggerExit?.Invoke();
|
|
||||||
//OnInvokeHideOnTriggerExit();
|
|
||||||
if (m_Triggers.Contains(to))
|
|
||||||
{
|
{
|
||||||
m_Triggers.Remove(to);
|
m_TriggerCounts[to]--; // Decrement the reference count.
|
||||||
if (to == m_currentDesc)
|
|
||||||
|
// Only remove the trigger completely if this was the last collider to exit.
|
||||||
|
if (m_TriggerCounts[to] <= 0)
|
||||||
{
|
{
|
||||||
OnActionTrigger(false, to.type);
|
m_TriggerCounts.Remove(to); // Clean up the dictionary.
|
||||||
m_currentDesc = null;
|
m_Triggers.Remove(to);
|
||||||
|
if (to == m_currentDesc)
|
||||||
|
{
|
||||||
|
OnActionTrigger(false, to.type);
|
||||||
|
m_currentDesc = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// This error should no longer occur with the new logic.
|
||||||
Debug.LogError("Exitting trigger that is not on the list! " + to.obj.name, this);
|
Debug.LogError("Exitting trigger that is not on the list! " + to.obj.name, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
private void OnInvokeLadderTriggerEnter(GameObject gameObject)
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeLadderTriggerEnter");
|
|
||||||
OnLadderTriggerEnter?.Invoke();
|
|
||||||
OnInvokeHideOnTriggerEnter();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnInvokeLadderTriggerExit(GameObject gameObject)
|
|
||||||
{
|
|
||||||
DebugLog("OnInvokeLadderTriggerExit");
|
|
||||||
OnLadderTriggerExit?.Invoke();
|
|
||||||
OnInvokeHideOnTriggerExit();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
var gameState = GameStateManager.Instance.CurrentState;
|
var gameState = GameStateManager.Instance.CurrentState;
|
||||||
@@ -371,6 +219,12 @@ return left.CompareTo(right) >= 0;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// This handles the case where the last trigger was removed from the list
|
||||||
|
else if (m_currentDesc != null)
|
||||||
|
{
|
||||||
|
OnActionTrigger(false, m_currentDesc.type);
|
||||||
|
m_currentDesc = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,8 +25,6 @@ namespace Beyond
|
|||||||
public bool disableHUD = true;
|
public bool disableHUD = true;
|
||||||
|
|
||||||
[vHelpBox("Changes interaction image")]
|
[vHelpBox("Changes interaction image")]
|
||||||
//public bool isDialogueTrigger = false;
|
|
||||||
|
|
||||||
public TriggerDescriptor.TriggerType triggerType = TriggerDescriptor.TriggerType.Generic;
|
public TriggerDescriptor.TriggerType triggerType = TriggerDescriptor.TriggerType.Generic;
|
||||||
|
|
||||||
public UnityEvent OnPlayerMatchTargetPosition;
|
public UnityEvent OnPlayerMatchTargetPosition;
|
||||||
@@ -130,6 +128,11 @@ namespace Beyond
|
|||||||
|
|
||||||
private void OnActionEndAnimation(GameObject gameObject)
|
private void OnActionEndAnimation(GameObject gameObject)
|
||||||
{
|
{
|
||||||
|
// THIS SECTION WAS THE PRIMARY CAUSE OF THE DOUBLE-EXIT CALL.
|
||||||
|
// The logic below was removed because the trigger exit should only happen
|
||||||
|
// when the player physically leaves the collider, which is already
|
||||||
|
// handled by the OnInvalidate event that calls OnActionTriggerExit.
|
||||||
|
/*
|
||||||
if (disableHUD)
|
if (disableHUD)
|
||||||
{
|
{
|
||||||
ActionTriggerEvent.ActionTriggerExit?.Invoke(m_triggerDescriptor);
|
ActionTriggerEvent.ActionTriggerExit?.Invoke(m_triggerDescriptor);
|
||||||
@@ -139,6 +142,7 @@ namespace Beyond
|
|||||||
{
|
{
|
||||||
Player.Instance.ResetIntaractableButtonImage();
|
Player.Instance.ResetIntaractableButtonImage();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (!m_enableInteractionLegality)
|
if (!m_enableInteractionLegality)
|
||||||
{
|
{
|
||||||
@@ -165,12 +169,10 @@ namespace Beyond
|
|||||||
{
|
{
|
||||||
m_faded = true;
|
m_faded = true;
|
||||||
FadeCanvasGroup.Instance.FadeOut(1f / m_fadeSpeed);
|
FadeCanvasGroup.Instance.FadeOut(1f / m_fadeSpeed);
|
||||||
//.InvokeFade(m_fadeInCurve, m_fadeSpeed);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FadeCanvasGroup.Instance.FadeIn(1f / m_fadeSpeed);
|
FadeCanvasGroup.Instance.FadeIn(1f / m_fadeSpeed);
|
||||||
//FadeCanvasGroup.InvokeFade(m_fadeOutCurve, m_fadeSpeed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFadeInEnd()
|
private void OnFadeInEnd()
|
||||||
|
|||||||
@@ -37,27 +37,35 @@ namespace Beyond
|
|||||||
{
|
{
|
||||||
MessageSystem.AddListener(this, QuestMachineMessages.QuestStateChangedMessage, string.Empty);
|
MessageSystem.AddListener(this, QuestMachineMessages.QuestStateChangedMessage, string.Empty);
|
||||||
m_menuScroll = FindObjectOfType<MenuScroll>();
|
m_menuScroll = FindObjectOfType<MenuScroll>();
|
||||||
m_menuScroll.OnOpened += DisableButtonImage;
|
if (m_menuScroll != null)
|
||||||
m_menuScroll.OnClosed += EnableButtonImage;
|
{
|
||||||
|
m_menuScroll.OnOpened += DisableButtonImage;
|
||||||
|
m_menuScroll.OnClosed += EnableButtonImage;
|
||||||
|
}
|
||||||
|
|
||||||
m_UIPanel.onOpen.AddListener(OnOpen);
|
if (m_UIPanel != null)
|
||||||
m_UIPanel.onClose.AddListener(OnClose);
|
{
|
||||||
|
m_UIPanel.onOpen.AddListener(OnOpen);
|
||||||
|
m_UIPanel.onClose.AddListener(OnClose);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
TryToStartAutohideCoroutine();
|
TryToStartAutohideCoroutine();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
|
||||||
{
|
|
||||||
// Clean up listeners if needed
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
MessageSystem.RemoveListener(this, QuestMachineMessages.QuestStateChangedMessage, string.Empty);
|
MessageSystem.RemoveListener(this, QuestMachineMessages.QuestStateChangedMessage, string.Empty);
|
||||||
if (m_UIPanel.gameObject != null)
|
|
||||||
|
if (m_menuScroll != null)
|
||||||
|
{
|
||||||
|
m_menuScroll.OnOpened -= DisableButtonImage;
|
||||||
|
m_menuScroll.OnClosed -= EnableButtonImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_UIPanel != null && m_UIPanel.gameObject != null)
|
||||||
{
|
{
|
||||||
m_UIPanel.onOpen.RemoveListener(OnOpen);
|
m_UIPanel.onOpen.RemoveListener(OnOpen);
|
||||||
m_UIPanel.onClose.RemoveListener(OnClose);
|
m_UIPanel.onClose.RemoveListener(OnClose);
|
||||||
@@ -66,14 +74,20 @@ namespace Beyond
|
|||||||
|
|
||||||
public void OnMessage(MessageArgs messageArgs)
|
public void OnMessage(MessageArgs messageArgs)
|
||||||
{
|
{
|
||||||
|
// Optional but recommended: check if active before processing message
|
||||||
|
if (!gameObject.activeInHierarchy) return;
|
||||||
|
|
||||||
switch (messageArgs.message)
|
switch (messageArgs.message)
|
||||||
{
|
{
|
||||||
case QuestMachineMessages.QuestStateChangedMessage:
|
case QuestMachineMessages.QuestStateChangedMessage:
|
||||||
if ((QuestState)messageArgs.values[1] == QuestState.Active)
|
if ((QuestState)messageArgs.values[1] == QuestState.Active)
|
||||||
{
|
{
|
||||||
m_UIPanel.Close();
|
if (m_UIPanel != null)
|
||||||
m_UIPanel.Open();
|
{
|
||||||
TryToStartAutohideCoroutine();
|
m_UIPanel.Close();
|
||||||
|
m_UIPanel.Open();
|
||||||
|
}
|
||||||
|
// The OnOpen listener will call TryToStartAutohideCoroutine
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -99,50 +113,65 @@ namespace Beyond
|
|||||||
|
|
||||||
private void DisableButtonImage()
|
private void DisableButtonImage()
|
||||||
{
|
{
|
||||||
if (m_buttonImage == null)
|
if (m_buttonImage == null) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_buttonImage.enabled = false;
|
m_buttonImage.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableButtonImage()
|
private void EnableButtonImage()
|
||||||
{
|
{
|
||||||
if (m_buttonImage == null)
|
if (m_buttonImage == null) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_buttonImage.enabled = true;
|
m_buttonImage.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator COR_AutoHide()
|
private IEnumerator COR_AutoHide()
|
||||||
{
|
{
|
||||||
yield return new WaitForSeconds(m_autoHideTime);
|
yield return new WaitForSeconds(m_autoHideTime);
|
||||||
m_UIPanel.Close();
|
if (m_UIPanel != null)
|
||||||
|
{
|
||||||
|
m_UIPanel.Close();
|
||||||
|
}
|
||||||
m_hiddingCoroutine = null;
|
m_hiddingCoroutine = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnClose()
|
private void OnClose()
|
||||||
{
|
{
|
||||||
m_hiddingCoroutine = null;
|
// Stop the coroutine if the panel is closed manually
|
||||||
SetImageToClosed();
|
if (m_hiddingCoroutine != null)
|
||||||
}
|
|
||||||
|
|
||||||
private void TryToStartAutohideCoroutine()
|
|
||||||
{
|
|
||||||
if (!m_autoHide)
|
|
||||||
return;
|
|
||||||
if (m_hiddingCoroutine != null )
|
|
||||||
{
|
{
|
||||||
StopCoroutine(m_hiddingCoroutine);
|
StopCoroutine(m_hiddingCoroutine);
|
||||||
|
m_hiddingCoroutine = null;
|
||||||
}
|
}
|
||||||
m_hiddingCoroutine = StartCoroutine(COR_AutoHide());
|
SetImageToClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOpen()
|
private void OnOpen()
|
||||||
{
|
{
|
||||||
SetImageToOpen();
|
SetImageToOpen();
|
||||||
TryToStartAutohideCoroutine();
|
TryToStartAutohideCoroutine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TryToStartAutohideCoroutine()
|
||||||
|
{
|
||||||
|
// FIX: Check if the GameObject is active before starting a coroutine.
|
||||||
|
// This prevents the "Coroutine couldn't be started" error.
|
||||||
|
if (!gameObject.activeInHierarchy)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_autoHide)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop any previously running hide coroutine to reset the timer
|
||||||
|
if (m_hiddingCoroutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(m_hiddingCoroutine);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is line 139 from your original script
|
||||||
|
m_hiddingCoroutine = StartCoroutine(COR_AutoHide());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user