Skip to content

Commit

Permalink
Oneshotの中断に対応
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrabox committed Sep 14, 2024
1 parent bb8f95b commit c05048f
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 7 deletions.
56 changes: 56 additions & 0 deletions Assets/Action.controller
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,33 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!114 &-6814875269131062584
MonoBehaviour:
m_ObjectHideFlags: 1
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: -706344726, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
m_Name:
m_EditorClassIdentifier:
parameters:
- type: 0
name: VRCEmote
source:
value: 0
valueMin: 0
valueMax: 0
chance: 0
convertRange: 0
sourceMin: 0
sourceMax: 0
destMin: 0
destMax: 0
localOnly: 0
debugString:
--- !u!1101 &-6631209054654270504
AnimatorStateTransition:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -1098,6 +1125,7 @@ AnimatorState:
m_StateMachineBehaviours:
- {fileID: -1615162098089239846}
- {fileID: -7896291549180169365}
- {fileID: -6814875269131062584}
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 0
Expand Down Expand Up @@ -1878,6 +1906,33 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!114 &1381496145161310210
MonoBehaviour:
m_ObjectHideFlags: 1
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: -706344726, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
m_Name:
m_EditorClassIdentifier:
parameters:
- type: 0
name: VRCEmote
source:
value: 0
valueMin: 0
valueMax: 0
chance: 0
convertRange: 0
sourceMin: 0
sourceMax: 0
destMin: 0
destMax: 0
localOnly: 0
debugString:
--- !u!1101 &1400721335613169570
AnimatorStateTransition:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -2744,6 +2799,7 @@ AnimatorState:
- {fileID: 8156181899004977183}
m_StateMachineBehaviours:
- {fileID: -5470219445027074658}
- {fileID: 1381496145161310210}
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 0
Expand Down
9 changes: 9 additions & 0 deletions Editor/EmoteLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ protected void Transition_CurrentToForceExit(string toStateName, int eI)
.AddCondition(AnimatorConditionMode.If, 0, "Seated");
}

protected void Transition_OneshotCancel(string toStateName, int eI)
{
if (EmoteManager.IsOneShot(eI))
{
SetTransition(_currentState, GetState(toStateName), EmoteManager.ForceExitTransitionInfo(eI))
.AddCondition(AnimatorConditionMode.NotEqual, EmoteManager.ID(eI), "VRCEmote");
}
}

/// <summary>
/// WDからExitへの遷移設定
/// </summary>
Expand Down
14 changes: 7 additions & 7 deletions Editor/ExpressionCreater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ private void CreateUnitMenu(int eI)
var unitMenu = obj.AddComponent<ModularAvatarMenuItem>();
unitMenu.Control.parameter = new VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu.Control.Parameter() { name = "VRCEmote" };
unitMenu.Control.value = EmoteManager.ID(eI);
if (EmoteManager.IsOneShot(eI))
{
unitMenu.Control.type = VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu.Control.ControlType.Button;
}
else
{
//if (EmoteManager.IsOneShot(eI))
//{
// unitMenu.Control.type = VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu.Control.ControlType.Button;
//}
//else
//{
unitMenu.Control.type = VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu.Control.ControlType.Toggle;
}
//}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Editor/LayerCreater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void AddEmote(int eI)
CreateState(EmoteManager.StateName(eI), EmoteManager.HumanoidClip(eI), true);
Transition_PrepareToCurrent(eI);
Transition_CurrentToRegularExit("Recovery standing",eI);
Transition_OneshotCancel("Recovery standing", eI);
Transition_CurrentToForceExit("Force Exit", eI);
}
}
Expand All @@ -67,6 +68,7 @@ public void AddEmote(int eI)
CreateState(EmoteManager.StateName(eI), EmoteManager.BodyShapeBlockerClip(eI), true);
Transition_PrepareToCurrent(eI);
Transition_CurrentToRegularExit("Exit", eI);
Transition_OneshotCancel("Exit", eI);
Transition_CurrentToForceExit("Exit", eI);
}
else
Expand All @@ -88,6 +90,7 @@ public void AddEmote(int eI)
CreateState(EmoteManager.StateName(eI), EmoteManager.UnhumanoidClip(eI), true);
Transition_PrepareToCurrent(eI);
Transition_CurrentToRegularExit(EmoteManager.WDStateName(eI), eI);
Transition_OneshotCancel(EmoteManager.WDStateName(eI), eI);
Transition_CurrentToForceExit(EmoteManager.WDStateName(eI), eI);
Transition_WDtoExit(eI);
}
Expand Down

0 comments on commit c05048f

Please sign in to comment.