mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2025-07-19 01:57:56 +08:00
Added favourite button to the animators panel, and fixed the nightly build deployment.
This commit is contained in:
52
.github/workflows/dotnet.yml
vendored
52
.github/workflows/dotnet.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Build UnityExplorer
|
||||
name: Build CinematicUnityExplorer
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
@ -31,77 +31,77 @@ jobs:
|
||||
- name: Upload BepInEx.IL2CPP
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx.IL2CPP.zip
|
||||
path: ./Release/UnityExplorer.BepInEx.IL2CPP/
|
||||
name: CinematicUnityExplorer.BepInEx.IL2CPP.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx.IL2CPP/
|
||||
|
||||
- name: Upload BepInEx.IL2CPP.CoreCLR
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/UnityExplorer.BepInEx.IL2CPP.CoreCLR/
|
||||
name: CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR/
|
||||
|
||||
- name: Upload BepInEx.Unity.IL2CPP.CoreCLR
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/UnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR/
|
||||
name: CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR/
|
||||
|
||||
- name: Upload BepInEx5.Mono
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx5.Mono.zip
|
||||
path: ./Release/UnityExplorer.BepInEx5.Mono/
|
||||
name: CinematicUnityExplorer.BepInEx5.Mono.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx5.Mono/
|
||||
|
||||
- name: Upload BepInEx6.Mono
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx6.Mono.zip
|
||||
path: ./Release/UnityExplorer.BepInEx6.Mono/
|
||||
name: CinematicUnityExplorer.BepInEx6.Mono.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx6.Mono/
|
||||
|
||||
- name: Upload BepInEx6.Unity.Mono
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.BepInEx6.Unity.Mono.zip
|
||||
path: ./Release/UnityExplorer.BepInEx6.Unity.Mono/
|
||||
name: CinematicUnityExplorer.BepInEx6.Unity.Mono.zip
|
||||
path: ./Release/CinematicUnityExplorer.BepInEx6.Unity.Mono/
|
||||
|
||||
- name: Upload MelonLoader.IL2CPP
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.MelonLoader.IL2CPP.zip
|
||||
path: ./Release/UnityExplorer.MelonLoader.IL2CPP/
|
||||
name: CinematicUnityExplorer.MelonLoader.IL2CPP.zip
|
||||
path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP/
|
||||
|
||||
- name: Upload MelonLoader.IL2CPP.net6preview
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.MelonLoader.IL2CPP.net6preview.zip
|
||||
path: ./Release/UnityExplorer.MelonLoader.IL2CPP.net6preview/
|
||||
name: CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip
|
||||
path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview/
|
||||
|
||||
- name: Upload MelonLoader.IL2CPP.CoreCLR
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/UnityExplorer.MelonLoader.IL2CPP.CoreCLR/
|
||||
name: CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip
|
||||
path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR/
|
||||
|
||||
- name: Upload MelonLoader.Mono
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.MelonLoader.Mono.zip
|
||||
path: ./Release/UnityExplorer.MelonLoader.Mono/
|
||||
name: CinematicUnityExplorer.MelonLoader.Mono.zip
|
||||
path: ./Release/CinematicUnityExplorer.MelonLoader.Mono/
|
||||
|
||||
- name: Upload Standalone.IL2CPP
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.Standalone.IL2CPP.zip
|
||||
path: ./Release/UnityExplorer.Standalone.IL2CPP/
|
||||
name: CinematicUnityExplorer.Standalone.IL2CPP.zip
|
||||
path: ./Release/CinematicUnityExplorer.Standalone.IL2CPP/
|
||||
|
||||
- name: Upload Standalone.Mono
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.Standalone.Mono.zip
|
||||
path: ./Release/UnityExplorer.Standalone.Mono/
|
||||
name: CinematicUnityExplorer.Standalone.Mono.zip
|
||||
path: ./Release/CinematicUnityExplorer.Standalone.Mono/
|
||||
|
||||
- name: Upload Editor
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: UnityExplorer.Editor.zip
|
||||
name: CinematicUnityExplorer.Editor.zip
|
||||
path: ./UnityEditorPackage/
|
||||
|
@ -190,6 +190,8 @@ It loads all the current vanilla post-processing effects being used and offers t
|
||||
## Animator
|
||||
Allows you to manually play characters and NPC animations in a scene. This should be pretty useful for getting the right animation on each enemy to set up marketing screenshots.
|
||||
|
||||
Favorite animations so they appear first on the dropdown list by clicking on the star button with the animation selected.
|
||||
|
||||
The Animator Panel also allows you to freeze all characters in a scene all at once, alongside giving you control over which characters should ignore the master toggler. That way you can make the playable character avoid getting frozen, or avoid un-freezing NPCs or enemies that already have the animations you want them to have.
|
||||
|
||||
Alongside all of this, you can also open each character game object by clicking on their names, so you can move, rotate, scale them around, disable them, or further edit their properties and child objects.
|
||||
|
Binary file not shown.
Binary file not shown.
@ -24,6 +24,7 @@ namespace UnityExplorer.UI.Panels
|
||||
public ButtonRef inspectButton;
|
||||
ButtonRef playButton;
|
||||
public Dropdown animatorDropdown;
|
||||
ButtonRef favAnimation;
|
||||
|
||||
// ICell
|
||||
public float DefaultHeight => 25f;
|
||||
@ -40,14 +41,25 @@ namespace UnityExplorer.UI.Panels
|
||||
IgnoreMasterToggle.isOn = animatorPlayer.shouldIgnoreMasterToggle;
|
||||
AnimatorToggle.isOn = animatorPlayer.animator.speed != 0;
|
||||
|
||||
// Updated dropdown options
|
||||
UpdateDropdownOptions();
|
||||
}
|
||||
|
||||
private void UpdateDropdownOptions(){
|
||||
if (animatorPlayer.animator.runtimeAnimatorController != null){
|
||||
animatorDropdown.options.Clear();
|
||||
foreach (IAnimationClip animation in animatorPlayer.animations)
|
||||
animatorDropdown.options.Add(new Dropdown.OptionData(animation.name));
|
||||
|
||||
animatorDropdown.value = Math.Max(0, animatorPlayer.animations.FindIndex(a => a.name == animatorPlayer.overridingAnimation.name));
|
||||
if (animatorDropdown.value == 0) animatorDropdown.captionText.text = animatorPlayer.animations[0].name;
|
||||
// For some reason, the favourite animations list was'nt being ordered when adding a new animation
|
||||
foreach (IAnimationClip animation in animatorPlayer.favAnimations.OrderBy(x => x.name)){
|
||||
animatorDropdown.options.Add(new Dropdown.OptionData(animation.name));
|
||||
}
|
||||
|
||||
foreach (IAnimationClip animation in animatorPlayer.animations){
|
||||
if (!animatorPlayer.favAnimations.Contains(animation)){
|
||||
animatorDropdown.options.Add(new Dropdown.OptionData(animation.name));
|
||||
}
|
||||
}
|
||||
|
||||
animatorDropdown.captionText.text = animatorPlayer.overridingAnimation.name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,12 +106,16 @@ namespace UnityExplorer.UI.Panels
|
||||
if (animatorPlayer.animator.wrappedObject == null || animatorDropdown == null)
|
||||
return;
|
||||
animatorDropdown.value = animatorDropdown.value == 0 ? animatorDropdown.options.Count - 1 : animatorDropdown.value - 1;
|
||||
|
||||
favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★";
|
||||
};
|
||||
|
||||
GameObject overridingAnimationObj = UIFactory.CreateDropdown(UIRoot, $"Animations_Dropdown", out animatorDropdown, null, 14, (idx) => {
|
||||
if (animatorPlayer.animator.wrappedObject == null)
|
||||
return;
|
||||
animatorPlayer.overridingAnimation = idx < animatorPlayer.animations.Count() ? animatorPlayer.animations[idx] : animatorPlayer.overridingAnimation;
|
||||
animatorPlayer.overridingAnimation = idx < animatorDropdown.options.Count ? animatorPlayer.animations.Find(a => a.name == animatorDropdown.options[idx].text) : animatorPlayer.overridingAnimation;
|
||||
|
||||
favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★";
|
||||
}
|
||||
);
|
||||
|
||||
@ -111,6 +127,26 @@ namespace UnityExplorer.UI.Panels
|
||||
if (animatorPlayer.animator.wrappedObject == null || animatorDropdown == null)
|
||||
return;
|
||||
animatorDropdown.value = animatorDropdown.value == animatorDropdown.options.Count - 1 ? 0 : animatorDropdown.value + 1;
|
||||
|
||||
favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★";
|
||||
};
|
||||
|
||||
favAnimation = UIFactory.CreateButton(UIRoot, "FavAnimation", "★", new Color(0.05f, 0.05f, 0.05f));
|
||||
UIFactory.SetLayoutElement(favAnimation.Component.gameObject, minHeight: 25, minWidth: 25);
|
||||
favAnimation.OnClick += () => {
|
||||
if (animatorPlayer.animator.wrappedObject == null || animatorDropdown == null)
|
||||
return;
|
||||
|
||||
bool isAnimationFaved = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation);
|
||||
if (!isAnimationFaved){
|
||||
animatorPlayer.FavAnimation(animatorPlayer.overridingAnimation);
|
||||
}
|
||||
else {
|
||||
animatorPlayer.UnfavAnimation(animatorPlayer.overridingAnimation);
|
||||
}
|
||||
|
||||
favAnimation.ButtonText.text = !isAnimationFaved ? "☆" : "★";
|
||||
//UpdateDropdownOptions();
|
||||
};
|
||||
|
||||
playButton = UIFactory.CreateButton(UIRoot, "PlayButton", "Play", new Color(0.2f, 0.26f, 0.2f));
|
||||
|
@ -25,6 +25,8 @@ namespace UnityExplorer.UI.Panels
|
||||
//private IAnimationClip lastManuallyPlayedAnimation;
|
||||
private IRuntimeAnimatorController originalAnimatorController;
|
||||
|
||||
public List<IAnimationClip> favAnimations {get;}
|
||||
|
||||
public AnimatorPlayer(Behaviour animator){
|
||||
this.animator = new IAnimator(animator);
|
||||
if (this.animator.runtimeAnimatorController != null){
|
||||
@ -38,6 +40,8 @@ namespace UnityExplorer.UI.Panels
|
||||
IAnimatorClipInfo[] playingAnimations = this.animator.GetCurrentAnimatorClipInfo(0);
|
||||
this.originalAnimation = playingAnimations.Count() != 0 ? playingAnimations[0].clip : null;
|
||||
this.overridingAnimation = originalAnimation != null ? originalAnimation : (animations.Count > 0 ? animations[0] : null);
|
||||
|
||||
this.favAnimations = new List<IAnimationClip>();
|
||||
}
|
||||
|
||||
// Include the animations being played in other layers
|
||||
@ -80,6 +84,19 @@ namespace UnityExplorer.UI.Panels
|
||||
*/
|
||||
}
|
||||
|
||||
public void FavAnimation(IAnimationClip animation){
|
||||
favAnimations.Add(animation);
|
||||
favAnimations.OrderBy(x => x.name);
|
||||
}
|
||||
|
||||
public void UnfavAnimation(IAnimationClip animation){
|
||||
favAnimations.Remove(animation);
|
||||
}
|
||||
|
||||
public bool IsAnimationFaved(IAnimationClip animation){
|
||||
return favAnimations.Contains(animation);
|
||||
}
|
||||
|
||||
public override string ToString(){
|
||||
return animator.name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user