Codingkaizenn
This commit is contained in:
@@ -612,8 +612,18 @@ MonoBehaviour:
|
|||||||
features:
|
features:
|
||||||
- {fileID: 8736661028334727731}
|
- {fileID: 8736661028334727731}
|
||||||
- {fileID: 3598254934845347770}
|
- {fileID: 3598254934845347770}
|
||||||
|
- {fileID: -9214271668543163027}
|
||||||
|
- {fileID: -7680076135584121790}
|
||||||
- {fileID: 1170704673688743257}
|
- {fileID: 1170704673688743257}
|
||||||
|
- {fileID: -1187533949232362847}
|
||||||
|
- {fileID: -949347770443697596}
|
||||||
|
- {fileID: -1529727133502117446}
|
||||||
- {fileID: 5153017048313567732}
|
- {fileID: 5153017048313567732}
|
||||||
|
- {fileID: 265326132771859475}
|
||||||
|
- {fileID: 2834828863856360103}
|
||||||
|
- {fileID: -2851827796942056979}
|
||||||
|
- {fileID: -8128959895479975907}
|
||||||
|
- {fileID: -1926258647260940646}
|
||||||
- {fileID: 6481653220666705815}
|
- {fileID: 6481653220666705815}
|
||||||
- {fileID: 7393116930172532905}
|
- {fileID: 7393116930172532905}
|
||||||
- {fileID: 744375598501864353}
|
- {fileID: 744375598501864353}
|
||||||
@@ -1285,8 +1295,8 @@ MonoBehaviour:
|
|||||||
features:
|
features:
|
||||||
- {fileID: 7011443450567333355}
|
- {fileID: 7011443450567333355}
|
||||||
- {fileID: -671281728444007487}
|
- {fileID: -671281728444007487}
|
||||||
- {fileID: 7055518550748799546}
|
- {fileID: 6956056911768161135}
|
||||||
- {fileID: 5091991234558418143}
|
- {fileID: -1734471456787174204}
|
||||||
- {fileID: 8980318060753866109}
|
- {fileID: 8980318060753866109}
|
||||||
- {fileID: -6559185765804338520}
|
- {fileID: -6559185765804338520}
|
||||||
- {fileID: -4756202077021157709}
|
- {fileID: -4756202077021157709}
|
||||||
@@ -1297,7 +1307,7 @@ MonoBehaviour:
|
|||||||
- {fileID: 348827886137839178}
|
- {fileID: 348827886137839178}
|
||||||
- {fileID: -7499073031166464939}
|
- {fileID: -7499073031166464939}
|
||||||
- {fileID: 7666556398442971420}
|
- {fileID: 7666556398442971420}
|
||||||
- {fileID: 1118878472687837173}
|
- {fileID: 431653824124869831}
|
||||||
- {fileID: 3985858319333531581}
|
- {fileID: 3985858319333531581}
|
||||||
- {fileID: -6511185071715886993}
|
- {fileID: -6511185071715886993}
|
||||||
- {fileID: -4363231183632145407}
|
- {fileID: -4363231183632145407}
|
||||||
@@ -1703,7 +1713,7 @@ MonoBehaviour:
|
|||||||
nameUi: 'Android XR: AR Anchor'
|
nameUi: 'Android XR: AR Anchor'
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
featureIdInternal: com.unity.openxr.feature.arfoundation-androidxr-anchor
|
featureIdInternal: com.unity.openxr.feature.arfoundation-androidxr-anchor
|
||||||
openxrExtensionStrings: XR_ANDROID_trackables XR_ANDROID_device_anchor_persistence
|
openxrExtensionStrings: XR_ANDROID_trackables
|
||||||
company: Unity Technologies
|
company: Unity Technologies
|
||||||
priority: 0
|
priority: 0
|
||||||
targetOpenXRApiVersion:
|
targetOpenXRApiVersion:
|
||||||
@@ -2672,7 +2682,7 @@ MonoBehaviour:
|
|||||||
nameUi: 'Android XR: AR Anchor'
|
nameUi: 'Android XR: AR Anchor'
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
featureIdInternal: com.unity.openxr.feature.arfoundation-androidxr-anchor
|
featureIdInternal: com.unity.openxr.feature.arfoundation-androidxr-anchor
|
||||||
openxrExtensionStrings: XR_ANDROID_trackables XR_ANDROID_device_anchor_persistence
|
openxrExtensionStrings: XR_ANDROID_trackables
|
||||||
company: Unity Technologies
|
company: Unity Technologies
|
||||||
priority: 0
|
priority: 0
|
||||||
targetOpenXRApiVersion:
|
targetOpenXRApiVersion:
|
||||||
|
|||||||
@@ -2609,6 +2609,8 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier: Assembly-CSharp::CodingModeManager
|
m_EditorClassIdentifier: Assembly-CSharp::CodingModeManager
|
||||||
socketA: {fileID: 1908705210}
|
socketA: {fileID: 1908705210}
|
||||||
socketB: {fileID: 2140477052}
|
socketB: {fileID: 2140477052}
|
||||||
|
moveProvider: {fileID: 561596346}
|
||||||
|
turnProvider: {fileID: 1959366462}
|
||||||
--- !u!1 &290251385
|
--- !u!1 &290251385
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3730,7 +3732,7 @@ GameObject:
|
|||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!114 &404289282
|
--- !u!114 &404289282
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -14189,6 +14191,17 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 1030996972, guid: abc00000000006984399163773085844, type: 3}
|
m_CorrespondingSourceObject: {fileID: 1030996972, guid: abc00000000006984399163773085844, type: 3}
|
||||||
m_PrefabInstance: {fileID: 549303092}
|
m_PrefabInstance: {fileID: 549303092}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &561596346 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 8053059486601427065, guid: 77e7c27b2c5525e4aa8cc9f99d654486, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1063987680}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9b1e8c997df241c1a67045eeac79b41b, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &563363382
|
--- !u!1 &563363382
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -16899,6 +16912,20 @@ Rigidbody:
|
|||||||
m_Interpolate: 0
|
m_Interpolate: 0
|
||||||
m_Constraints: 0
|
m_Constraints: 0
|
||||||
m_CollisionDetection: 0
|
m_CollisionDetection: 0
|
||||||
|
--- !u!114 &852379954
|
||||||
|
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: fc1515ab76e54f068e2f2207940fab32, type: 3}
|
||||||
|
m_Name: Coding/ZL
|
||||||
|
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.InputActionReference
|
||||||
|
m_Asset: {fileID: -944628639613478452, guid: 5bbfa95a7ff8c42848c1cb2a29323d66, type: 3}
|
||||||
|
m_ActionId: 1839ae60-9003-482a-badd-1a6f05ee0c41
|
||||||
--- !u!1 &853393808
|
--- !u!1 &853393808
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -19386,20 +19413,6 @@ GameObject:
|
|||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!114 &1019043664
|
|
||||||
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: fc1515ab76e54f068e2f2207940fab32, type: 3}
|
|
||||||
m_Name: Coding/ZL
|
|
||||||
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.InputActionReference
|
|
||||||
m_Asset: {fileID: -944628639613478452, guid: 5bbfa95a7ff8c42848c1cb2a29323d66, type: 3}
|
|
||||||
m_ActionId: 1839ae60-9003-482a-badd-1a6f05ee0c41
|
|
||||||
--- !u!1001 &1023362196
|
--- !u!1001 &1023362196
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -646627,7 +646640,7 @@ MonoBehaviour:
|
|||||||
m_Interactions:
|
m_Interactions:
|
||||||
m_SingletonActionBindings: []
|
m_SingletonActionBindings: []
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_Reference: {fileID: 1019043664}
|
m_Reference: {fileID: 852379954}
|
||||||
zrButtonAction:
|
zrButtonAction:
|
||||||
m_UseReference: 1
|
m_UseReference: 1
|
||||||
m_Action:
|
m_Action:
|
||||||
@@ -646640,6 +646653,38 @@ MonoBehaviour:
|
|||||||
m_SingletonActionBindings: []
|
m_SingletonActionBindings: []
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_Reference: {fileID: 1559013432}
|
m_Reference: {fileID: 1559013432}
|
||||||
|
moveAction:
|
||||||
|
m_UseReference: 1
|
||||||
|
m_Action:
|
||||||
|
m_Name: Move
|
||||||
|
m_Type: 0
|
||||||
|
m_ExpectedControlType:
|
||||||
|
m_Id: 29fbf7b8-1de3-48b3-b5dc-6373203a53b1
|
||||||
|
m_Processors:
|
||||||
|
m_Interactions:
|
||||||
|
m_SingletonActionBindings:
|
||||||
|
- m_Name:
|
||||||
|
m_Id: 4ec0b1e0-6cd6-488a-96f9-06c64fb7765b
|
||||||
|
m_Path:
|
||||||
|
m_Interactions:
|
||||||
|
m_Processors:
|
||||||
|
m_Groups:
|
||||||
|
m_Action: Move
|
||||||
|
m_Flags: 0
|
||||||
|
m_Flags: 0
|
||||||
|
m_Reference: {fileID: 1649813743}
|
||||||
|
turnAction:
|
||||||
|
m_UseReference: 0
|
||||||
|
m_Action:
|
||||||
|
m_Name: Turn
|
||||||
|
m_Type: 0
|
||||||
|
m_ExpectedControlType:
|
||||||
|
m_Id: 3cb7fdd6-8d51-4079-8e0f-fd026397a158
|
||||||
|
m_Processors:
|
||||||
|
m_Interactions:
|
||||||
|
m_SingletonActionBindings: []
|
||||||
|
m_Flags: 0
|
||||||
|
m_Reference: {fileID: 0}
|
||||||
maxGauge: 10
|
maxGauge: 10
|
||||||
currentGauge: 0
|
currentGauge: 0
|
||||||
codingModeUI: {fileID: 797096988}
|
codingModeUI: {fileID: 797096988}
|
||||||
@@ -649754,6 +649799,20 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 1030989325, guid: abc00000000011493234571705517100, type: 3}
|
m_CorrespondingSourceObject: {fileID: 1030989325, guid: abc00000000011493234571705517100, type: 3}
|
||||||
m_PrefabInstance: {fileID: 1649650231}
|
m_PrefabInstance: {fileID: 1649650231}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!114 &1649813743
|
||||||
|
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: fc1515ab76e54f068e2f2207940fab32, type: 3}
|
||||||
|
m_Name: XRI Left Locomotion/Move
|
||||||
|
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.InputActionReference
|
||||||
|
m_Asset: {fileID: -944628639613478452, guid: c348712bda248c246b8c49b3db54643f, type: 3}
|
||||||
|
m_ActionId: 9693e25f-8a4f-4aed-842f-3961243c69a1
|
||||||
--- !u!1 &1667254582
|
--- !u!1 &1667254582
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -653527,6 +653586,17 @@ GameObject:
|
|||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1959366462 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 583340563854170035, guid: 77e7c27b2c5525e4aa8cc9f99d654486, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1063987680}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e9f365cf844c03449bc8973eead2c3c1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &1968677119
|
--- !u!1001 &1968677119
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -10,6 +10,15 @@ public class CodingModeManager : MonoBehaviour
|
|||||||
[Tooltip("台座に配置した Slot_B の XRSocketInteractor を指定してください")]
|
[Tooltip("台座に配置した Slot_B の XRSocketInteractor を指定してください")]
|
||||||
[SerializeField] private XRSocketInteractor socketB;
|
[SerializeField] private XRSocketInteractor socketB;
|
||||||
|
|
||||||
|
[Header("XR Interaction Toolkit 移動系コンポーネント")]
|
||||||
|
[Tooltip("Continuous Move Provider などの移動スクリプトをアタッチ")]
|
||||||
|
[SerializeField] private Behaviour moveProvider;
|
||||||
|
|
||||||
|
[Tooltip("Snap Turn Provider や Continuous Turn Provider などの旋回スクリプトをアタッチ")]
|
||||||
|
[SerializeField] private Behaviour turnProvider;
|
||||||
|
|
||||||
|
public bool IsCodingModeActive { get; private set; } = false;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
// ソケットにオブジェクトが「ハメ込まれた瞬間」のイベントを登録
|
// ソケットにオブジェクトが「ハメ込まれた瞬間」のイベントを登録
|
||||||
@@ -85,4 +94,15 @@ public class CodingModeManager : MonoBehaviour
|
|||||||
socketB.firstInteractableSelected.transform.position = transform.position + (transform.forward * -0.2f) + (transform.right * 0.1f);
|
socketB.firstInteractableSelected.transform.position = transform.position + (transform.forward * -0.2f) + (transform.right * 0.1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ToggleCodingMode()
|
||||||
|
{
|
||||||
|
IsCodingModeActive = !IsCodingModeActive;
|
||||||
|
|
||||||
|
// CodingModeが有効(true)なら、enabled を false にして足止めする
|
||||||
|
if (moveProvider != null) moveProvider.enabled = !IsCodingModeActive;
|
||||||
|
if (turnProvider != null) turnProvider.enabled = !IsCodingModeActive;
|
||||||
|
|
||||||
|
Debug.Log($"💻 CodingMode: {(IsCodingModeActive ? "ON (移動・旋回を一時ロック)" : "OFF (移動解禁)")}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.AI;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic; // Listを使うために追加
|
using System.Collections.Generic;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// プレイヤーの共通ゲージ、時間停止(Codingモード)、UI、および各種バフの制限時間を管理するクラス
|
/// プレイヤーの共通ゲージ、時間停止(Codingモード)、UI、および各種バフの制限時間を管理するクラス
|
||||||
@@ -14,6 +15,12 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
[SerializeField] private InputActionProperty zlButtonAction;
|
[SerializeField] private InputActionProperty zlButtonAction;
|
||||||
[SerializeField] private InputActionProperty zrButtonAction;
|
[SerializeField] private InputActionProperty zrButtonAction;
|
||||||
|
|
||||||
|
[Header("プレイヤー移動・操作制御用 入力設定")]
|
||||||
|
[Tooltip("プレイヤーの移動入力(例: LeftHand Move)のアクションを指定してください")]
|
||||||
|
[SerializeField] private InputActionProperty moveAction;
|
||||||
|
[Tooltip("プレイヤーの視点回転入力(例: RightHand Turn)があれば指定してください(任意)")]
|
||||||
|
[SerializeField] private InputActionProperty turnAction;
|
||||||
|
|
||||||
[Header("ゲージ設定")]
|
[Header("ゲージ設定")]
|
||||||
[SerializeField] private float maxGauge = 100f;
|
[SerializeField] private float maxGauge = 100f;
|
||||||
[SerializeField] private float currentGauge = 0f;
|
[SerializeField] private float currentGauge = 0f;
|
||||||
@@ -39,8 +46,9 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
// 現在Codingモード(時間停止中)かどうかのフラグ
|
// 現在Codingモード(時間停止中)かどうかのフラグ
|
||||||
private bool isCodingMode = false;
|
private bool isCodingMode = false;
|
||||||
|
|
||||||
// 【新設】一時停止させた敵のアニメーターを記憶しておくためのリスト
|
// 【記憶リスト】一時停止させた敵のアニメーターとNavMeshAgentを記憶しておく
|
||||||
private List<Animator> pausedAnimators = new List<Animator>();
|
private List<Animator> pausedAnimators = new List<Animator>();
|
||||||
|
private List<NavMeshAgent> pausedAgents = new List<NavMeshAgent>();
|
||||||
|
|
||||||
#region プロパティ
|
#region プロパティ
|
||||||
public bool IsAttackBuffActive => attackBuffTimer > 0f;
|
public bool IsAttackBuffActive => attackBuffTimer > 0f;
|
||||||
@@ -59,12 +67,16 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (zlButtonAction.action != null) zlButtonAction.action.Enable();
|
if (zlButtonAction.action != null) zlButtonAction.action.Enable();
|
||||||
if (zrButtonAction.action != null) zrButtonAction.action.Enable();
|
if (zrButtonAction.action != null) zrButtonAction.action.Enable();
|
||||||
|
if (moveAction.action != null) moveAction.action.Enable();
|
||||||
|
if (turnAction.action != null) turnAction.action.Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
if (zlButtonAction.action != null) zlButtonAction.action.Disable();
|
if (zlButtonAction.action != null) zlButtonAction.action.Disable();
|
||||||
if (zrButtonAction.action != null) zrButtonAction.action.Disable();
|
if (zrButtonAction.action != null) zrButtonAction.action.Disable();
|
||||||
|
if (moveAction.action != null) moveAction.action.Disable();
|
||||||
|
if (turnAction.action != null) turnAction.action.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
@@ -98,13 +110,22 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
bool zlPressed = zlButtonAction.action.triggered && zlButtonAction.action.ReadValue<float>() > 0.5f;
|
bool zlPressed = zlButtonAction.action.triggered && zlButtonAction.action.ReadValue<float>() > 0.5f;
|
||||||
bool zrPressed = zrButtonAction.action.triggered && zrButtonAction.action.ReadValue<float>() > 0.5f;
|
bool zrPressed = zrButtonAction.action.triggered && zrButtonAction.action.ReadValue<float>() > 0.5f;
|
||||||
|
|
||||||
|
// 同時押しの判定
|
||||||
|
bool isComboTriggered = (zlPressed && zrButtonAction.action.ReadValue<float>() > 0.5f) ||
|
||||||
|
(zrPressed && zlButtonAction.action.ReadValue<float>() > 0.5f);
|
||||||
|
|
||||||
|
if (isComboTriggered)
|
||||||
|
{
|
||||||
if (!isCodingMode && currentGauge >= maxGauge)
|
if (!isCodingMode && currentGauge >= maxGauge)
|
||||||
{
|
{
|
||||||
if ((zlPressed && zrButtonAction.action.ReadValue<float>() > 0.5f) ||
|
// 通常時 ➔ ゲージ満タンならCodingモード発動
|
||||||
(zrPressed && zlButtonAction.action.ReadValue<float>() > 0.5f))
|
|
||||||
{
|
|
||||||
StartCodingMode();
|
StartCodingMode();
|
||||||
}
|
}
|
||||||
|
else if (isCodingMode)
|
||||||
|
{
|
||||||
|
// ★Codingモード中に再度同時押し ➔ キャンセルして無消費で復帰
|
||||||
|
CancelCodingMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,29 +136,45 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
isCodingMode = true;
|
isCodingMode = true;
|
||||||
|
|
||||||
// 【変更】Time.timeScaleは弄らず、シーン内のAnimatorを検索して停止させる
|
// 1. プレイヤーの移動・視点回転の入力アクションを無効化(Disable)して足止めする
|
||||||
|
if (moveAction.action != null) moveAction.action.Disable();
|
||||||
|
if (turnAction.action != null) turnAction.action.Disable();
|
||||||
|
|
||||||
|
// 2. シーン内の敵のアニメーターを検索して完全停止
|
||||||
Animator[] allAnimators = FindObjectsByType<Animator>(FindObjectsSortMode.None);
|
Animator[] allAnimators = FindObjectsByType<Animator>(FindObjectsSortMode.None);
|
||||||
pausedAnimators.Clear();
|
pausedAnimators.Clear();
|
||||||
|
|
||||||
foreach (var anim in allAnimators)
|
foreach (var anim in allAnimators)
|
||||||
{
|
{
|
||||||
if (anim == null) continue;
|
if (anim == null) continue;
|
||||||
|
|
||||||
// ⚠️ プレイヤー自身のアニメーターまで止めないように除外する
|
|
||||||
// (このマネージャーがプレイヤーオブジェクトについている、またはPlayerタグを想定)
|
|
||||||
if (anim.gameObject == this.gameObject || anim.CompareTag("Player")) continue;
|
if (anim.gameObject == this.gameObject || anim.CompareTag("Player")) continue;
|
||||||
|
|
||||||
// 元のスピードに関わらず、0に上書きしてアニメーションを完全停止
|
|
||||||
anim.speed = 0f;
|
anim.speed = 0f;
|
||||||
pausedAnimators.Add(anim); // 記憶リストに保存
|
pausedAnimators.Add(anim);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. ボスのNavMeshAgent(自動移動)も一時停止させる
|
||||||
|
NavMeshAgent[] allAgents = FindObjectsByType<NavMeshAgent>(FindObjectsSortMode.None);
|
||||||
|
pausedAgents.Clear();
|
||||||
|
|
||||||
|
foreach (var agent in allAgents)
|
||||||
|
{
|
||||||
|
if (agent == null || !agent.enabled || !agent.gameObject.activeInHierarchy) continue;
|
||||||
|
if (agent.CompareTag("Player")) continue;
|
||||||
|
|
||||||
|
if (!agent.isStopped)
|
||||||
|
{
|
||||||
|
agent.isStopped = true;
|
||||||
|
pausedAgents.Add(agent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codingModeUI != null) codingModeUI.SetActive(true);
|
if (codingModeUI != null) codingModeUI.SetActive(true);
|
||||||
Debug.Log("⏳ Codingモード:敵の時間(アニメーション)を停止しました。");
|
Debug.Log("⏳ Codingモード:プレイヤー移動をロック&敵の時間(アニメ・NavMesh)を完全停止しました。");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// バフを適用してゲームを再開する
|
/// バフを適用してゲームを再開する(ゲージ消費あり)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ApplyBuffsAndResume(string buff1, string buff2)
|
public void ApplyBuffsAndResume(string buff1, string buff2)
|
||||||
{
|
{
|
||||||
@@ -145,7 +182,29 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
ActivateBuffByName(buff1);
|
ActivateBuffByName(buff1);
|
||||||
ActivateBuffByName(buff2);
|
ActivateBuffByName(buff2);
|
||||||
|
|
||||||
// 【変更】2. 停止させていた敵のアニメーターを元の速度(1.0f)に戻す
|
// 2. ゲーム状態を復帰(ゲージを消費)
|
||||||
|
ResumeWorldState(consumeGauge: true);
|
||||||
|
|
||||||
|
Debug.Log("▶ Codingモード完了:バフを適用してゲームを再開しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ★新規実装:Codingモードをキャンセルしてゲームを再開する(ゲージ消費なし)
|
||||||
|
/// </summary>
|
||||||
|
public void CancelCodingMode()
|
||||||
|
{
|
||||||
|
// ゲーム状態を復帰(ゲージは維持)
|
||||||
|
ResumeWorldState(consumeGauge: false);
|
||||||
|
|
||||||
|
Debug.Log("↩️ Codingモードキャンセル:ゲージを維持したまま通常状態に復帰しました。");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 世界の状態(アニメーション・NavMesh・プレイヤー移動・UI)を復帰させる共通メソッド
|
||||||
|
/// </summary>
|
||||||
|
private void ResumeWorldState(bool consumeGauge)
|
||||||
|
{
|
||||||
|
// 1. 停止させていた敵のアニメーターを元の速度(1.0f)に戻す
|
||||||
foreach (var anim in pausedAnimators)
|
foreach (var anim in pausedAnimators)
|
||||||
{
|
{
|
||||||
if (anim != null)
|
if (anim != null)
|
||||||
@@ -153,14 +212,31 @@ public class PlayerStatusManager : MonoBehaviour
|
|||||||
anim.speed = 1f;
|
anim.speed = 1f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pausedAnimators.Clear(); // リストを空にする
|
pausedAnimators.Clear();
|
||||||
|
|
||||||
// 3. Codingモードの終了処理
|
// 2. 停止させていたNavMeshAgentの移動を再開する
|
||||||
|
foreach (var agent in pausedAgents)
|
||||||
|
{
|
||||||
|
if (agent != null && agent.enabled)
|
||||||
|
{
|
||||||
|
agent.isStopped = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pausedAgents.Clear();
|
||||||
|
|
||||||
|
// 3. プレイヤーの移動・視点回転の入力アクションを再有効化(Enable)して操作ロックを解除
|
||||||
|
if (moveAction.action != null) moveAction.action.Enable();
|
||||||
|
if (turnAction.action != null) turnAction.action.Enable();
|
||||||
|
|
||||||
|
// 4. フラグとUIをリセット
|
||||||
isCodingMode = false;
|
isCodingMode = false;
|
||||||
|
|
||||||
if (codingModeUI != null) codingModeUI.SetActive(false);
|
if (codingModeUI != null) codingModeUI.SetActive(false);
|
||||||
currentGauge = 0f; // ゲージを消費
|
|
||||||
Debug.Log("▶ Codingモード終了:敵の時間を再開しました。");
|
// 5. ゲージの消費制御
|
||||||
|
if (consumeGauge)
|
||||||
|
{
|
||||||
|
currentGauge = 0f; // バフ決定時のみゲージ消費
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ActivateBuffByName(string buffName)
|
private void ActivateBuffByName(string buffName)
|
||||||
|
|||||||
Reference in New Issue
Block a user