spell refactor part 2
This commit is contained in:
@@ -5,7 +5,7 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
|||||||
{
|
{
|
||||||
[Header("Health")]
|
[Header("Health")]
|
||||||
[SerializeField] private int maxHealth = 40;
|
[SerializeField] private int maxHealth = 40;
|
||||||
[SerializeField] private float currentHealth = 40f;
|
[SerializeField] private float _currentHealth = 40f;
|
||||||
|
|
||||||
[Header("Death")]
|
[Header("Death")]
|
||||||
[SerializeField] private bool destroyOnDeath = true;
|
[SerializeField] private bool destroyOnDeath = true;
|
||||||
@@ -23,7 +23,7 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
|||||||
public OnReceiveDamage onReceiveDamage => _onReceiveDamage;
|
public OnReceiveDamage onReceiveDamage => _onReceiveDamage;
|
||||||
public OnDead onDead => _onDead;
|
public OnDead onDead => _onDead;
|
||||||
|
|
||||||
public float currentHealth => this.currentHealth;
|
public float currentHealth => this._currentHealth;
|
||||||
public int MaxHealth => maxHealth;
|
public int MaxHealth => maxHealth;
|
||||||
public bool isDead { get; set; }
|
public bool isDead { get; set; }
|
||||||
|
|
||||||
@@ -50,13 +50,13 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
|||||||
public void AddHealth(int value)
|
public void AddHealth(int value)
|
||||||
{
|
{
|
||||||
if (isDead) return;
|
if (isDead) return;
|
||||||
currentHealth = Mathf.Min(maxHealth, currentHealth + value);
|
_currentHealth = Mathf.Min(maxHealth, currentHealth + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeHealth(int value)
|
public void ChangeHealth(int value)
|
||||||
{
|
{
|
||||||
if (isDead) return;
|
if (isDead) return;
|
||||||
currentHealth = Mathf.Clamp(currentHealth + value, 0f, maxHealth);
|
_currentHealth = Mathf.Clamp(currentHealth + value, 0f, maxHealth);
|
||||||
|
|
||||||
if (currentHealth <= 0f)
|
if (currentHealth <= 0f)
|
||||||
Die();
|
Die();
|
||||||
@@ -65,20 +65,20 @@ public class SummonDamageReceiver : MonoBehaviour, vIHealthController
|
|||||||
public void ChangeMaxHealth(int value)
|
public void ChangeMaxHealth(int value)
|
||||||
{
|
{
|
||||||
maxHealth = Mathf.Max(1, maxHealth + value);
|
maxHealth = Mathf.Max(1, maxHealth + value);
|
||||||
currentHealth = Mathf.Min(currentHealth, maxHealth);
|
_currentHealth = Mathf.Min(currentHealth, maxHealth);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetHealth(float health)
|
public void ResetHealth(float health)
|
||||||
{
|
{
|
||||||
maxHealth = Mathf.Max(1, maxHealth);
|
maxHealth = Mathf.Max(1, maxHealth);
|
||||||
currentHealth = Mathf.Clamp(health, 0f, maxHealth);
|
_currentHealth = Mathf.Clamp(health, 0f, maxHealth);
|
||||||
isDead = false;
|
isDead = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetHealth()
|
public void ResetHealth()
|
||||||
{
|
{
|
||||||
maxHealth = Mathf.Max(1, maxHealth);
|
maxHealth = Mathf.Max(1, maxHealth);
|
||||||
currentHealth = maxHealth;
|
_currentHealth = maxHealth;
|
||||||
isDead = false;
|
isDead = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
Assets/AI/_Summons/SummonDamageReceiver.cs.meta
Normal file
2
Assets/AI/_Summons/SummonDamageReceiver.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0662ff12c007d4a7189cb7071852ecc9
|
||||||
2
Assets/AI/_Summons/SwarmAgent.cs.meta
Normal file
2
Assets/AI/_Summons/SwarmAgent.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c709df02a66df41d2bfc2fdab3e74587
|
||||||
2
Assets/AI/_Summons/SwarmCoordinator.cs.meta
Normal file
2
Assets/AI/_Summons/SwarmCoordinator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f8e474d734e543518adf0325c9970bc
|
||||||
@@ -50,7 +50,8 @@ Material:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: M_FireSheet_Candle
|
m_Name: M_FireSheet_Candle
|
||||||
m_Shader: {fileID: -6465566751694194690, guid: 21d0901ac9866004899f0b081df8111d, type: 3}
|
m_Shader: {fileID: -6465566751694194690, guid: 21d0901ac9866004899f0b081df8111d,
|
||||||
|
type: 3}
|
||||||
m_Parent: {fileID: 0}
|
m_Parent: {fileID: 0}
|
||||||
m_ModifiedSerializedProperties: 0
|
m_ModifiedSerializedProperties: 0
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
@@ -312,6 +313,7 @@ Material:
|
|||||||
- _DoubleSidedGIMode: 0
|
- _DoubleSidedGIMode: 0
|
||||||
- _DoubleSidedNormalMode: 1
|
- _DoubleSidedNormalMode: 1
|
||||||
- _DstBlend: 10
|
- _DstBlend: 10
|
||||||
|
- _DstBlendAlpha: 10
|
||||||
- _EmissiveColorMode: 1
|
- _EmissiveColorMode: 1
|
||||||
- _EmissiveExposureWeight: 1
|
- _EmissiveExposureWeight: 1
|
||||||
- _EmissiveIntensity: 3
|
- _EmissiveIntensity: 3
|
||||||
@@ -364,6 +366,7 @@ Material:
|
|||||||
- _SpecularAAThreshold: 0.2
|
- _SpecularAAThreshold: 0.2
|
||||||
- _SpecularOcclusionMode: 1
|
- _SpecularOcclusionMode: 1
|
||||||
- _SrcBlend: 5
|
- _SrcBlend: 5
|
||||||
|
- _SrcBlendAlpha: 1
|
||||||
- _StencilRef: 0
|
- _StencilRef: 0
|
||||||
- _StencilRefDepth: 0
|
- _StencilRefDepth: 0
|
||||||
- _StencilRefDistortionVec: 4
|
- _StencilRefDistortionVec: 4
|
||||||
@@ -406,7 +409,8 @@ Material:
|
|||||||
- Color_A7DF1144: {r: 0, g: 0, b: 0, a: 0}
|
- Color_A7DF1144: {r: 0, g: 0, b: 0, a: 0}
|
||||||
- Color_AF14EE56: {r: 1, g: 1, b: 1, a: 0}
|
- Color_AF14EE56: {r: 1, g: 1, b: 1, a: 0}
|
||||||
- Color_af892e36b16742d1b5a31e2fb9c43b3d: {r: 0, g: 0.6332358, b: 1, a: 1}
|
- Color_af892e36b16742d1b5a31e2fb9c43b3d: {r: 0, g: 0.6332358, b: 1, a: 1}
|
||||||
- Color_f6973748622e48d389fed870a51f8d37: {r: 0.03301889, g: 0.5105501, b: 1, a: 0}
|
- Color_f6973748622e48d389fed870a51f8d37: {r: 0.03301889, g: 0.5105501, b: 1,
|
||||||
|
a: 0}
|
||||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
|
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
|
||||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ Material:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: M_CandleFire
|
m_Name: M_CandleFire
|
||||||
m_Shader: {fileID: -6465566751694194690, guid: 78c30b15708637148a5317ecae0ead81, type: 3}
|
m_Shader: {fileID: -6465566751694194690, guid: 78c30b15708637148a5317ecae0ead81,
|
||||||
|
type: 3}
|
||||||
m_Parent: {fileID: 0}
|
m_Parent: {fileID: 0}
|
||||||
m_ModifiedSerializedProperties: 0
|
m_ModifiedSerializedProperties: 0
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
@@ -132,6 +133,7 @@ Material:
|
|||||||
- _DoubleSidedGIMode: 0
|
- _DoubleSidedGIMode: 0
|
||||||
- _DoubleSidedNormalMode: 2
|
- _DoubleSidedNormalMode: 2
|
||||||
- _DstBlend: 10
|
- _DstBlend: 10
|
||||||
|
- _DstBlendAlpha: 10
|
||||||
- _EnableBlendModePreserveSpecularLighting: 0
|
- _EnableBlendModePreserveSpecularLighting: 0
|
||||||
- _EnableFogOnTransparent: 0
|
- _EnableFogOnTransparent: 0
|
||||||
- _Flame_Flicker_Speed: 0.02
|
- _Flame_Flicker_Speed: 0.02
|
||||||
@@ -159,6 +161,7 @@ Material:
|
|||||||
- _ReceiveShadows: 1
|
- _ReceiveShadows: 1
|
||||||
- _RenderQueueType: 4
|
- _RenderQueueType: 4
|
||||||
- _SrcBlend: 5
|
- _SrcBlend: 5
|
||||||
|
- _SrcBlendAlpha: 1
|
||||||
- _StencilRef: 0
|
- _StencilRef: 0
|
||||||
- _StencilRefDepth: 0
|
- _StencilRefDepth: 0
|
||||||
- _StencilRefDistortionVec: 4
|
- _StencilRefDistortionVec: 4
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -1546,6 +1547,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -1777,6 +1779,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -2310,6 +2313,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -4762,6 +4766,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -7738,6 +7743,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -7874,6 +7880,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -8010,6 +8017,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -8221,6 +8229,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -8894,7 +8903,7 @@ RectTransform:
|
|||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
m_AnchoredPosition: {x: 1499315.4, y: -239890.2}
|
m_AnchoredPosition: {x: 1502754, y: -240440.39}
|
||||||
m_SizeDelta: {x: 100, y: 0}
|
m_SizeDelta: {x: 100, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!114 &6801859473011826678
|
--- !u!114 &6801859473011826678
|
||||||
@@ -9038,6 +9047,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -9519,6 +9529,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -9656,6 +9667,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -9977,6 +9989,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -11908,6 +11921,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -12044,6 +12058,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -12181,6 +12196,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -12318,6 +12334,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -12850,6 +12867,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 256
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -13081,6 +13099,7 @@ MonoBehaviour:
|
|||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 512
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
|
m_characterHorizontalScale: 1
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
m_lineSpacing: 0
|
m_lineSpacing: 0
|
||||||
m_lineSpacingMax: 0
|
m_lineSpacingMax: 0
|
||||||
@@ -26572,6 +26591,11 @@ PrefabInstance:
|
|||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: MenuScroll
|
value: MenuScroll
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 9092972257485956126, guid: 1653ebd692a0d7841b13f85378b35457,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 9092972257485956127, guid: 1653ebd692a0d7841b13f85378b35457,
|
- target: {fileID: 9092972257485956127, guid: 1653ebd692a0d7841b13f85378b35457,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_canvas
|
propertyPath: m_canvas
|
||||||
|
|||||||
@@ -18117,42 +18117,42 @@ PrefabInstance:
|
|||||||
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 210
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 564995907207171390, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -135
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 210.00003
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 616128472424357225, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -45
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 703778627114599771, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 703778627114599771, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -18362,7 +18362,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 1979772587474207191, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 1979772587474207191, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1979772587506359731, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 1979772587506359731, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -19223,22 +19223,22 @@ PrefabInstance:
|
|||||||
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 210
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4202610206940879906, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -225
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4204595259268909078, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4204595259268909078, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -19493,22 +19493,22 @@ PrefabInstance:
|
|||||||
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 210
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4796023216948086302, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -315
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4907318199456855652, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 4907318199456855652, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -19978,12 +19978,12 @@ PrefabInstance:
|
|||||||
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 13310657
|
value: 13340468
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -2129729.5
|
value: -2134500
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5265345828117443429, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5265345828117443429, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -20833,22 +20833,22 @@ PrefabInstance:
|
|||||||
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchorMin.y
|
propertyPath: m_AnchorMin.y
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 210
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 7465903852046106667, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -405
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7534046934194550914, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 7534046934194550914, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|||||||
@@ -5734,70 +5734,7 @@ Transform:
|
|||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 632745673}
|
m_PrefabInstance: {fileID: 632745673}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &657656666
|
--- !u!21 &636396746
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransformParent: {fileID: 1452623894}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 1030974681, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: SM_CandleSlim_01 (2)
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 4.355899
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 12.219
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 146.6286
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 0.21603402
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: -0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: -0.9763859
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: -0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: -155.048
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_RemovedGameObjects: []
|
|
||||||
m_AddedGameObjects: []
|
|
||||||
m_AddedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: abc00000000016444828941082041913, type: 3}
|
|
||||||
--- !u!4 &657656667 stripped
|
|
||||||
Transform:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 1030974682, guid: abc00000000016444828941082041913,
|
|
||||||
type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 657656666}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!21 &660306674
|
|
||||||
Material:
|
Material:
|
||||||
serializedVersion: 8
|
serializedVersion: 8
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -5861,6 +5798,69 @@ Material:
|
|||||||
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
|
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
|
||||||
m_BuildTextureStacks: []
|
m_BuildTextureStacks: []
|
||||||
m_AllowLocking: 1
|
m_AllowLocking: 1
|
||||||
|
--- !u!1001 &657656666
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 1452623894}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 1030974681, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: SM_CandleSlim_01 (2)
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 4.355899
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 12.219
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 146.6286
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 0.21603402
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0.9763859
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: -155.048
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 1030974682, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: abc00000000016444828941082041913, type: 3}
|
||||||
|
--- !u!4 &657656667 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 1030974682, guid: abc00000000016444828941082041913,
|
||||||
|
type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 657656666}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &662788907
|
--- !u!1001 &662788907
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -8543,6 +8543,39 @@ Light:
|
|||||||
m_LightUnit: 1
|
m_LightUnit: 1
|
||||||
m_LuxAtDistance: 1
|
m_LuxAtDistance: 1
|
||||||
m_EnableSpotReflector: 1
|
m_EnableSpotReflector: 1
|
||||||
|
--- !u!21 &697406783
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Height Fog Global
|
||||||
|
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
|
||||||
|
m_Parent: {fileID: 0}
|
||||||
|
m_ModifiedSerializedProperties: 0
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: 3001
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_LockedProperties:
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs: []
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- _HeightFogGlobal: 1
|
||||||
|
- _IsHeightFogShader: 1
|
||||||
|
- _IsStandardPipeline: 0
|
||||||
|
- _TITLE: 1
|
||||||
|
- _TransparentQueue: 3000
|
||||||
|
m_Colors: []
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
m_AllowLocking: 1
|
||||||
--- !u!1001 &715797091
|
--- !u!1001 &715797091
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -20044,12 +20077,12 @@ PrefabInstance:
|
|||||||
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 54686460
|
value: 54746516
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5234664790783380194, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -8749527
|
value: -8759128
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 5276836446788483771, guid: 851e8e61247888340bdec90fc8aa37f5,
|
- target: {fileID: 5276836446788483771, guid: 851e8e61247888340bdec90fc8aa37f5,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -20989,39 +21022,6 @@ Transform:
|
|||||||
type: 3}
|
type: 3}
|
||||||
m_PrefabInstance: {fileID: 1598749928}
|
m_PrefabInstance: {fileID: 1598749928}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!21 &1696434447
|
|
||||||
Material:
|
|
||||||
serializedVersion: 8
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_Name: Height Fog Global
|
|
||||||
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
|
|
||||||
m_Parent: {fileID: 0}
|
|
||||||
m_ModifiedSerializedProperties: 0
|
|
||||||
m_ValidKeywords: []
|
|
||||||
m_InvalidKeywords: []
|
|
||||||
m_LightmapFlags: 4
|
|
||||||
m_EnableInstancingVariants: 0
|
|
||||||
m_DoubleSidedGI: 0
|
|
||||||
m_CustomRenderQueue: 3001
|
|
||||||
stringTagMap: {}
|
|
||||||
disabledShaderPasses: []
|
|
||||||
m_LockedProperties:
|
|
||||||
m_SavedProperties:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TexEnvs: []
|
|
||||||
m_Ints: []
|
|
||||||
m_Floats:
|
|
||||||
- _HeightFogGlobal: 1
|
|
||||||
- _IsHeightFogShader: 1
|
|
||||||
- _IsStandardPipeline: 0
|
|
||||||
- _TITLE: 1
|
|
||||||
- _TransparentQueue: 3000
|
|
||||||
m_Colors: []
|
|
||||||
m_BuildTextureStacks: []
|
|
||||||
m_AllowLocking: 1
|
|
||||||
--- !u!1 &1706873115
|
--- !u!1 &1706873115
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
Binary file not shown.
@@ -55,7 +55,7 @@ TextureImporter:
|
|||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 0
|
||||||
textureShape: 1
|
textureShape: 2
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
flipbookColumns: 1
|
flipbookColumns: 1
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ TextureImporter:
|
|||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 0
|
||||||
textureShape: 1
|
textureShape: 2
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
flipbookColumns: 1
|
flipbookColumns: 1
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ TextureImporter:
|
|||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 0
|
||||||
textureShape: 1
|
textureShape: 2
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
flipbookColumns: 1
|
flipbookColumns: 1
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using Invector;
|
using Invector;
|
||||||
using Invector.vMelee;
|
using Invector.vMelee;
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Beyond
|
namespace Beyond
|
||||||
@@ -10,20 +7,15 @@ namespace Beyond
|
|||||||
public class ShadowSlayerBarkHelper : MonoBehaviour
|
public class ShadowSlayerBarkHelper : MonoBehaviour
|
||||||
{
|
{
|
||||||
private const int fullyChargedBarkId = 24, emptySlayerBarkId = 14, normalSwordAttackBarkID = 23, powerBarkID = 22;
|
private const int fullyChargedBarkId = 24, emptySlayerBarkId = 14, normalSwordAttackBarkID = 23, powerBarkID = 22;
|
||||||
public vObjectDamage blastDamager, flamethrowerDamager;//, fireballDamager;
|
|
||||||
|
// Remove specific damagers, we don't need them anymore
|
||||||
|
// public vObjectDamage blastDamager, flamethrowerDamager;
|
||||||
|
|
||||||
public BarkManager barkManager;
|
public BarkManager barkManager;
|
||||||
|
|
||||||
// public bEquipArea weaponsArea;
|
|
||||||
public vMeleeManager meleeManager;
|
public vMeleeManager meleeManager;
|
||||||
|
|
||||||
// public List<bEquipSlot> weaponSlots;
|
|
||||||
private vMeleeWeapon weapon;
|
|
||||||
|
|
||||||
public MagicAttacks magicAttacks;
|
public MagicAttacks magicAttacks;
|
||||||
|
|
||||||
public TutorialController emptySlayerTutorial;
|
public TutorialController emptySlayerTutorial;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
EnableShadowSlayerBarks();
|
EnableShadowSlayerBarks();
|
||||||
@@ -31,48 +23,32 @@ namespace Beyond
|
|||||||
|
|
||||||
private void EnableShadowSlayerBarks()
|
private void EnableShadowSlayerBarks()
|
||||||
{
|
{
|
||||||
meleeManager.onDamageHit.AddListener(TryToPlayAttackBark);
|
if (meleeManager)
|
||||||
|
meleeManager.onDamageHit.AddListener(TryToPlayAttackBark);
|
||||||
|
|
||||||
blastDamager.onHit.AddListener(TryToPlayPowerBark);
|
// NEW: Subscribe to the centralized Magic event
|
||||||
flamethrowerDamager.onHit.AddListener(TryToPlayPowerBark);
|
if (magicAttacks)
|
||||||
|
magicAttacks.OnSpellHit += OnMagicHit;
|
||||||
magicAttacks.onHitFireball += TryToPlayPowerBark;
|
|
||||||
// fireballDamager.onHit.AddListener(TryToPlayPowerBark);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryToPlayAttackBark(vHitInfo arg0)
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
CharacterVisibilityController visilibityController = arg0.targetCollider.GetComponent<CharacterVisibilityController>();
|
if (magicAttacks)
|
||||||
if (visilibityController)
|
magicAttacks.OnSpellHit -= OnMagicHit;
|
||||||
{
|
|
||||||
weapon = meleeManager.rightWeapon;
|
if (meleeManager)
|
||||||
bItemAttribute power = weapon.GetComponent<bMeleeEquipment>().power;
|
|
||||||
if (power != null && power.value > 0)
|
|
||||||
{
|
|
||||||
//attacking with fully charged slayer
|
|
||||||
barkManager.PlayBark(fullyChargedBarkId);
|
|
||||||
}
|
|
||||||
else if (power != null && power.value <= 0 && !emptySlayerTutorial.played)
|
|
||||||
{
|
|
||||||
emptySlayerTutorial.StartTutorial();
|
|
||||||
//attacking with empty slayer, change id to correct!
|
|
||||||
// barkManager.PlayBark(emptySlayerBarkId);
|
|
||||||
}
|
|
||||||
else if (power == null)
|
|
||||||
{
|
|
||||||
//attacking
|
|
||||||
barkManager.PlayBark(normalSwordAttackBarkID);
|
|
||||||
}
|
|
||||||
//not much of an improvement as bark handles playing already, just removes few check before
|
|
||||||
TryToRemoveAttackListener();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TryToRemoveAttackListener()
|
|
||||||
{
|
|
||||||
if (!(barkManager.CanBarkBeStillPlayed(fullyChargedBarkId) || !emptySlayerTutorial.played /*|| barkManager.CanBarkBeStillPlayed(emptySlayerBarkId) */ || barkManager.CanBarkBeStillPlayed(normalSwordAttackBarkID)))
|
|
||||||
{
|
|
||||||
meleeManager.onDamageHit.RemoveListener(TryToPlayAttackBark);
|
meleeManager.onDamageHit.RemoveListener(TryToPlayAttackBark);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
// MAGIC LOGIC
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
private void OnMagicHit(SpellDefinition spell, Collider hitTarget)
|
||||||
|
{
|
||||||
|
// Check if the spell is "Offensive_Power" (Fireball, Flamethrower, Blast)
|
||||||
|
if (spell.category == SpellCategory.Offensive_Power)
|
||||||
|
{
|
||||||
|
TryToPlayPowerBark(hitTarget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,25 +57,65 @@ namespace Beyond
|
|||||||
CharacterVisibilityController visilibityController = arg0.GetComponent<CharacterVisibilityController>();
|
CharacterVisibilityController visilibityController = arg0.GetComponent<CharacterVisibilityController>();
|
||||||
if (visilibityController)
|
if (visilibityController)
|
||||||
{
|
{
|
||||||
barkManager.PlayBark(powerBarkID);
|
if (barkManager.CanBarkBeStillPlayed(powerBarkID))
|
||||||
TryToRemovePowerBarkListener();
|
{
|
||||||
|
barkManager.PlayBark(powerBarkID);
|
||||||
|
// We don't need to unsubscribe here anymore because the
|
||||||
|
// event is global and persistent on MagicAttacks.
|
||||||
|
// The 'CanBarkBeStillPlayed' check handles the "play once" logic.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryToRemovePowerBarkListener()
|
// ---------------------------------------------------------
|
||||||
|
// MELEE LOGIC (Unchanged, just uncommented)
|
||||||
|
// ---------------------------------------------------------
|
||||||
|
private void TryToPlayAttackBark(vHitInfo arg0)
|
||||||
{
|
{
|
||||||
if (barkManager.CanBarkBeStillPlayed(powerBarkID))
|
CharacterVisibilityController visilibityController = arg0.targetCollider.GetComponent<CharacterVisibilityController>();
|
||||||
|
if (visilibityController)
|
||||||
{
|
{
|
||||||
blastDamager.onHit.RemoveListener(TryToPlayPowerBark);
|
var weapon = meleeManager.rightWeapon;
|
||||||
flamethrowerDamager.onHit.RemoveListener(TryToPlayPowerBark);
|
if (weapon == null) return;
|
||||||
magicAttacks.onHitFireball -= TryToPlayPowerBark;
|
|
||||||
//fireballDamager.onHit.RemoveListener(TryToPlayPowerBark);
|
bItemAttribute power = weapon.GetComponent<bMeleeEquipment>().power;
|
||||||
|
|
||||||
|
if (power != null && power.value > 0)
|
||||||
|
{
|
||||||
|
// Fully charged
|
||||||
|
barkManager.PlayBark(fullyChargedBarkId);
|
||||||
|
}
|
||||||
|
else if (power != null && power.value <= 0)
|
||||||
|
{
|
||||||
|
// Empty Slayer
|
||||||
|
if (emptySlayerTutorial != null && !emptySlayerTutorial.played)
|
||||||
|
{
|
||||||
|
emptySlayerTutorial.StartTutorial();
|
||||||
|
}
|
||||||
|
// barkManager.PlayBark(emptySlayerBarkId);
|
||||||
|
}
|
||||||
|
else if (power == null)
|
||||||
|
{
|
||||||
|
// Normal Sword
|
||||||
|
barkManager.PlayBark(normalSwordAttackBarkID);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleanup listener if all barks are done
|
||||||
|
TryToRemoveAttackListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
private void TryToRemoveAttackListener()
|
||||||
private void Update()
|
|
||||||
{
|
{
|
||||||
|
// If all relevant barks are exhausted/played, stop listening to melee hits to save performance
|
||||||
|
bool fullyChargedDone = !barkManager.CanBarkBeStillPlayed(fullyChargedBarkId);
|
||||||
|
bool normalDone = !barkManager.CanBarkBeStillPlayed(normalSwordAttackBarkID);
|
||||||
|
bool tutorialDone = (emptySlayerTutorial == null || emptySlayerTutorial.played);
|
||||||
|
|
||||||
|
if (fullyChargedDone && normalDone && tutorialDone)
|
||||||
|
{
|
||||||
|
meleeManager.onDamageHit.RemoveListener(TryToPlayAttackBark);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,26 +21,24 @@ namespace Beyond
|
|||||||
|
|
||||||
private IEnumerator CastRoutine(MagicAttacks caster, Transform target)
|
private IEnumerator CastRoutine(MagicAttacks caster, Transform target)
|
||||||
{
|
{
|
||||||
// 1. Rotation (Only Push and Flame used rotation in your old script)
|
// ... (Rotation and Pre-Cast Delay logic) ...
|
||||||
if (type != DurationType.Shield)
|
|
||||||
{
|
|
||||||
yield return caster.RotateTowardsTargetRoutine(target, rotationDuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Pre-cast Delay
|
|
||||||
if (preCastDelay > 0) yield return new WaitForSeconds(preCastDelay);
|
|
||||||
|
|
||||||
// 3. Instantiate attached to player
|
// 3. Instantiate
|
||||||
GameObject instance = Instantiate(effectPrefab, caster.transform);
|
GameObject instance = Instantiate(effectPrefab, caster.transform);
|
||||||
// Reset local position/rotation to ensure it aligns with player
|
|
||||||
instance.transform.localPosition = Vector3.zero;
|
instance.transform.localPosition = Vector3.zero;
|
||||||
instance.transform.localRotation = Quaternion.identity;
|
instance.transform.localRotation = Quaternion.identity;
|
||||||
|
|
||||||
|
// Register Events (for Barks)
|
||||||
|
caster.RegisterSpellDamageEvents(instance, this);
|
||||||
|
|
||||||
// 4. Initialize Specific Logic
|
// 4. Initialize Specific Logic
|
||||||
if (type == DurationType.Shield)
|
if (type == DurationType.Shield)
|
||||||
{
|
{
|
||||||
var shieldCtrl = instance.GetComponent<ShieldEffectController>();
|
var shieldCtrl = instance.GetComponent<ShieldEffectController>();
|
||||||
if (shieldCtrl) shieldCtrl.InitializeEffect();
|
if (shieldCtrl) shieldCtrl.InitializeEffect();
|
||||||
|
|
||||||
|
// --- TOGGLE FLAG ON ---
|
||||||
|
caster.IsShieldActive = true;
|
||||||
}
|
}
|
||||||
else if (type == DurationType.Flamethrower)
|
else if (type == DurationType.Flamethrower)
|
||||||
{
|
{
|
||||||
@@ -69,6 +67,9 @@ namespace Beyond
|
|||||||
{
|
{
|
||||||
var shieldCtrl = instance.GetComponent<ShieldEffectController>();
|
var shieldCtrl = instance.GetComponent<ShieldEffectController>();
|
||||||
if (shieldCtrl) shieldCtrl.DisableEffect();
|
if (shieldCtrl) shieldCtrl.DisableEffect();
|
||||||
|
|
||||||
|
// --- TOGGLE FLAG OFF ---
|
||||||
|
caster.IsShieldActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7. Post Delay
|
// 7. Post Delay
|
||||||
|
|||||||
@@ -1,504 +1,213 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Invector;
|
using Invector;
|
||||||
|
using Invector.vMelee;
|
||||||
using Invector.vCharacterController;
|
using Invector.vCharacterController;
|
||||||
using Invector.vCharacterController.vActions;
|
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.VFX;
|
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using Invector.vCharacterController.AI.FSMBehaviour;
|
|
||||||
using Beyond;
|
using Beyond;
|
||||||
|
|
||||||
namespace Beyond
|
namespace Beyond
|
||||||
{
|
{
|
||||||
[RequireComponent(typeof(Animator))]
|
[RequireComponent(typeof(Animator))]
|
||||||
[RequireComponent(typeof(vGenericAnimation))]
|
|
||||||
public class MagicAttacks : MonoBehaviour
|
public class MagicAttacks : MonoBehaviour
|
||||||
{
|
{
|
||||||
public delegate void ActionDelegate();
|
[Title("References")]
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public class EffectDesc
|
|
||||||
{
|
|
||||||
public string name = "MagicPush";
|
|
||||||
public string secondaryName = "MagicPush Scroll";
|
|
||||||
public float delay = 0f;
|
|
||||||
public float startTime = 0f;
|
|
||||||
public float endTime = 0f;
|
|
||||||
public GameObject effectObject;
|
|
||||||
public string animClipName = "MagicPush";
|
|
||||||
public ActionDelegate del;
|
|
||||||
}
|
|
||||||
|
|
||||||
[SerializeField] private bEquipArea powersArea;
|
[SerializeField] private bEquipArea powersArea;
|
||||||
public List<EffectDesc> m_effects;
|
|
||||||
public EffectDesc selectedEffect;
|
|
||||||
|
|
||||||
public enum EffectType
|
[Title("Input Settings")]
|
||||||
{ MAGIC_PUSH, FLAME_THROWER, SCAN, NOONE, FIREBALL, SHIELD, SILENT_PEEK };
|
|
||||||
|
|
||||||
public EffectType m_selectedType = EffectType.NOONE;
|
|
||||||
public string currentSelectedSpellName = "";
|
|
||||||
|
|
||||||
private int currentSpellFaithCost = int.MaxValue;
|
|
||||||
private int equipAreaSelectedIndex = 0;
|
|
||||||
|
|
||||||
private Coroutine lastPushRoutine = null;
|
|
||||||
private ParticleSystem flame;
|
|
||||||
private BoxCollider flameDamager;
|
|
||||||
private bLockOn lockOn;
|
|
||||||
private const float fireballAimerThreshold = -1.0f;
|
|
||||||
private const float fireballAimerHeightAdjuster = 0.1f;
|
|
||||||
private const float fireballDamagerDuration = 0.3f;
|
|
||||||
private const float fireballTargetYPositionOffset = 0.75f;
|
|
||||||
private const int spellLayerIndex = 5;
|
|
||||||
|
|
||||||
private EffectDesc shield;
|
|
||||||
private EffectDesc silentPeek;
|
|
||||||
private ShieldEffectController shieldEffectController;
|
|
||||||
private ShieldCollisionController shieldCollisionController;
|
|
||||||
|
|
||||||
private bool canPlayNoFaithClip = true;
|
|
||||||
private bool canPlayCantDoClip = true;
|
|
||||||
|
|
||||||
private AutoTargetting _autoTargettingInstance;
|
|
||||||
public UnityAction<Collider> onHitFireball;
|
|
||||||
|
|
||||||
// Animation State
|
|
||||||
public bool isPlaying;
|
|
||||||
protected bool triggerOnce;
|
|
||||||
protected bThirdPersonInput tpInput;
|
|
||||||
internal bool shieldEffectIsActive;
|
|
||||||
private bool shieldAnimationIsActive;
|
|
||||||
|
|
||||||
[Tooltip("Input to trigger the custom animation")]
|
|
||||||
public GenericInput actionInput = new GenericInput("L", "L", "L");
|
public GenericInput actionInput = new GenericInput("L", "L", "L");
|
||||||
[Tooltip("Name of the animation clip")]
|
|
||||||
public string animationClip;
|
|
||||||
[Tooltip("Where in the end of the animation will trigger the event OnEndAnimation")]
|
|
||||||
public float animationEnd = 0.8f;
|
|
||||||
|
|
||||||
|
[Title("Events")]
|
||||||
public UnityEvent OnPlayAnimation;
|
public UnityEvent OnPlayAnimation;
|
||||||
public UnityEvent OnEndAnimation;
|
public UnityEvent OnEndAnimation;
|
||||||
|
public event System.Action<SpellDefinition, Collider> OnSpellHit;
|
||||||
|
|
||||||
|
// Internal State
|
||||||
|
private bThirdPersonInput tpInput;
|
||||||
|
private AutoTargetting _autoTargettingInstance;
|
||||||
|
public bool isPlaying { get; private set; }
|
||||||
|
private bool canPlayNoFaithClip = true;
|
||||||
|
[field: Sirenix.OdinInspector.ShowInInspector, Sirenix.OdinInspector.ReadOnly]
|
||||||
|
public bool IsShieldActive { get; set; }
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
private const int spellLayerIndex = 5;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
tpInput = GetComponent<bThirdPersonInput>();
|
tpInput = GetComponent<bThirdPersonInput>();
|
||||||
lockOn = GetComponent<bLockOn>();
|
|
||||||
|
|
||||||
if (Player.Instance != null)
|
if (Player.Instance != null)
|
||||||
{
|
{
|
||||||
_autoTargettingInstance = Player.Instance.AutoTarget;
|
_autoTargettingInstance = Player.Instance.AutoTarget;
|
||||||
if (_autoTargettingInstance == null)
|
|
||||||
{
|
|
||||||
Debug.LogWarning("MagicAttacks: AutoTargetting component not found on Player.Instance.AutoTarget.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectDesc mpush = m_effects[(int)EffectType.MAGIC_PUSH];
|
|
||||||
EffectDesc flameThrowe = m_effects[(int)EffectType.FLAME_THROWER];
|
|
||||||
EffectDesc scan = m_effects[(int)EffectType.SCAN];
|
|
||||||
EffectDesc fireball = m_effects[(int)EffectType.FIREBALL];
|
|
||||||
shield = m_effects[(int)EffectType.SHIELD];
|
|
||||||
silentPeek = m_effects[(int)EffectType.SILENT_PEEK];
|
|
||||||
|
|
||||||
// Setup References
|
|
||||||
if (shield.effectObject)
|
|
||||||
{
|
|
||||||
shieldEffectController = shield.effectObject.GetComponent<ShieldEffectController>();
|
|
||||||
shieldCollisionController = shield.effectObject.GetComponentInChildren<ShieldCollisionController>();
|
|
||||||
shield.effectObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mpush.effectObject != null)
|
|
||||||
{
|
|
||||||
mpush.effectObject.SetActive(false);
|
|
||||||
}
|
|
||||||
mpush.del = MagicPushAttack;
|
|
||||||
|
|
||||||
if (flameThrowe.effectObject)
|
|
||||||
{
|
|
||||||
flameThrowe.effectObject.GetComponent<ParticleSystem>().Stop();
|
|
||||||
var ps = flameThrowe.effectObject.GetComponentsInChildren<ParticleSystem>();
|
|
||||||
foreach (var p in ps) p.Stop();
|
|
||||||
|
|
||||||
flame = flameThrowe.effectObject.GetComponent<ParticleSystem>();
|
|
||||||
flameDamager = flameThrowe.effectObject.GetComponentInChildren<BoxCollider>();
|
|
||||||
}
|
|
||||||
flameThrowe.del = FlameThrowerAttack;
|
|
||||||
|
|
||||||
scan.del = Scan;
|
|
||||||
if (scan.effectObject) scan.effectObject.SetActive(false);
|
|
||||||
|
|
||||||
fireball.del = Fireball;
|
|
||||||
if (fireball.effectObject) fireball.effectObject.SetActive(false);
|
|
||||||
|
|
||||||
shield.del = Shield;
|
|
||||||
silentPeek.del = OnSilentPeek;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
if (shieldAnimationIsActive)
|
// Safety check: ensure shield flag is reset if player is disabled/respawning
|
||||||
|
IsShieldActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LateUpdate()
|
||||||
|
{
|
||||||
|
HandleInput();
|
||||||
|
MonitorAnimationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleInput()
|
||||||
|
{
|
||||||
|
// 1. Basic Checks
|
||||||
|
if (tpInput == null || tpInput.cc == null) return;
|
||||||
|
|
||||||
|
bool canCast = !isPlaying &&
|
||||||
|
!tpInput.cc.customAction &&
|
||||||
|
!tpInput.cc.IsAnimatorTag("special") &&
|
||||||
|
!tpInput.cc.IsAnimatorTag("LockMovement");
|
||||||
|
|
||||||
|
// 2. Trigger
|
||||||
|
if (actionInput.GetButtonDown() && canCast)
|
||||||
{
|
{
|
||||||
DisableShield();
|
TryCastCurrentSpell();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnable()
|
private void TryCastCurrentSpell()
|
||||||
{
|
{
|
||||||
canPlayNoFaithClip = true;
|
// A. Get Item & Spell Definition
|
||||||
canPlayCantDoClip = true;
|
bItem selectedItem = GetEquippedSpellItem();
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void LateUpdate()
|
if (selectedItem == null)
|
||||||
{
|
|
||||||
TriggerSpellAnimation();
|
|
||||||
AnimationBehaviour();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void TriggerSpellAnimation()
|
|
||||||
{
|
|
||||||
bool playConditions = !isPlaying && tpInput != null && tpInput.cc != null &&
|
|
||||||
!(tpInput.cc.customAction || tpInput.cc.IsAnimatorTag("special") || tpInput.cc.IsAnimatorTag("LockMovement"));
|
|
||||||
|
|
||||||
if (actionInput.GetButtonDown() && playConditions)
|
|
||||||
TryToPlaySpellAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// CORE CASTING LOGIC (COSTS & BONUSES)
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
public void TryToPlaySpellAnimation()
|
|
||||||
{
|
|
||||||
selectedEffect = GetCurrentlySelectedPower();
|
|
||||||
|
|
||||||
if (selectedEffect == shield && shieldAnimationIsActive)
|
|
||||||
{
|
{
|
||||||
TryToPlayCantDoThatYetClip();
|
// No item equipped in the selected slot
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedItem.spellDefinition == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Item '{selectedItem.name}' is equipped but has no SpellDefinition assigned!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Player.Instance == null)
|
SpellDefinition spell = selectedItem.spellDefinition;
|
||||||
|
|
||||||
|
// B. Check Costs (Calculated by the Spell SO)
|
||||||
|
float cost = spell.GetFaithCost(Player.Instance);
|
||||||
|
|
||||||
|
if (Player.Instance.GetCurrentFaithValue() < cost)
|
||||||
{
|
{
|
||||||
Debug.LogError("Player.Instance is null. Cannot cast spell.");
|
PlayNoFaithFeedback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- 1. CALCULATE FINAL FAITH COST ---
|
// C. Success! Consume Resources
|
||||||
float finalCost = currentSpellFaithCost;
|
Player.Instance.UpdateFaithCurrentValue(-cost);
|
||||||
bool isSilentPeek = selectedEffect == m_effects[(int)EffectType.SILENT_PEEK];
|
|
||||||
|
|
||||||
// Effect: Bloom (General 20% Reduction)
|
// Effect: Growth (Heal on Cast) - Global Trinket logic
|
||||||
if (Player.Instance.CurrentTrinketStats.effectBloom)
|
if (Player.Instance.CurrentTrinketStats.effectGrowth)
|
||||||
{
|
{
|
||||||
finalCost *= 0.8f;
|
int healAmt = Mathf.Max(1, (int)(Player.Instance.MaxHealth * 0.02f));
|
||||||
|
Player.Instance.ThirdPersonController.ChangeHealth(healAmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Effect: Angel Eye (Silent Peek is Free)
|
// Handle Consumables (Scrolls)
|
||||||
if (isSilentPeek && Player.Instance.CurrentTrinketStats.effectAngelEye)
|
if (selectedItem.destroyAfterUse)
|
||||||
{
|
{
|
||||||
finalCost = 0f;
|
// Uses the standard Invector logic to consume the item in the current slot
|
||||||
|
if (powersArea.currentSelectedSlot != null)
|
||||||
|
{
|
||||||
|
powersArea.UseItem(powersArea.currentSelectedSlot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: Zora's Focus (effectBreeze) logic for Magic Push cost was removed as requested.
|
// D. Snap Rotation (Instant snap before animation starts if needed)
|
||||||
|
if (_autoTargettingInstance != null && _autoTargettingInstance.CurrentTarget != null)
|
||||||
// --- 2. CHECK & CONSUME ---
|
|
||||||
if (selectedEffect != null && finalCost <= Player.Instance.GetCurrentFaithValue())
|
|
||||||
{
|
{
|
||||||
Player.Instance.UpdateFaithCurrentValue(-finalCost);
|
SnapLookTowardsAutoTarget();
|
||||||
|
}
|
||||||
|
|
||||||
// Effect: Growth (Heal on Cast)
|
// E. Play Animation
|
||||||
if (Player.Instance.CurrentTrinketStats.effectGrowth)
|
if (!string.IsNullOrEmpty(spell.animationClipName))
|
||||||
|
{
|
||||||
|
tpInput.cc.animator.CrossFadeInFixedTime(spell.animationClipName, 0.1f);
|
||||||
|
OnPlayAnimation.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
// F. Execute Spell Logic
|
||||||
|
// We pass 'this' (Monobehaviour) so the SO can start coroutines here.
|
||||||
|
Transform target = _autoTargettingInstance != null ?
|
||||||
|
(_autoTargettingInstance.CurrentTarget != null ? _autoTargettingInstance.CurrentTarget.transform : null)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
spell.Cast(this, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
// =================================================================================================
|
||||||
|
// HELPER METHODS (Called by SpellDefinitions)
|
||||||
|
// =================================================================================================
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the currently equipped item in the Powers area.
|
||||||
|
/// </summary>
|
||||||
|
public bItem GetEquippedSpellItem()
|
||||||
|
{
|
||||||
|
if (powersArea == null) return null;
|
||||||
|
return powersArea.currentEquippedItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Coroutine used by Spells to rotate the player towards the target over time.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerator RotateTowardsTargetRoutine(Transform target, float duration)
|
||||||
|
{
|
||||||
|
if (duration <= 0) yield break;
|
||||||
|
|
||||||
|
float timer = 0f;
|
||||||
|
while (timer < duration)
|
||||||
|
{
|
||||||
|
// Dynamic check: target might die or become null during rotation
|
||||||
|
Transform actualTarget = target;
|
||||||
|
|
||||||
|
// Fallback to AutoTarget if the passed target becomes null but a new one exists
|
||||||
|
if (actualTarget == null && _autoTargettingInstance != null && _autoTargettingInstance.CurrentTarget != null)
|
||||||
{
|
{
|
||||||
int healAmt = Mathf.Max(1, (int)(Player.Instance.MaxHealth * 0.02f));
|
actualTarget = _autoTargettingInstance.CurrentTarget.transform;
|
||||||
Player.Instance.ThirdPersonController.ChangeHealth(healAmt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
animationClip = selectedEffect.animClipName;
|
if (actualTarget != null)
|
||||||
|
|
||||||
// Snap Rotation
|
|
||||||
if (_autoTargettingInstance != null && _autoTargettingInstance.CurrentTarget != null)
|
|
||||||
{
|
{
|
||||||
SnapLookTowardsAutoTarget();
|
Vector3 directionToTarget = actualTarget.position - transform.position;
|
||||||
}
|
directionToTarget.y = 0f;
|
||||||
|
|
||||||
// Play Animation
|
if (directionToTarget.sqrMagnitude > 0.0001f)
|
||||||
if (tpInput != null && tpInput.cc != null && tpInput.cc.animator != null)
|
|
||||||
{
|
|
||||||
tpInput.cc.animator.CrossFadeInFixedTime(animationClip, 0.1f);
|
|
||||||
OnPlayAnimation.Invoke();
|
|
||||||
triggerOnce = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogError("Cannot play spell animation: tpInput or its components are null.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Invoke Logic (Coroutine)
|
|
||||||
selectedEffect.del?.Invoke();
|
|
||||||
|
|
||||||
// Handle Consumables (Scrolls)
|
|
||||||
if (powersArea.equipSlots[equipAreaSelectedIndex].item.destroyAfterUse)
|
|
||||||
{
|
|
||||||
if (selectedEffect == silentPeek)
|
|
||||||
{
|
{
|
||||||
// Logic handled inside coroutine
|
Quaternion targetRotation = Quaternion.LookRotation(directionToTarget.normalized);
|
||||||
}
|
// Using a high speed to ensure we catch up, or use the AutoTargetting speed settings
|
||||||
else
|
float speed = (_autoTargettingInstance != null) ? _autoTargettingInstance.playerRotationSpeed : 10f;
|
||||||
{
|
transform.rotation = Quaternion.RotateTowards(transform.rotation, targetRotation, Time.deltaTime * speed * 50f);
|
||||||
powersArea.UseItem(powersArea.equipSlots[equipAreaSelectedIndex]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (selectedEffect != null)
|
timer += Time.deltaTime;
|
||||||
{
|
|
||||||
TryToPlayNoEnoughFaithClip();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: MAGIC PUSH
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
public void MagicPushAttack()
|
|
||||||
{
|
|
||||||
if (lastPushRoutine != null) StopCoroutine(lastPushRoutine);
|
|
||||||
lastPushRoutine = StartCoroutine(MagicPushCoroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator MagicPushCoroutine()
|
|
||||||
{
|
|
||||||
EffectDesc mpush = m_effects[(int)EffectType.MAGIC_PUSH];
|
|
||||||
yield return TurnTowardTargetCoroutine(mpush.startTime);
|
|
||||||
|
|
||||||
// Zora's Focus scaling logic removed from here as requested.
|
|
||||||
// Magic Push is now standard size.
|
|
||||||
|
|
||||||
mpush.effectObject.SetActive(false);
|
|
||||||
mpush.effectObject.SetActive(true);
|
|
||||||
|
|
||||||
// Apply Soulfire Damage
|
|
||||||
ApplySoulfireDamage(mpush.effectObject);
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(mpush.delay);
|
|
||||||
yield return new WaitForSeconds(mpush.endTime);
|
|
||||||
mpush.effectObject.SetActive(false);
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: FLAME THROWER
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
public void FlameThrowerAttack()
|
|
||||||
{
|
|
||||||
StartCoroutine(FlameThrowerhCoroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator FlameThrowerhCoroutine()
|
|
||||||
{
|
|
||||||
EffectDesc flameThrowe = m_effects[(int)EffectType.FLAME_THROWER];
|
|
||||||
yield return TurnTowardTargetCoroutine(flameThrowe.startTime);
|
|
||||||
|
|
||||||
flameDamager.enabled = true;
|
|
||||||
ApplySoulfireDamage(flameThrowe.effectObject);
|
|
||||||
|
|
||||||
flame.Play();
|
|
||||||
yield return new WaitForSeconds(flameThrowe.endTime);
|
|
||||||
flame.Stop();
|
|
||||||
yield return new WaitForSeconds(flameThrowe.delay);
|
|
||||||
flameDamager.enabled = false;
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: FIREBALL (Soulfire Damage)
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
public void Fireball()
|
|
||||||
{
|
|
||||||
StartCoroutine(FireballCoroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator FireballCoroutine()
|
|
||||||
{
|
|
||||||
EffectDesc fireballDesc = m_effects[(int)EffectType.FIREBALL];
|
|
||||||
yield return TurnTowardTargetCoroutine(fireballDesc.startTime);
|
|
||||||
|
|
||||||
var fireballClone = Instantiate(fireballDesc.effectObject, fireballDesc.effectObject.transform.position, fireballDesc.effectObject.transform.rotation);
|
|
||||||
fireballClone.SetActive(true);
|
|
||||||
|
|
||||||
// Apply Soulfire Damage to the Clone
|
|
||||||
ApplySoulfireDamage(fireballClone);
|
|
||||||
|
|
||||||
RFX4_PhysicsMotion fireballMotionController = fireballClone.GetComponentInChildren<RFX4_PhysicsMotion>();
|
|
||||||
if (fireballMotionController != null)
|
|
||||||
{
|
|
||||||
fireballMotionController.CollisionEnter += EnableBrieflyFireballDamager;
|
|
||||||
}
|
|
||||||
vObjectDamage fireballDamageComponent = fireballClone.GetComponentInChildren<vObjectDamage>();
|
|
||||||
if (fireballDamageComponent != null && onHitFireball != null)
|
|
||||||
{
|
|
||||||
fireballDamageComponent.onHit.AddListener(onHitFireball);
|
|
||||||
}
|
|
||||||
|
|
||||||
AimFireball(fireballClone);
|
|
||||||
|
|
||||||
Destroy(fireballClone, 10f);
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: SHIELD (Calmness)
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
public void Shield()
|
|
||||||
{
|
|
||||||
StopCoroutine(nameof(ShieldCoroutine));
|
|
||||||
StartCoroutine(nameof(ShieldCoroutine));
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator ShieldCoroutine()
|
|
||||||
{
|
|
||||||
shieldAnimationIsActive = true;
|
|
||||||
yield return new WaitForSeconds(shield.startTime);
|
|
||||||
|
|
||||||
shieldEffectIsActive = true;
|
|
||||||
shieldEffectController.InitializeEffect();
|
|
||||||
shield.effectObject.SetActive(true);
|
|
||||||
shieldCollisionController.shieldCollider.enabled = true;
|
|
||||||
|
|
||||||
// Effect: Calmness (Shield lasts 50% longer)
|
|
||||||
float finalDuration = shield.endTime;
|
|
||||||
if (Player.Instance.CurrentTrinketStats.effectCalmness)
|
|
||||||
{
|
|
||||||
finalDuration *= 1.5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(finalDuration);
|
|
||||||
|
|
||||||
shieldEffectController.DisableEffect();
|
|
||||||
yield return new WaitForSeconds(shield.delay / 2f);
|
|
||||||
shieldEffectIsActive = false;
|
|
||||||
shieldCollisionController.shieldCollider.enabled = false;
|
|
||||||
yield return new WaitForSeconds(shield.delay / 2f);
|
|
||||||
shield.effectObject.SetActive(false);
|
|
||||||
shieldAnimationIsActive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DisableShield()
|
|
||||||
{
|
|
||||||
shieldEffectIsActive = false;
|
|
||||||
if (shieldCollisionController != null && shieldCollisionController.shieldCollider != null)
|
|
||||||
shieldCollisionController.shieldCollider.enabled = false;
|
|
||||||
shieldAnimationIsActive = false;
|
|
||||||
if (shield != null && shield.effectObject != null)
|
|
||||||
shield.effectObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: SILENT PEEK (Angel Eye & Zora's Focus)
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
[Button]
|
|
||||||
private void OnSilentPeek()
|
|
||||||
{
|
|
||||||
StopCoroutine(nameof(SilentPeekCoroutine));
|
|
||||||
StartCoroutine(nameof(SilentPeekCoroutine));
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator SilentPeekCoroutine()
|
|
||||||
{
|
|
||||||
EffectDesc peek = m_effects[(int)EffectType.SILENT_PEEK];
|
|
||||||
yield return new WaitForSeconds(peek.startTime);
|
|
||||||
|
|
||||||
// Effect: Zora's Focus (effectBreeze)
|
|
||||||
// User Note: "enhanced covert gaze radius and length", "keep it in not fully implemented version"
|
|
||||||
// Implementation: We check the flag, but currently do not apply Radius/Length changes.
|
|
||||||
if (Player.Instance.CurrentTrinketStats.effectBreeze)
|
|
||||||
{
|
|
||||||
// Placeholder for future logic:
|
|
||||||
// float extendedDuration = peek.endTime * 1.5f;
|
|
||||||
// float extendedRadius = currentRadius * 1.3f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SilentPeekController.instance.IsActive())
|
|
||||||
{
|
|
||||||
SilentPeekController.instance.SetActive(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (peek.effectObject != null)
|
|
||||||
{
|
|
||||||
peek.effectObject.SetActive(false);
|
|
||||||
peek.effectObject.SetActive(true);
|
|
||||||
yield return new WaitForSeconds(peek.delay);
|
|
||||||
}
|
|
||||||
SilentPeekController.instance.SetActive(true, powersArea.equipSlots[equipAreaSelectedIndex].item);
|
|
||||||
}
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
// SPELL: SCAN
|
|
||||||
// ----------------------------------------------------------------------------------
|
|
||||||
[Button]
|
|
||||||
public void Scan()
|
|
||||||
{
|
|
||||||
StartCoroutine(ScanCoroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator ScanCoroutine()
|
|
||||||
{
|
|
||||||
EffectDesc scan = m_effects[(int)EffectType.SCAN];
|
|
||||||
yield return new WaitForSeconds(scan.startTime);
|
|
||||||
float maxRange = 50f;
|
|
||||||
float speed = maxRange / (scan.endTime - scan.startTime);
|
|
||||||
int mask = 1 << LayerMask.NameToLayer("Triggers") | 1 << LayerMask.NameToLayer("HiddenObject");
|
|
||||||
|
|
||||||
if (scan.effectObject)
|
|
||||||
{
|
|
||||||
scan.effectObject.SetActive(true);
|
|
||||||
VisualEffect effect = scan.effectObject.GetComponent<VisualEffect>();
|
|
||||||
effect.Play();
|
|
||||||
}
|
|
||||||
|
|
||||||
float waveEffectTimer = 0f;
|
|
||||||
float waveEffectDuration = scan.endTime - scan.startTime;
|
|
||||||
|
|
||||||
while (waveEffectTimer < waveEffectDuration)
|
|
||||||
{
|
|
||||||
Shader.SetGlobalFloat("_WaveTime", speed * waveEffectTimer);
|
|
||||||
waveEffectTimer += Time.deltaTime;
|
|
||||||
yield return null;
|
yield return null;
|
||||||
}
|
}
|
||||||
Shader.SetGlobalFloat("_WaveTime", 0f);
|
|
||||||
|
|
||||||
var colliders = Physics.OverlapSphere(transform.position, maxRange, mask);
|
|
||||||
foreach (var c in colliders)
|
|
||||||
{
|
|
||||||
var h = c.gameObject.GetComponent<IScannable>();
|
|
||||||
if (h != null) h.OnScanned();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scan.effectObject) scan.effectObject.SetActive(false);
|
|
||||||
yield return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------
|
/// <summary>
|
||||||
// HELPERS
|
/// Helper to apply Trinket Damage Multipliers (Soulfire) to any instantiated spell object.
|
||||||
// ----------------------------------------------------------------------------------
|
/// </summary>
|
||||||
|
public void ApplyDamageModifiers(GameObject spellObject)
|
||||||
// Applies Trinket Damage Multiplier (Soulfire) to any vObjectDamage found on object
|
|
||||||
private void ApplySoulfireDamage(GameObject obj)
|
|
||||||
{
|
{
|
||||||
if (obj == null) return;
|
if (spellObject == null || Player.Instance == null) return;
|
||||||
var damageComps = obj.GetComponentsInChildren<vObjectDamage>();
|
|
||||||
float mult = Player.Instance.CurrentTrinketStats.soulfireDamageMult;
|
float mult = Player.Instance.CurrentTrinketStats.soulfireDamageMult;
|
||||||
|
|
||||||
// Only apply if multiplier is significant
|
// Only apply if multiplier is significant (not 1.0)
|
||||||
if (Mathf.Abs(mult - 1f) > 0.01f)
|
if (Mathf.Abs(mult - 1f) > 0.01f)
|
||||||
{
|
{
|
||||||
|
var damageComps = spellObject.GetComponentsInChildren<vObjectDamage>();
|
||||||
foreach (var comp in damageComps)
|
foreach (var comp in damageComps)
|
||||||
{
|
{
|
||||||
comp.damage.damageValue = Mathf.RoundToInt(comp.damage.damageValue * mult);
|
comp.damage.damageValue = Mathf.RoundToInt(comp.damage.damageValue * mult);
|
||||||
@@ -506,275 +215,78 @@ namespace Beyond
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EffectDesc GetCurrentlySelectedPower()
|
// =================================================================================================
|
||||||
|
// INTERNAL LOGIC
|
||||||
|
// =================================================================================================
|
||||||
|
|
||||||
|
private void MonitorAnimationState()
|
||||||
{
|
{
|
||||||
if (powersArea == null || equipAreaSelectedIndex < 0 || equipAreaSelectedIndex >= powersArea.equipSlots.Count ||
|
if (tpInput == null || tpInput.cc == null || tpInput.cc.animator == null) return;
|
||||||
powersArea.equipSlots[equipAreaSelectedIndex] == null || powersArea.equipSlots[equipAreaSelectedIndex].item == null)
|
|
||||||
{
|
|
||||||
currentSpellFaithCost = int.MaxValue;
|
|
||||||
currentSelectedSpellName = "";
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
bItem selectedSpellItem = powersArea.equipSlots[equipAreaSelectedIndex].item;
|
// Check if we are currently playing a spell animation on the specific layer
|
||||||
currentSelectedSpellName = selectedSpellItem.name;
|
var stateInfo = tpInput.cc.animator.GetCurrentAnimatorStateInfo(spellLayerIndex);
|
||||||
currentSpellFaithCost = selectedSpellItem.GetItemAttribute(bItemAttributes.Faith).value;
|
|
||||||
|
// We consider it "Playing" if the tag is Spell, or if a spell animation is active
|
||||||
|
// Note: Your SpellDefinitions define the Clip Name.
|
||||||
|
// A generic way is checking the Tag if you set "Spell" tag in Animator,
|
||||||
|
// OR checking if we are in a transition to a spell.
|
||||||
|
|
||||||
|
// Simplified check based on your old code logic:
|
||||||
|
// Assuming all Spell Animations have the tag "Spell" or "Action" in the Animator
|
||||||
|
isPlaying = tpInput.cc.IsAnimatorTag("Spell") ||
|
||||||
|
tpInput.cc.IsAnimatorTag("special") ||
|
||||||
|
tpInput.cc.customAction;
|
||||||
|
|
||||||
return m_effects.Find(effect => effect.name == selectedSpellItem.name || effect.secondaryName == selectedSpellItem.name);
|
// Optional: Trigger OnEndAnimation if needed, though most logic is now in the Coroutine
|
||||||
}
|
|
||||||
|
|
||||||
public void SelectPowerBasedOnArea(int newIndex)
|
|
||||||
{
|
|
||||||
equipAreaSelectedIndex = newIndex;
|
|
||||||
selectedEffect = GetCurrentlySelectedPower();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TryToPlayCantDoThatYetClip()
|
|
||||||
{
|
|
||||||
if (!canPlayCantDoClip) return;
|
|
||||||
canPlayCantDoClip = false;
|
|
||||||
DOVirtual.DelayedCall(1f, () => canPlayCantDoClip = true);
|
|
||||||
|
|
||||||
var text = "Spell is already active";
|
|
||||||
if (bItemCollectionDisplay.Instance != null)
|
|
||||||
bItemCollectionDisplay.Instance.FadeText(text, 4, 0.25f);
|
|
||||||
if (Player.Instance != null)
|
|
||||||
Player.Instance.PlayICantDoThatYet();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TryToPlayNoEnoughFaithClip()
|
|
||||||
{
|
|
||||||
if (!canPlayNoFaithClip) return;
|
|
||||||
canPlayNoFaithClip = false;
|
|
||||||
DOVirtual.DelayedCall(1.5f, () => canPlayNoFaithClip = true);
|
|
||||||
|
|
||||||
var text = "Not enough Faith";
|
|
||||||
if (bItemCollectionDisplay.Instance != null)
|
|
||||||
bItemCollectionDisplay.Instance.FadeText(text, 4, 0.25f);
|
|
||||||
if (Player.Instance != null)
|
|
||||||
Player.Instance.PlayNoFaithClip();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void AnimationBehaviour()
|
|
||||||
{
|
|
||||||
if (tpInput == null || tpInput.cc == null || tpInput.cc.animator == null || string.IsNullOrEmpty(animationClip))
|
|
||||||
{
|
|
||||||
isPlaying = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isPlaying = tpInput.cc.animator.GetCurrentAnimatorStateInfo(spellLayerIndex).IsName(animationClip) ||
|
|
||||||
tpInput.cc.animator.GetNextAnimatorStateInfo(spellLayerIndex).IsName(animationClip);
|
|
||||||
|
|
||||||
if (isPlaying)
|
|
||||||
{
|
|
||||||
if (tpInput.cc.animator.GetCurrentAnimatorStateInfo(spellLayerIndex).IsName(animationClip) &&
|
|
||||||
tpInput.cc.animator.GetCurrentAnimatorStateInfo(spellLayerIndex).normalizedTime >= animationEnd)
|
|
||||||
{
|
|
||||||
if (triggerOnce)
|
|
||||||
{
|
|
||||||
triggerOnce = false;
|
|
||||||
OnEndAnimation.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (triggerOnce) triggerOnce = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator TurnTowardTargetCoroutine(float maxDuration)
|
|
||||||
{
|
|
||||||
if (_autoTargettingInstance == null || _autoTargettingInstance.CurrentTarget == null)
|
|
||||||
{
|
|
||||||
if (maxDuration > 0) yield return new WaitForSeconds(maxDuration);
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
float timeElapsed = 0;
|
|
||||||
while (timeElapsed < maxDuration)
|
|
||||||
{
|
|
||||||
if (_autoTargettingInstance.CurrentTarget != null)
|
|
||||||
{
|
|
||||||
vFSMBehaviourController currentTarget = _autoTargettingInstance.CurrentTarget;
|
|
||||||
Transform playerTransform = transform;
|
|
||||||
|
|
||||||
float distSqr = (currentTarget.transform.position - playerTransform.position).sqrMagnitude;
|
|
||||||
|
|
||||||
if (distSqr <= _autoTargettingInstance.maxTargetingDistance * _autoTargettingInstance.maxTargetingDistance)
|
|
||||||
{
|
|
||||||
if (_autoTargettingInstance.IsTargetInAngle(playerTransform, currentTarget, _autoTargettingInstance.targetingAngleThreshold))
|
|
||||||
{
|
|
||||||
Vector3 directionToTarget = currentTarget.transform.position - playerTransform.position;
|
|
||||||
directionToTarget.y = 0f;
|
|
||||||
|
|
||||||
if (directionToTarget.sqrMagnitude > 0.0001f)
|
|
||||||
{
|
|
||||||
Quaternion targetRotation = Quaternion.LookRotation(directionToTarget.normalized);
|
|
||||||
playerTransform.rotation = Quaternion.RotateTowards(playerTransform.rotation, targetRotation, Time.deltaTime * _autoTargettingInstance.playerRotationSpeed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
timeElapsed += Time.deltaTime;
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SnapLookTowardsAutoTarget()
|
private void SnapLookTowardsAutoTarget()
|
||||||
{
|
{
|
||||||
if (_autoTargettingInstance == null || _autoTargettingInstance.CurrentTarget == null) return;
|
if (_autoTargettingInstance == null || _autoTargettingInstance.CurrentTarget == null) return;
|
||||||
|
|
||||||
vFSMBehaviourController currentTarget = _autoTargettingInstance.CurrentTarget;
|
Transform target = _autoTargettingInstance.CurrentTarget.transform;
|
||||||
Transform playerTransform = transform;
|
Vector3 direction = target.position - transform.position;
|
||||||
|
direction.y = 0f;
|
||||||
|
|
||||||
float distSqr = (currentTarget.transform.position - playerTransform.position).sqrMagnitude;
|
if (direction.sqrMagnitude > 0.001f)
|
||||||
if (distSqr > _autoTargettingInstance.maxTargetingDistance * _autoTargettingInstance.maxTargetingDistance) return;
|
|
||||||
|
|
||||||
if (!_autoTargettingInstance.IsTargetInAngle(playerTransform, currentTarget, _autoTargettingInstance.targetingAngleThreshold)) return;
|
|
||||||
|
|
||||||
Vector3 directionToTarget = currentTarget.transform.position - playerTransform.position;
|
|
||||||
directionToTarget.y = 0f;
|
|
||||||
|
|
||||||
if (directionToTarget.sqrMagnitude > 0.0001f)
|
|
||||||
{
|
{
|
||||||
playerTransform.rotation = Quaternion.LookRotation(directionToTarget.normalized);
|
transform.rotation = Quaternion.LookRotation(direction.normalized);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AimFireball(GameObject fireballClone)
|
private void PlayNoFaithFeedback()
|
||||||
{
|
{
|
||||||
Vector3 aimDirection = transform.forward;
|
if (!canPlayNoFaithClip) return;
|
||||||
|
|
||||||
|
canPlayNoFaithClip = false;
|
||||||
|
|
||||||
|
// Feedback
|
||||||
|
if (bItemCollectionDisplay.Instance != null)
|
||||||
|
bItemCollectionDisplay.Instance.FadeText("Not enough Faith", 4, 0.25f);
|
||||||
|
|
||||||
|
if (Player.Instance != null)
|
||||||
|
Player.Instance.PlayNoFaithClip();
|
||||||
|
|
||||||
if (_autoTargettingInstance != null && _autoTargettingInstance.CurrentTarget != null)
|
// Reset cooldown
|
||||||
|
DOVirtual.DelayedCall(1.5f, () => canPlayNoFaithClip = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegisterSpellDamageEvents(GameObject spellInstance, SpellDefinition spellDef)
|
||||||
|
{
|
||||||
|
if (spellInstance == null) return;
|
||||||
|
|
||||||
|
// Find all damage components on the spawned object
|
||||||
|
var damageComps = spellInstance.GetComponentsInChildren<Invector.vObjectDamage>();
|
||||||
|
|
||||||
|
foreach (var comp in damageComps)
|
||||||
{
|
{
|
||||||
vFSMBehaviourController autoTarget = _autoTargettingInstance.CurrentTarget;
|
// Invector's vObjectDamage event gives us the Collider directly
|
||||||
Transform playerTransform = transform;
|
comp.onHit.AddListener((Collider hitCollider) =>
|
||||||
|
|
||||||
float distSqrToAutoTarget = (autoTarget.transform.position - playerTransform.position).sqrMagnitude;
|
|
||||||
|
|
||||||
if (distSqrToAutoTarget <= _autoTargettingInstance.maxTargetingDistance * _autoTargettingInstance.maxTargetingDistance &&
|
|
||||||
_autoTargettingInstance.IsTargetInAngle(playerTransform, autoTarget, _autoTargettingInstance.targetingAngleThreshold))
|
|
||||||
{
|
{
|
||||||
Vector3 targetPosition = autoTarget.transform.position;
|
// Forward the event to anyone listening to MagicAttacks
|
||||||
targetPosition.y += fireballTargetYPositionOffset;
|
OnSpellHit?.Invoke(spellDef, hitCollider);
|
||||||
aimDirection = (targetPosition - fireballClone.transform.position).normalized;
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aimDirection == transform.forward && lockOn != null && lockOn.isLockingOn && lockOn.currentTarget != null)
|
|
||||||
{
|
|
||||||
Vector3 targetPosition = lockOn.currentTarget.position;
|
|
||||||
targetPosition.y += fireballTargetYPositionOffset;
|
|
||||||
aimDirection = (targetPosition - fireballClone.transform.position).normalized;
|
|
||||||
}
|
|
||||||
else if (aimDirection == transform.forward && lockOn != null)
|
|
||||||
{
|
|
||||||
List<Transform> closeEnemies = lockOn.GetNearbyTargets();
|
|
||||||
if (closeEnemies.Count > 0)
|
|
||||||
{
|
|
||||||
Transform bestFallbackTarget = null;
|
|
||||||
float minAngle = float.MaxValue;
|
|
||||||
|
|
||||||
foreach (var enemyTransform in closeEnemies)
|
|
||||||
{
|
|
||||||
Vector3 directionToEnemyFromPlayer = (enemyTransform.position - transform.position).normalized;
|
|
||||||
float angleToEnemy = Vector3.Angle(transform.forward, directionToEnemyFromPlayer);
|
|
||||||
|
|
||||||
if (Vector3.Dot(transform.forward, directionToEnemyFromPlayer) > fireballAimerThreshold)
|
|
||||||
{
|
|
||||||
if (angleToEnemy < minAngle)
|
|
||||||
{
|
|
||||||
minAngle = angleToEnemy;
|
|
||||||
bestFallbackTarget = enemyTransform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bestFallbackTarget != null)
|
|
||||||
{
|
|
||||||
Vector3 targetPosition = bestFallbackTarget.position;
|
|
||||||
targetPosition.y += fireballTargetYPositionOffset;
|
|
||||||
aimDirection = (targetPosition - fireballClone.transform.position).normalized;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3 finalAimDirection = new Vector3(aimDirection.x, aimDirection.y + fireballAimerHeightAdjuster, aimDirection.z);
|
|
||||||
if (finalAimDirection.sqrMagnitude > 0.001f)
|
|
||||||
{
|
|
||||||
fireballClone.transform.rotation = Quaternion.LookRotation(finalAimDirection.normalized);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableBrieflyFireballDamager(object sender, RFX4_PhysicsMotion.RFX4_CollisionInfo e)
|
|
||||||
{
|
|
||||||
RFX4_PhysicsMotion rFX4_PhysicsMotion = (RFX4_PhysicsMotion)sender;
|
|
||||||
CapsuleCollider collider = rFX4_PhysicsMotion.GetComponentInChildren<CapsuleCollider>();
|
|
||||||
if (collider != null) StartCoroutine(EnableBrieflyFireballDamagerCoroutine(collider));
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator EnableBrieflyFireballDamagerCoroutine(CapsuleCollider collider)
|
|
||||||
{
|
|
||||||
collider.enabled = true;
|
|
||||||
yield return new WaitForSeconds(fireballDamagerDuration);
|
|
||||||
collider.enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//placeholder for future methods related to magic attacks
|
|
||||||
/// <summary>
|
|
||||||
/// Spells call this to rotate the player before firing
|
|
||||||
/// </summary>
|
|
||||||
public IEnumerator RotateTowardsTargetRoutine(Transform target, float duration)
|
|
||||||
{
|
|
||||||
if (target == null || duration <= 0) yield break;
|
|
||||||
|
|
||||||
float timer = 0f;
|
|
||||||
while (timer < duration)
|
|
||||||
{
|
|
||||||
if (target == null) yield break;
|
|
||||||
|
|
||||||
Vector3 dir = (target.position - transform.position);
|
|
||||||
dir.y = 0;
|
|
||||||
if (dir.sqrMagnitude > 0.01f)
|
|
||||||
{
|
|
||||||
Quaternion look = Quaternion.LookRotation(dir);
|
|
||||||
transform.rotation = Quaternion.RotateTowards(transform.rotation, look, Time.deltaTime * 500f); // Fast rotation
|
|
||||||
}
|
|
||||||
timer += Time.deltaTime;
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Helper to apply Trinket damage (Soulfire) to an object
|
|
||||||
/// </summary>
|
|
||||||
public void ApplyDamageModifiers(GameObject spellObject)
|
|
||||||
{
|
|
||||||
float mult = Player.Instance.CurrentTrinketStats.soulfireDamageMult;
|
|
||||||
if (Mathf.Abs(mult - 1f) < 0.01f) return;
|
|
||||||
|
|
||||||
var damages = spellObject.GetComponentsInChildren<Invector.vObjectDamage>();
|
|
||||||
foreach (var d in damages)
|
|
||||||
{
|
|
||||||
d.damage.damageValue = Mathf.RoundToInt(d.damage.damageValue * mult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bItem GetEquippedSpellItem()
|
|
||||||
{
|
|
||||||
if (powersArea != null && powersArea.equipSlots.Count > 0)
|
|
||||||
{
|
|
||||||
// Assuming the logic uses the current selection
|
|
||||||
// If powersArea tracks selection internally, use powersArea.currentEquippedItem
|
|
||||||
return powersArea.currentEquippedItem;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,14 +4,20 @@ using Invector;
|
|||||||
|
|
||||||
namespace Beyond
|
namespace Beyond
|
||||||
{
|
{
|
||||||
[CreateAssetMenu(menuName = "Magic/Spells/Projectile Spell")]
|
[CreateAssetMenu(menuName = "Magic/Spells/Projectile (Fireball)")]
|
||||||
public class ProjectileSpell : SpellDefinition
|
public class ProjectileSpell : SpellDefinition
|
||||||
{
|
{
|
||||||
[Header("Projectile Settings")]
|
[Header("Projectile Settings")]
|
||||||
public GameObject projectilePrefab;
|
public GameObject projectilePrefab;
|
||||||
public float spawnDelay = 0.2f; // Sync with animation hand throw
|
public float spawnDelay = 0.2f;
|
||||||
public float lifeTime = 5f;
|
public float lifeTime = 10f;
|
||||||
public float aimHeightOffset = 1.0f;
|
|
||||||
|
[Header("Spawn Adjustments")]
|
||||||
|
[Tooltip("Position relative to Player Root. X=Right, Y=Up, Z=Forward.\nExample: (0, 1.5, 1.0) is Chest Height, 1m forward.")]
|
||||||
|
public Vector3 spawnOffset = new Vector3(0f, 1.5f, 1.0f);
|
||||||
|
|
||||||
|
[Tooltip("Offset for aiming logic only. Usually slightly higher than the target's pivot.")]
|
||||||
|
public float aimHeightOffset = 0.75f;
|
||||||
|
|
||||||
public override void Cast(MagicAttacks caster, Transform target)
|
public override void Cast(MagicAttacks caster, Transform target)
|
||||||
{
|
{
|
||||||
@@ -23,21 +29,44 @@ namespace Beyond
|
|||||||
// 1. Rotate
|
// 1. Rotate
|
||||||
yield return caster.RotateTowardsTargetRoutine(target, rotationDuration);
|
yield return caster.RotateTowardsTargetRoutine(target, rotationDuration);
|
||||||
|
|
||||||
// 2. Wait for animation point
|
// 2. Wait
|
||||||
yield return new WaitForSeconds(Mathf.Max(0, spawnDelay - rotationDuration));
|
float remainingDelay = spawnDelay - rotationDuration;
|
||||||
|
if (remainingDelay > 0) yield return new WaitForSeconds(remainingDelay);
|
||||||
|
|
||||||
|
// 3. Calculate Spawn Position (Relative to Player)
|
||||||
|
// TransformPoint converts local (Offset) to world space based on Player position/rotation
|
||||||
|
Vector3 spawnPos = caster.transform.TransformPoint(spawnOffset);
|
||||||
|
|
||||||
|
// 4. Calculate Rotation (Aiming)
|
||||||
|
Quaternion spawnRot = caster.transform.rotation; // Default forward
|
||||||
|
|
||||||
// 3. Spawn
|
|
||||||
Vector3 spawnPos = caster.transform.position + caster.transform.forward + Vector3.up * 1.5f;
|
|
||||||
GameObject obj = Instantiate(projectilePrefab, spawnPos, caster.transform.rotation);
|
|
||||||
|
|
||||||
// 4. Aim
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
Vector3 aimDir = (target.position + Vector3.up * aimHeightOffset) - spawnPos;
|
Vector3 targetPos = target.position;
|
||||||
obj.transform.rotation = Quaternion.LookRotation(aimDir);
|
targetPos.y += aimHeightOffset;
|
||||||
|
Vector3 aimDir = (targetPos - spawnPos).normalized;
|
||||||
|
|
||||||
|
// Slight arc adjustment
|
||||||
|
aimDir.y += 0.1f;
|
||||||
|
|
||||||
|
if (aimDir.sqrMagnitude > 0.001f)
|
||||||
|
spawnRot = Quaternion.LookRotation(aimDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Apply Modifiers
|
// 5. Instantiate
|
||||||
|
GameObject obj = Instantiate(projectilePrefab, spawnPos, spawnRot);
|
||||||
|
|
||||||
|
// 6. Ignore Collision with Caster (Crucial!)
|
||||||
|
Collider projectileCollider = obj.GetComponentInChildren<Collider>();
|
||||||
|
Collider playerCollider = caster.GetComponent<Collider>();
|
||||||
|
|
||||||
|
if (projectileCollider != null && playerCollider != null)
|
||||||
|
{
|
||||||
|
Physics.IgnoreCollision(projectileCollider, playerCollider);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. Register Events & Modifiers
|
||||||
|
caster.RegisterSpellDamageEvents(obj, this);
|
||||||
caster.ApplyDamageModifiers(obj);
|
caster.ApplyDamageModifiers(obj);
|
||||||
|
|
||||||
Destroy(obj, lifeTime);
|
Destroy(obj, lifeTime);
|
||||||
|
|||||||
@@ -3,10 +3,18 @@ using Sirenix.OdinInspector;
|
|||||||
|
|
||||||
namespace Beyond
|
namespace Beyond
|
||||||
{
|
{
|
||||||
|
public enum SpellCategory
|
||||||
|
{
|
||||||
|
Utility,
|
||||||
|
Defensive,
|
||||||
|
Offensive_Power, // Used for Shadow Slayer / Fireball logic
|
||||||
|
Offensive_Light
|
||||||
|
}
|
||||||
public abstract class SpellDefinition : ScriptableObject
|
public abstract class SpellDefinition : ScriptableObject
|
||||||
{
|
{
|
||||||
[Header("General Settings")]
|
[Header("General Settings")]
|
||||||
public string spellName;
|
public string spellName;
|
||||||
|
public SpellCategory category;
|
||||||
public string animationClipName;
|
public string animationClipName;
|
||||||
[TextArea] public string description;
|
[TextArea] public string description;
|
||||||
|
|
||||||
|
|||||||
25
Assets/Scripts/Characters/Skills/Spell_PurifyingBlaze.asset
Normal file
25
Assets/Scripts/Characters/Skills/Spell_PurifyingBlaze.asset
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 2fa1c233b63854f6d845066ccd8e48cd, type: 3}
|
||||||
|
m_Name: Spell_PurifyingBlaze
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
spellName:
|
||||||
|
animationClipName:
|
||||||
|
description:
|
||||||
|
baseFaithCost: 10
|
||||||
|
castTime: 0.5
|
||||||
|
rotationDuration: 0.3
|
||||||
|
type: 0
|
||||||
|
effectPrefab: {fileID: 0}
|
||||||
|
preCastDelay: 0
|
||||||
|
duration: 2
|
||||||
|
postEndDelay: 0
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 314c562ab8abc4807882b972f2458352
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -18,8 +18,9 @@ public class SpellActivator : MonoBehaviour
|
|||||||
|
|
||||||
if (!magicAttacks.isPlaying)
|
if (!magicAttacks.isPlaying)
|
||||||
{
|
{
|
||||||
magicAttacks.TryToPlaySpellAnimation();
|
//magicAttacks.TryToPlaySpellAnimation();
|
||||||
Debug.Log("executing:" + magicAttacks.m_selectedType);
|
//Debug.Log("executing:" + magicAttacks.m_selectedType);
|
||||||
|
Debug.LogError("!!not implemented!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@ namespace Beyond
|
|||||||
public virtual void OnReceiveAttack(vDamage damage, vIMeleeFighter attacker)
|
public virtual void OnReceiveAttack(vDamage damage, vIMeleeFighter attacker)
|
||||||
{
|
{
|
||||||
if (cc == null) return;
|
if (cc == null) return;
|
||||||
if (magicAttacks != null && magicAttacks.shieldEffectIsActive) return;
|
if (magicAttacks != null && magicAttacks.IsShieldActive) return;
|
||||||
|
|
||||||
if (!damage.ignoreDefense && isBlocking && meleeManager != null &&
|
if (!damage.ignoreDefense && isBlocking && meleeManager != null &&
|
||||||
meleeManager.CanBlockAttack(damage.sender.position))
|
meleeManager.CanBlockAttack(damage.sender.position))
|
||||||
|
|||||||
@@ -12,12 +12,19 @@ namespace Beyond
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
baseStepController.ConditionsAreMet += () => magicAttacks.isPlaying;
|
// [FIX] magicAttacks.isPlaying is private.
|
||||||
|
// We check the animator directly for the "Spell" tag or state.
|
||||||
|
baseStepController.ConditionsAreMet += CheckIsPlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
private bool CheckIsPlaying()
|
||||||
private void Update()
|
|
||||||
{
|
{
|
||||||
|
var animator = magicAttacks.GetComponent<Animator>();
|
||||||
|
if (animator == null) return false;
|
||||||
|
|
||||||
|
// Assuming layer 5 is spells (from your MagicAttacks constants)
|
||||||
|
var state = animator.GetCurrentAnimatorStateInfo(5);
|
||||||
|
return state.IsTag("Spell") || state.IsTag("special");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,12 @@ namespace Beyond
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
baseStepController.ConditionsAreMet += () => magicAttacks.selectedEffect.secondaryName == "Covert Gaze ";
|
// [FIX] Checked the equipped item name instead of 'selectedEffect'
|
||||||
|
baseStepController.ConditionsAreMet += () =>
|
||||||
|
{
|
||||||
|
var item = magicAttacks.GetEquippedSpellItem();
|
||||||
|
return item != null && item.name.Contains("Covert Gaze");
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,16 @@ namespace Beyond {
|
|||||||
|
|
||||||
if (m_currentItem.type == bItemType.QuantaPower || m_currentItem.type == bItemType.PowerScroll)
|
if (m_currentItem.type == bItemType.QuantaPower || m_currentItem.type == bItemType.PowerScroll)
|
||||||
{
|
{
|
||||||
Player.Instance.Magic.SelectPowerBasedOnArea(currentIndex);
|
// --- FIX STARTS HERE ---
|
||||||
|
// Old logic: Player.Instance.Magic.SelectPowerBasedOnArea(currentIndex);
|
||||||
|
// New Logic: Directly tell the equipment area to select this slot.
|
||||||
|
// MagicAttacks automatically looks at whatever is equipped in this area.
|
||||||
|
if (equipArea != null)
|
||||||
|
{
|
||||||
|
equipArea.SetEquipSlot(currentIndex);
|
||||||
|
}
|
||||||
|
// --- FIX ENDS HERE ---
|
||||||
|
|
||||||
if (!InputNameToPress.IsNullOrWhitespace())
|
if (!InputNameToPress.IsNullOrWhitespace())
|
||||||
{
|
{
|
||||||
CrossPlatformInputManager.SetButtonDown(InputNameToPress);
|
CrossPlatformInputManager.SetButtonDown(InputNameToPress);
|
||||||
@@ -263,5 +272,4 @@ namespace Beyond {
|
|||||||
isLocked = false;
|
isLocked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
@@ -35,7 +35,7 @@ Material:
|
|||||||
m_LightmapFlags: 2
|
m_LightmapFlags: 2
|
||||||
m_EnableInstancingVariants: 0
|
m_EnableInstancingVariants: 0
|
||||||
m_DoubleSidedGI: 1
|
m_DoubleSidedGI: 1
|
||||||
m_CustomRenderQueue: -1
|
m_CustomRenderQueue: 2450
|
||||||
stringTagMap:
|
stringTagMap:
|
||||||
RenderType: TransparentCutout
|
RenderType: TransparentCutout
|
||||||
disabledShaderPasses:
|
disabledShaderPasses:
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ Material:
|
|||||||
- _Cutoff: 0.5
|
- _Cutoff: 0.5
|
||||||
- _DetailNormalMapScale: 0.3
|
- _DetailNormalMapScale: 0.3
|
||||||
- _DstBlend: 10
|
- _DstBlend: 10
|
||||||
- _DstBlendAlpha: 0
|
- _DstBlendAlpha: 10
|
||||||
- _EffectThreshold: 0.135
|
- _EffectThreshold: 0.135
|
||||||
- _FadeDistance: 0
|
- _FadeDistance: 0
|
||||||
- _FarFadeDistance: 500
|
- _FarFadeDistance: 500
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src",
|
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src",
|
||||||
"com.unity.ai.navigation": "2.0.9",
|
"com.unity.ai.navigation": "2.0.9",
|
||||||
"com.unity.ide.visualstudio": "2.0.23",
|
"com.unity.ide.visualstudio": "2.0.26",
|
||||||
"com.unity.localization": "1.5.5",
|
"com.unity.localization": "1.5.8",
|
||||||
"com.unity.memoryprofiler": "1.1.8",
|
"com.unity.memoryprofiler": "1.1.9",
|
||||||
"com.unity.multiplayer.center": "1.0.0",
|
"com.unity.multiplayer.center": "1.0.0",
|
||||||
"com.unity.postprocessing": "3.5.0",
|
"com.unity.postprocessing": "3.5.0",
|
||||||
"com.unity.render-pipelines.universal": "17.0.4",
|
"com.unity.render-pipelines.universal": "17.0.4",
|
||||||
"com.unity.timeline": "1.8.9",
|
"com.unity.timeline": "1.8.10",
|
||||||
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.11",
|
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.11",
|
||||||
"com.unity.visualeffectgraph": "17.0.4",
|
"com.unity.visualeffectgraph": "17.0.4",
|
||||||
"com.unity.modules.accessibility": "1.0.0",
|
"com.unity.modules.accessibility": "1.0.0",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"hash": "02cf05485ac0bbd9f61e7b829dd6526db7c9dba5"
|
"hash": "02cf05485ac0bbd9f61e7b829dd6526db7c9dba5"
|
||||||
},
|
},
|
||||||
"com.unity.addressables": {
|
"com.unity.addressables": {
|
||||||
"version": "2.7.2",
|
"version": "2.7.6",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"com.unity.modules.jsonserialize": "1.0.0",
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
"com.unity.modules.imageconversion": "1.0.0",
|
"com.unity.modules.imageconversion": "1.0.0",
|
||||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
"com.unity.scriptablebuildpipeline": "2.4.1",
|
"com.unity.scriptablebuildpipeline": "2.5.0",
|
||||||
"com.unity.modules.unitywebrequestassetbundle": "1.0.0"
|
"com.unity.modules.unitywebrequestassetbundle": "1.0.0"
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.burst": {
|
"com.unity.burst": {
|
||||||
"version": "1.8.24",
|
"version": "1.8.27",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -45,13 +45,14 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.collections": {
|
"com.unity.collections": {
|
||||||
"version": "2.5.1",
|
"version": "2.6.2",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.burst": "1.8.17",
|
"com.unity.burst": "1.8.23",
|
||||||
"com.unity.test-framework": "1.4.5",
|
"com.unity.mathematics": "1.3.2",
|
||||||
"com.unity.nuget.mono-cecil": "1.11.4",
|
"com.unity.test-framework": "1.4.6",
|
||||||
|
"com.unity.nuget.mono-cecil": "1.11.5",
|
||||||
"com.unity.test-framework.performance": "3.0.3"
|
"com.unity.test-framework.performance": "3.0.3"
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
@@ -70,16 +71,16 @@
|
|||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
},
|
},
|
||||||
"com.unity.ide.visualstudio": {
|
"com.unity.ide.visualstudio": {
|
||||||
"version": "2.0.23",
|
"version": "2.0.26",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.test-framework": "1.1.9"
|
"com.unity.test-framework": "1.1.33"
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.localization": {
|
"com.unity.localization": {
|
||||||
"version": "1.5.5",
|
"version": "1.5.8",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -96,7 +97,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.memoryprofiler": {
|
"com.unity.memoryprofiler": {
|
||||||
"version": "1.1.8",
|
"version": "1.1.9",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -117,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.unity.nuget.mono-cecil": {
|
"com.unity.nuget.mono-cecil": {
|
||||||
"version": "1.11.4",
|
"version": "1.11.5",
|
||||||
"depth": 2,
|
"depth": 2,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
@@ -190,7 +191,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.unity.scriptablebuildpipeline": {
|
"com.unity.scriptablebuildpipeline": {
|
||||||
"version": "2.4.1",
|
"version": "2.5.0",
|
||||||
"depth": 2,
|
"depth": 2,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -232,7 +233,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.test-framework": {
|
"com.unity.test-framework": {
|
||||||
"version": "1.5.1",
|
"version": "1.6.0",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "builtin",
|
"source": "builtin",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -242,7 +243,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.unity.test-framework.performance": {
|
"com.unity.test-framework.performance": {
|
||||||
"version": "3.1.0",
|
"version": "3.2.0",
|
||||||
"depth": 2,
|
"depth": 2,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -252,7 +253,7 @@
|
|||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.timeline": {
|
"com.unity.timeline": {
|
||||||
"version": "1.8.9",
|
"version": "1.8.10",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 6000.0.58f2
|
m_EditorVersion: 6000.0.65f1
|
||||||
m_EditorVersionWithRevision: 6000.0.58f2 (92dee566b325)
|
m_EditorVersionWithRevision: 6000.0.65f1 (a18e2220bd50)
|
||||||
|
|||||||
Reference in New Issue
Block a user