mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-25 10:54:43 +00:00
开源...
This commit is contained in:
parent
81c2bc83ff
commit
c65eed7e63
75
JEX_GAS/.gitignore
vendored
75
JEX_GAS/.gitignore
vendored
@ -1,75 +0,0 @@
|
||||
# This .gitignore file should be placed at the root of your Unity project directory
|
||||
#
|
||||
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
|
||||
#
|
||||
/[Ll]ibrary/
|
||||
/[Tt]emp/
|
||||
/[Oo]bj/
|
||||
/[Bb]uild/
|
||||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Uu]ser[Ss]ettings/
|
||||
|
||||
# MemoryCaptures can get excessive in size.
|
||||
# They also could contain extremely sensitive data
|
||||
/[Mm]emoryCaptures/
|
||||
|
||||
# Recordings can get excessive in size
|
||||
/[Rr]ecordings/
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# /[Aa]ssets/AssetStoreTools*
|
||||
|
||||
# Autogenerated Jetbrains Rider plugin
|
||||
/[Aa]ssets/Plugins/Editor/JetBrains*
|
||||
|
||||
# Visual Studio cache directory
|
||||
.vs/
|
||||
|
||||
# Gradle cache directory
|
||||
.gradle/
|
||||
|
||||
# Autogenerated VS/MD/Consulo solution and project files
|
||||
ExportedObj/
|
||||
.consulo/
|
||||
*.csproj
|
||||
*.unityproj
|
||||
*.sln
|
||||
*.suo
|
||||
*.tmp
|
||||
*.user
|
||||
*.userprefs
|
||||
*.pidb
|
||||
*.booproj
|
||||
*.svd
|
||||
*.pdb
|
||||
*.mdb
|
||||
*.opendb
|
||||
*.VC.db
|
||||
|
||||
# Unity3D generated meta files
|
||||
*.pidb.meta
|
||||
*.pdb.meta
|
||||
*.mdb.meta
|
||||
|
||||
# Unity3D generated file on crash reports
|
||||
sysinfo.txt
|
||||
|
||||
# Builds
|
||||
*.apk
|
||||
*.aab
|
||||
*.unitypackage
|
||||
*.app
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
|
||||
# Packed Addressables
|
||||
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
|
||||
|
||||
# Temporary auto-generated Android Assets
|
||||
/[Aa]ssets/[Ss]treamingAssets/aa.meta
|
||||
/[Aa]ssets/[Ss]treamingAssets/aa/*
|
||||
|
||||
# idea
|
||||
.idea/*
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebc3cec6713633742ae15cc9e8038ab1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53be96c533934ee7b486379f6f45bafa
|
||||
timeCreated: 1729222529
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbf21400b3864f29b6c0abab26b025f0
|
||||
timeCreated: 1729222533
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8455bd06c174f28abd859715d4d4504
|
||||
timeCreated: 1729222551
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28929d3e41dc4dc4ace45485eb45849f
|
||||
timeCreated: 1729222562
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac9ad0beca774e71beb0bb45da860226
|
||||
timeCreated: 1729222612
|
@ -1,43 +0,0 @@
|
||||
using Demo.Scripts.GAS.OngoingAbilityTasks;
|
||||
using GAS.Editor;
|
||||
using GAS.Runtime;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Editor.GAS.Ability.TaskInspector.OngoingAbility
|
||||
{
|
||||
public class OngoingAbility_Debug_Inspector : OngoingTaskInspector<OngoingAbility_Debug>
|
||||
{
|
||||
|
||||
[Delayed, LabelText("开始位置"), OnValueChanged("OnStartChanged")]
|
||||
public Vector3 start;
|
||||
[Delayed, LabelText("结束位置"), OnValueChanged("OnEndChanged")]
|
||||
public Vector3 end;
|
||||
|
||||
public override void Init(OngoingAbilityTask task)
|
||||
{
|
||||
base.Init(task);
|
||||
start = _task.start;
|
||||
start = _task.end;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 触发概率配置变更监听
|
||||
/// </summary>
|
||||
private void OnStartChanged()
|
||||
{
|
||||
_task.start = start;
|
||||
Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 技能配置ID变更监听
|
||||
/// </summary>
|
||||
private void OnEndChanged()
|
||||
{
|
||||
_task.end = end;
|
||||
Save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73bc2380baef40fa9340b5518186bb8c
|
||||
timeCreated: 1729222616
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 532d49ae398deae46a5142c91296a7bd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f75f19949948aa40b2fe17f99229781
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0522d1120d0b15c468bd2c4cd52d6093
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,19 +0,0 @@
|
||||
%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: 85dd2a6201f04545b5a8b020edcb2690, type: 3}
|
||||
m_Name: ASC_Player
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
AttributeSets: []
|
||||
BaseTags: []
|
||||
BaseAbilities:
|
||||
- {fileID: 11400000, guid: b78ae002fbbf510419a39987f22201f1, type: 2}
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7692a8d07949a5c46b6b5325ebb9a422
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 575d526145ecdc747a602b69084e933d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b4779482b24f6c4d8ebeac4c1ac7bba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,61 +0,0 @@
|
||||
%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: d763af469c524557946c477b9bea3a46, type: 3}
|
||||
m_Name: JisolDemo1
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
UniqueName: JisolDemo1
|
||||
Cost: {fileID: 0}
|
||||
Cooldown: {fileID: 0}
|
||||
CooldownTime: 0
|
||||
AssetTags: []
|
||||
CancelAbilityTags: []
|
||||
BlockAbilityTags: []
|
||||
ActivationOwnedTags: []
|
||||
ActivationRequiredTags: []
|
||||
ActivationBlockedTags: []
|
||||
Speed: 1
|
||||
ManualEndAbility: 0
|
||||
FrameCount: 60
|
||||
DurationalCues:
|
||||
- trackName: "\u6301\u7EEDGameplayCue\u8F68\u9053"
|
||||
clipEvents:
|
||||
- startFrame: 6
|
||||
durationFrame: 34
|
||||
cue: {fileID: 11400000, guid: 0a77e9c8e20008944a99814e0b5a4aed, type: 2}
|
||||
InstantCues:
|
||||
- trackName: "\u5373\u65F6Cue\u8F68\u9053"
|
||||
markEvents: []
|
||||
ReleaseGameplayEffect:
|
||||
- trackName: "GameplayEffect\u91CA\u653E\u8F68\u9053"
|
||||
markEvents: []
|
||||
BuffGameplayEffects:
|
||||
- trackName: Buff
|
||||
clipEvents: []
|
||||
InstantTasks:
|
||||
- trackName: "\u5373\u65F6Task\u8F68\u9053"
|
||||
markEvents: []
|
||||
OngoingTasks:
|
||||
- trackName: Task Clips
|
||||
clipEvents:
|
||||
- startFrame: 27
|
||||
durationFrame: 20
|
||||
ongoingTask:
|
||||
TaskData:
|
||||
Type: Demo.Scripts.GAS.OngoingAbilityTasks.OngoingAbility_Debug
|
||||
Data: '{"start":{"x":0.0,"y":0.0,"z":0.0},"end":{"x":100.0,"y":0.0,"z":0.0}}'
|
||||
PassiveGameplayEffects:
|
||||
- trackName: Passive
|
||||
clipEvents: []
|
||||
PassiveTasks:
|
||||
- trackName: Passive Task
|
||||
clipEvents: []
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b78ae002fbbf510419a39987f22201f1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27a7bb5d47b5c4641870fe3d03243802
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,19 +0,0 @@
|
||||
%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: 321af3379125465380073b2a04a1b1e2, type: 3}
|
||||
m_Name: GCueDurational_PlayerDemo
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
RequiredTags: []
|
||||
ImmunityTags: []
|
||||
start: {x: 0, y: 0, z: 0}
|
||||
end: {x: 10, y: 0, z: 0}
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a77e9c8e20008944a99814e0b5a4aed
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,17 +0,0 @@
|
||||
%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: ec56ec3ecd444759979c63b23ecf0c39, type: 3}
|
||||
m_Name: GCue_PlayerDemo
|
||||
m_EditorClassIdentifier:
|
||||
Description:
|
||||
RequiredTags: []
|
||||
ImmunityTags: []
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 041f193225d7b1e49a75af0003a4111b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea0e8fd86f27d314289050bd4507cf6a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce52a1fda69211e45997126c7036bf7b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07d357ab8ac95864b80f9b54e729abe8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93d542b5cd7d40219abcee66ef046f93
|
||||
timeCreated: 1729220421
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70bc0ba32472468e8765e4c1f7acbcdf
|
||||
timeCreated: 1729224096
|
@ -1,78 +0,0 @@
|
||||
using GAS.General;
|
||||
using GAS.Runtime;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
{
|
||||
public class GameplayCueDurational_PlayerDemo01 : GameplayCueDurational
|
||||
{
|
||||
|
||||
[BoxGroup]
|
||||
[LabelText("开始位置")]
|
||||
public Vector3 start;
|
||||
[BoxGroup]
|
||||
[LabelText("结束位置")]
|
||||
public Vector3 end;
|
||||
|
||||
public override GameplayCueDurationalSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
return new GameplayCueDurational_PlayerDemo01_Spec(this,parameters);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public override void OnEditorPreview(GameObject previewObject, int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 {previewObject} {frameIndex}");
|
||||
|
||||
if (frameIndex >= startFrame && frameIndex <= endFrame)
|
||||
{
|
||||
previewObject.transform.position = Vector3.Lerp(start, end, (float)(frameIndex - startFrame) / endFrame);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public class GameplayCueDurational_PlayerDemo01_Spec : GameplayCueDurationalSpec<GameplayCueDurational_PlayerDemo01>
|
||||
{
|
||||
|
||||
private GameplayCueDurational_PlayerDemo01 Cue;
|
||||
|
||||
public GameplayCueDurational_PlayerDemo01_Spec(GameplayCueDurational_PlayerDemo01 cue, GameplayCueParameters parameters) : base(cue, parameters)
|
||||
{
|
||||
Cue = cue;
|
||||
}
|
||||
|
||||
public override void OnAdd(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnAdd");
|
||||
}
|
||||
|
||||
public override void OnRemove(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnRemove");
|
||||
}
|
||||
|
||||
public override void OnGameplayEffectActivate()
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnGameplayEffectActivate");
|
||||
}
|
||||
|
||||
public override void OnGameplayEffectDeactivate()
|
||||
{
|
||||
Debug.Log("GameplayCueDurational_PlayerDemo01_Spec OnGameplayEffectDeactivate");
|
||||
}
|
||||
|
||||
public override void OnTick(int frame,int startFrame,int endFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCueDurational_PlayerDemo01_Spec OnTick {frame}");
|
||||
if (Owner.GetView() is not null)
|
||||
{
|
||||
Owner.GetView().transform.position = Vector3.Lerp(Cue.start, Cue.end, (float)(frame - startFrame) / endFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 321af3379125465380073b2a04a1b1e2
|
||||
timeCreated: 1729234472
|
@ -1,35 +0,0 @@
|
||||
using GAS.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.GameplayCue
|
||||
{
|
||||
public class GameplayCue_PlayerDemo01 : GameplayCueInstant
|
||||
{
|
||||
public override GameplayCueInstantSpec CreateSpec(GameplayCueParameters parameters)
|
||||
{
|
||||
return new GameplayCue_PlayerDemo01_Spec(this,parameters);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public override void OnEditorPreview(GameObject previewObject, int frame, int startFrame)
|
||||
{
|
||||
Debug.Log($"GameplayCue_PlayerDemo01 {previewObject}");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
public class GameplayCue_PlayerDemo01_Spec : GameplayCueInstantSpec
|
||||
{
|
||||
|
||||
public GameplayCue_PlayerDemo01_Spec(GameplayCueInstant cue, GameplayCueParameters parameters) : base(cue, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Trigger()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec56ec3ecd444759979c63b23ecf0c39
|
||||
timeCreated: 1729233357
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 364e48fdbe4b487f8a05c7b78291559c
|
||||
timeCreated: 1729220475
|
@ -1,42 +0,0 @@
|
||||
using GAS.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts.GAS.OngoingAbilityTasks
|
||||
{
|
||||
public class OngoingAbility_Debug : OngoingAbilityTask
|
||||
{
|
||||
|
||||
public Vector3 start;
|
||||
public Vector3 end;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
/// <summary>
|
||||
/// 编辑器预览用
|
||||
/// 【注意】 覆写时,记得用UNITY_EDITOR宏包裹,这是预览表现用的函数,不该被编译。
|
||||
/// </summary>
|
||||
/// <param name="frame"></param>
|
||||
/// <param name="startFrame"></param>
|
||||
/// <param name="endFrame"></param>
|
||||
public override void OnEditorPreview(int frame, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log($"OnEditorPreview {Vector3.Lerp(start,end,(float)frame / (float)endFrame)}");
|
||||
// _spec.Owner.gameObject.transform.position = Vector3.Lerp(start, end, (float)startFrame / endFrame);
|
||||
}
|
||||
#endif
|
||||
|
||||
public override void OnStart(int startFrame)
|
||||
{
|
||||
Debug.Log("OnEnd");
|
||||
}
|
||||
|
||||
public override void OnEnd(int endFrame)
|
||||
{
|
||||
Debug.Log("OnEnd");
|
||||
}
|
||||
|
||||
public override void OnTick(int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
Debug.Log("OnTick");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f6034c656814b79b9be57cd41b35d9a
|
||||
timeCreated: 1729220520
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27ed906aca80d874b9138a6559c7835e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,44 +0,0 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class AbilitySystemComponentExtension
|
||||
{
|
||||
public static Type[] PresetAttributeSetTypes(this AbilitySystemComponent asc)
|
||||
{
|
||||
if (asc.Preset == null) return null;
|
||||
var attrSetTypes = new Type[asc.Preset.AttributeSets.Length];
|
||||
for (var i = 0; i < asc.Preset.AttributeSets.Length; i++)
|
||||
attrSetTypes[i] = GAttrSetLib.AttrSetTypeDict[asc.Preset.AttributeSets[i]];
|
||||
return attrSetTypes;
|
||||
}
|
||||
|
||||
public static GameplayTag[] PresetBaseTags(this AbilitySystemComponent asc)
|
||||
{
|
||||
if (asc.Preset == null) return null;
|
||||
return asc.Preset.BaseTags;
|
||||
}
|
||||
|
||||
public static void InitWithPreset(this AbilitySystemComponent asc, int level, AbilitySystemComponentPreset preset = null)
|
||||
{
|
||||
if (preset != null) asc.SetPreset(preset);
|
||||
if (asc.Preset == null) return;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (asc.Preset.BaseAbilities != null && asc.Preset.BaseAbilities.Any(x => x == null))
|
||||
{
|
||||
Debug.LogWarning($"BaseAbilities contains null in preset: {asc.Preset.name}");
|
||||
}
|
||||
#endif
|
||||
|
||||
asc.Init(asc.PresetBaseTags(), asc.PresetAttributeSetTypes(), asc.Preset.BaseAbilities, level);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a829f1acecbd5d348800bcbf18fb138e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,28 +0,0 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAbilityLib
|
||||
{
|
||||
public struct AbilityInfo
|
||||
{
|
||||
public string Name;
|
||||
public string AssetPath;
|
||||
public Type AbilityClassType;
|
||||
}
|
||||
|
||||
public static AbilityInfo JisolDemo1 = new AbilityInfo { Name = "JisolDemo1", AssetPath = "Assets/Demo/GAS/Config/GameplayAbilityLib/JisolDemo1.asset",AbilityClassType = typeof(GAS.Runtime.TimelineAbility) };
|
||||
|
||||
|
||||
public static Dictionary<string, AbilityInfo> AbilityMap = new Dictionary<string, AbilityInfo>
|
||||
{
|
||||
["JisolDemo1"] = JisolDemo1,
|
||||
};
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79aaab94f725e0347b32b6383dc6361e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,18 +0,0 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAttrLib
|
||||
{
|
||||
|
||||
// For facilitating the creation of a Value Dropdown in the editor.
|
||||
public static readonly IReadOnlyList<string> AttributeNames = new List<string>
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2db3b0427abaab4c9c8ec9df6c351e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,25 +0,0 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GAttrSetLib
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<string, Type> AttrSetTypeDict = new Dictionary<string, Type>
|
||||
{
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyDictionary<Type, string> TypeToName = new Dictionary<Type, string>
|
||||
{
|
||||
};
|
||||
|
||||
public static readonly IReadOnlyList<string> AttributeFullNames = new List<string>
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e232dda0e81c76c4ba33b4b47af0644a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,20 +0,0 @@
|
||||
///////////////////////////////////
|
||||
//// This is a generated file. ////
|
||||
//// Do not modify it. ////
|
||||
///////////////////////////////////
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GAS.Runtime
|
||||
{
|
||||
public static class GTagLib
|
||||
{
|
||||
/// <summary>Ability</summary>
|
||||
public static GameplayTag Ability { get; } = new("Ability");
|
||||
|
||||
public static readonly IReadOnlyDictionary<string, GameplayTag> TagMap = new Dictionary<string, GameplayTag>
|
||||
{
|
||||
["Ability"] = Ability,
|
||||
};
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77b03860d4e223243838914f3e9fee1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using GAS.Runtime;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Demo.Scripts
|
||||
{
|
||||
public class Main : MonoBehaviour
|
||||
{
|
||||
|
||||
public AbilitySystemComponent player;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
player.InitWithPreset(1);
|
||||
player.TryActivateAbility(GAbilityLib.JisolDemo1.Name);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c3aa2f58b904ebe9fc64cc367c63d68
|
||||
timeCreated: 1729236756
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d551dd2e1aafab741ac2ebf771ce0dd7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,239 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.1.8] - 2024-07-30
|
||||
|
||||
进行了一系列的优化。(From: BCC @kenkinky)
|
||||
|
||||
### Changed
|
||||
|
||||
- 进行了一系列的优化
|
||||
|
||||
## [1.1.6] - 2024-06-26
|
||||
|
||||
修复了AbilitySpec中CheckCost时,modifier为减法时的计算错误;追加了Attribute的钳制功能。
|
||||
|
||||
### Changed
|
||||
|
||||
- 追加了Attribute的钳制功能(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了AbilitySpec中CheckCost时,modifier为减法时的计算错误。
|
||||
|
||||
|
||||
## [1.1.6] - 2024-06-26
|
||||
|
||||
修复了由于优化GE创建流程时导致的Granted Ability生成错误;优化了period的边界问题
|
||||
|
||||
### Changed
|
||||
|
||||
- 优化了period的边界问题(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了由于优化GE创建流程时导致的Granted Ability生成错误。
|
||||
|
||||
|
||||
## [1.1.5] - 2024-06-19
|
||||
|
||||
修复了AttrBasedMMC的快照读取错误;Modifier新增了减法,除法操作类型。
|
||||
|
||||
### Changed
|
||||
|
||||
- Modifier新增了减法,除法操作类型。(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了AttrBasedMMC的快照读取错误。
|
||||
|
||||
|
||||
## [1.1.4] - 2024-06-14
|
||||
|
||||
重新整理了ASC的ApplyGameplayEffect方法的逻辑,现在GE的Tag相关判断是在实例化之后。允许用户在GameplayEffectSpec生效前对GE进行修改和操作。
|
||||
|
||||
### Changed
|
||||
|
||||
- 重新整理了ASC的ApplyGameplayEffectTo(GameplayEffect gameplayEffect, AbilitySystemComponent target)方法的逻辑
|
||||
- ASC新增:ApplyGameplayEffectTo(GameplayEffectSpec gameplayEffectSpec, AbilitySystemComponent target) 和
|
||||
ApplyGameplayEffectToSelf(GameplayEffectSpec gameplayEffectSpec)
|
||||
|
||||
## [1.1.3] - 2024-06-13
|
||||
|
||||
添加了带level形参的ApplyGE方法。
|
||||
|
||||
### Changed
|
||||
|
||||
- 添加了带level形参的ApplyGE方法。
|
||||
|
||||
|
||||
## [1.1.2] - 2024-06-12
|
||||
|
||||
修复了部分bug。编辑器界面部分优化
|
||||
|
||||
### Changed
|
||||
|
||||
- 编辑器界面部分优化(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了时间轴能力的durational cue重复调用OnRemove()的错误
|
||||
- 修复了时间轴编辑器的TargetCatcher的Inspector不更新的错误
|
||||
|
||||
|
||||
## [1.1.1] - 2024-05-31
|
||||
|
||||
补充了Stacking相关功能。
|
||||
|
||||
### Changed
|
||||
|
||||
- 添加Stack相关MMC
|
||||
- 补充stack刷新计算current value逻辑
|
||||
- 添加stack count变化监听事件
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了Attribute Aggregator的事件注册逻辑错误。
|
||||
|
||||
## [1.1.0] - 2024-05-30
|
||||
|
||||
补充了Granted Ability和GameplayEffect Stacking两个功能;优化了部分GC;优化了编辑器界面操作等;修复了部分bug。
|
||||
|
||||
### Changed
|
||||
|
||||
- 补充了Granted Ability,详情可见README文档的2.8.c
|
||||
- 补充了GameplayEffect Stacking,详情可见README文档的2.7中Stacking部分
|
||||
- 优化了部分GC。(From: BCC @kenkinky)
|
||||
- 优化了部分执行逻辑,增强了代码可读性。
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了部分逻辑bug。(From: BCC @kenkinky)
|
||||
|
||||
## [1.0.9] - 2024-04-25
|
||||
|
||||
优化type查找,优化GAS的项目级配置文件管理。
|
||||
|
||||
### Changed
|
||||
|
||||
- 新增TimelineAbilityT, 方便继承和扩展TimelineAbility.(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修正TryAddDynamicAddedTag添加不同类型Source时类型转换失败异常(From: BCC @kenkinky)
|
||||
- 修复了Setting中生成配置目录后,未调用AssetDatabase.Refresh()导致配置文件目录未及时更新的问题。
|
||||
## [1.0.8] - 2024-04-23
|
||||
|
||||
优化了部分GC。
|
||||
|
||||
### Fixed
|
||||
|
||||
- AttributeSetContainer的TryGetAttributeSet方法中,Type.Name存在GC。
|
||||
- 新增了预缓存接口:GasCache.CacheAttributeSetName。
|
||||
- 使用方法:在GAS初始化时,调用GasCache.CacheAttributeSetName(GAttrSetLib.TypeToName);
|
||||
- GameplayTagAggregator的Tag判断相关方法存在GC。GC来源是LINQ表达式的过程匿名方法产生的GC。已经把LINQ表达式改成了普通循环做法。
|
||||
- 新增了Pool工具类,优化了部分GC。(From: BCC @kenkinky)
|
||||
|
||||
## [1.0.7] - 2024-04-17
|
||||
|
||||
修复全局配置保存失败问题;修复Editor代码不该编译问题
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复全局配置保存失败问题,Tag,Attribute,AttributeSet,Setting的配置文件保存不该使用AssetDataBase。
|
||||
- 修正无法打包编译异常 #11 (From: BCC @kenkinky)
|
||||
|
||||
## [1.0.6] - 2024-04-16
|
||||
|
||||
优化type查找,优化GAS的项目级配置文件管理。
|
||||
|
||||
### Changed
|
||||
|
||||
- 修改了Tag,Attribute,AttributeSet,Setting的配置文件路径,调整至ProjectSettings,并且为单例配置文件。
|
||||
- 优化了TypeUtil,Editor环境下类型查找范围改为全程序集。
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复一个严重bug: 修复AttributeBasedModCalculation不能正确保存的问题, 还有一些小优化.(From: BCC @kenkinky)
|
||||
|
||||
## [1.0.5] - 2024-04-12
|
||||
|
||||
修复了部分bug;优化编辑器操作。
|
||||
|
||||
### Added
|
||||
|
||||
- 优化编辑器操作。(From: BCC @kenkinky)
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了TryActivateAbility的返回值逻辑错误。
|
||||
|
||||
|
||||
## [1.0.4] - 2024-04-11
|
||||
|
||||
修复了部分bug;测试通过了推导属性设计;优化了GE容器的管理,增强代码可读性。
|
||||
|
||||
### Added
|
||||
|
||||
- 添加了GAS内部的子Event系统,为方便之后用上事件系统做准备。
|
||||
|
||||
### Fixed
|
||||
|
||||
- 推导属性的实时更新错误。补上了AttributeBasedMMC的Track类修改器属性变化监听。
|
||||
- 修复GASHost销毁时的错误逻辑,Host的静态单例改为饿汉式,同步GAS的初始化只会执行一次。
|
||||
|
||||
### Changed
|
||||
|
||||
- 优化GameplayEffectContainer结构,现在只维护一个GameplayEffect列表
|
||||
|
||||
### Removed
|
||||
|
||||
- 移除DerivedAttribute和MetaAttribute脚本,弃用。这两个属性式设计方式,而不是实际存在的类。
|
||||
|
||||
## [1.0.3] - 2024-04-09
|
||||
|
||||
删除SetByCallerModCalculation,弃用。
|
||||
|
||||
### Removed
|
||||
|
||||
- 删除SetByCallerModCalculation,弃用。
|
||||
|
||||
## [1.0.2] - 2024-04-08
|
||||
|
||||
优化Editor使用体验(From: BCC @kenkinky)
|
||||
|
||||
### Changed
|
||||
|
||||
- 优化Editor使用体验(From: BCC @kenkinky)
|
||||
|
||||
|
||||
## [1.0.1] - 2024-03-29
|
||||
|
||||
删除Instant类型GameplayCue的Apply Target参数。
|
||||
|
||||
### Removed
|
||||
|
||||
- Instant类型GameplayCue的Apply Target弃用。
|
||||
|
||||
## [1.0.0] - 2024-03-13
|
||||
|
||||
EX-GAS 1.0.0 发布
|
||||
|
||||
### Added
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- none
|
||||
|
||||
### Changed
|
||||
|
||||
- none
|
||||
|
||||
### Removed
|
||||
|
||||
- none
|
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34ae97a0d741c5844a4fac12ff8e1c45
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ceb70b71a95f4810bb22c72560de1755
|
||||
timeCreated: 1701928918
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 916ae4e58ce74ba2b0686ddc372419d9
|
||||
timeCreated: 1703772158
|
@ -1,135 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using GAS.Runtime;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GAS.Editor
|
||||
{
|
||||
public class AbilityCollectionGenerator
|
||||
{
|
||||
public static void Gen()
|
||||
{
|
||||
string pathWithoutAssets = Application.dataPath.Substring(0, Application.dataPath.Length - 6);
|
||||
var filePath =
|
||||
$"{pathWithoutAssets}/{GASSettingAsset.CodeGenPath}/{GasDefine.GAS_ABILITY_LIB_CSHARP_SCRIPT_NAME}";
|
||||
GenerateAbilityCollection(filePath);
|
||||
}
|
||||
|
||||
private static void GenerateAbilityCollection(string filePath)
|
||||
{
|
||||
using var writer = new IndentedWriter(new StreamWriter(filePath));
|
||||
writer.WriteLine("///////////////////////////////////");
|
||||
writer.WriteLine("//// This is a generated file. ////");
|
||||
writer.WriteLine("//// Do not modify it. ////");
|
||||
writer.WriteLine("///////////////////////////////////");
|
||||
|
||||
writer.WriteLine("");
|
||||
|
||||
writer.WriteLine("using System;");
|
||||
writer.WriteLine("using System.Collections.Generic;");
|
||||
|
||||
writer.WriteLine("");
|
||||
|
||||
writer.WriteLine("namespace GAS.Runtime");
|
||||
writer.WriteLine("{");
|
||||
writer.Indent++;
|
||||
{
|
||||
writer.WriteLine("public static class GAbilityLib");
|
||||
writer.WriteLine("{");
|
||||
writer.Indent++;
|
||||
{
|
||||
writer.WriteLine("public struct AbilityInfo");
|
||||
writer.WriteLine("{");
|
||||
writer.Indent++;
|
||||
{
|
||||
writer.WriteLine("public string Name;");
|
||||
writer.WriteLine("public string AssetPath;");
|
||||
writer.WriteLine("public Type AbilityClassType;");
|
||||
//writer.WriteLine("public AbilityAsset Asset()");
|
||||
// writer.WriteLine("{");
|
||||
// writer.Indent++;
|
||||
// {
|
||||
// string loadAbilityAssetCode = string.Format(loadMethodCodeString, "AssetPath");
|
||||
// writer.WriteLine($"return {loadAbilityAssetCode};");
|
||||
// }
|
||||
// writer.Indent--;
|
||||
// writer.WriteLine("}");
|
||||
}
|
||||
writer.Indent--;
|
||||
writer.WriteLine("}");
|
||||
|
||||
writer.WriteLine("");
|
||||
|
||||
var abilityAssets = EditorUtil
|
||||
.FindAssetsByType<AbilityAsset>(GASSettingAsset.GameplayAbilityLibPath)
|
||||
.OrderBy(x => x.UniqueName)
|
||||
.ThenBy(x => x.name)
|
||||
.ToArray();
|
||||
|
||||
foreach (var ability in abilityAssets)
|
||||
{
|
||||
var path = AssetDatabase.GetAssetPath(ability);
|
||||
#if true
|
||||
writer.WriteLine(
|
||||
$"public static AbilityInfo {ability.UniqueName} = " +
|
||||
$"new AbilityInfo {{ " +
|
||||
$"Name = \"{ability.UniqueName}\", " +
|
||||
$"AssetPath = \"{path}\"," +
|
||||
$"AbilityClassType = typeof({ability.InstanceAbilityClassFullName}) }};");
|
||||
#else
|
||||
writer.WriteLine($"public static AbilityInfo {ability.UniqueName} = new AbilityInfo");
|
||||
writer.WriteLine("{");
|
||||
writer.Indent++;
|
||||
{
|
||||
writer.WriteLine($"Name = \"{ability.UniqueName}\",");
|
||||
writer.WriteLine($"AssetPath = \"{path}\",");
|
||||
writer.WriteLine($"AbilityClassType = typeof({ability.InstanceAbilityClassFullName})");
|
||||
}
|
||||
writer.Indent--;
|
||||
writer.WriteLine("};");
|
||||
#endif
|
||||
// writer.WriteLine($"private static {ability.InstanceAbilityClassFullName} _{validName};");
|
||||
// writer.WriteLine($"public static {ability.InstanceAbilityClassFullName} {validName}()");
|
||||
// writer.WriteLine("{");
|
||||
// writer.Indent++;
|
||||
// {
|
||||
// writer.WriteLine($"if (_{validName} == null) _{validName} = new {ability.InstanceAbilityClassFullName}({validName}_Info.Asset());");
|
||||
// writer.Indent++;
|
||||
// {
|
||||
// writer.WriteLine($"return _{validName};");
|
||||
// }
|
||||
// writer.Indent--;
|
||||
// }
|
||||
// writer.Indent--;
|
||||
// writer.WriteLine("}");
|
||||
|
||||
writer.WriteLine("");
|
||||
}
|
||||
|
||||
writer.WriteLine("");
|
||||
|
||||
writer.WriteLine(
|
||||
"public static Dictionary<string, AbilityInfo> AbilityMap = new Dictionary<string, AbilityInfo>");
|
||||
writer.WriteLine("{");
|
||||
writer.Indent++;
|
||||
{
|
||||
foreach (var ability in abilityAssets)
|
||||
{
|
||||
writer.WriteLine($"[\"{ability.UniqueName}\"] = {ability.UniqueName},");
|
||||
}
|
||||
}
|
||||
writer.Indent--;
|
||||
writer.WriteLine("};");
|
||||
}
|
||||
writer.Indent--;
|
||||
writer.WriteLine("}");
|
||||
}
|
||||
writer.Indent--;
|
||||
writer.Write("}");
|
||||
|
||||
Console.WriteLine($"Generated GTagLib at path: {filePath}");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 499ab276139746f595dbcfc5fc935f68
|
||||
timeCreated: 1705071386
|
@ -1,37 +0,0 @@
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Runtime;
|
||||
|
||||
public static class AbilityEditorUtil
|
||||
{
|
||||
public static List<string> GetAbilityClassNames()
|
||||
{
|
||||
var classNames = new List<string>();
|
||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
try
|
||||
{
|
||||
var types = assembly.GetTypes();
|
||||
foreach (var type in types)
|
||||
{
|
||||
if (type.IsSubclassOf(typeof(AbstractAbility)))
|
||||
{
|
||||
classNames.Add(type.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ReflectionTypeLoadException)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return classNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f6afbd9c3ac4e958729c82c6ef46146
|
||||
timeCreated: 1704263269
|
@ -1,141 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GAS.General.Validation;
|
||||
using GAS.Runtime;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GAS.Editor
|
||||
{
|
||||
public class AbilityOverview
|
||||
{
|
||||
[BoxGroup("Warning", order: -1)]
|
||||
[HideLabel]
|
||||
[ShowIf("ExistAbilityWithEmptyUniqueName")]
|
||||
[DisplayAsString(TextAlignment.Left, true)]
|
||||
public string Warning_AbilityUniqueNameIsNull =
|
||||
"<size=13><color=yellow>The <color=orange>Unique Name</color> of the ability must not be <color=red><b>EMPTY</b></color>! " +
|
||||
"Please check!</color></size>";
|
||||
|
||||
[BoxGroup("Warning", order: -1)]
|
||||
[HideLabel]
|
||||
[ShowIf("ExistAbilityWithDuplicatedUniqueName")]
|
||||
[DisplayAsString(TextAlignment.Left, true)]
|
||||
public string Warning_AbilityUniqueNameRepeat =
|
||||
"<size=13><color=yellow>The <color=orange>Unique Name</color> of the ability must not be <color=red><b>DUPLICATED</b></color>! " +
|
||||
"The duplicated abilities are as follows:<color=white> Move,Attack </color>.</color></size>";
|
||||
|
||||
[VerticalGroup("Abilities", order: 1)]
|
||||
[ListDrawerSettings(ShowFoldout = true, ShowIndexLabels = false, ShowItemCount = true, IsReadOnly = true)]
|
||||
[DisplayAsString]
|
||||
public List<string> Abilities = new List<string>();
|
||||
|
||||
public AbilityOverview()
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
[HorizontalGroup("Buttons", order: 0, MarginRight = 0.2f)]
|
||||
[GUIColor(0, 0.9f, 0.1f, 1)]
|
||||
[Button("Generate Ability Collection", ButtonSizes.Large, ButtonStyle.Box, Expanded = true)]
|
||||
void GenerateAbilityCollection()
|
||||
{
|
||||
if (ExistAbilityWithEmptyUniqueName() || ExistAbilityWithDuplicatedUniqueName())
|
||||
{
|
||||
EditorUtility.DisplayDialog("Warning", "Please check the warning message!\n" +
|
||||
"Fix the Unique Name Error!\n" +
|
||||
"(If you have fixed all and the warning still exist," +
|
||||
" try to refresh the abilities with the REFRESH button.)", "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
AbilityCollectionGenerator.Gen();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
private bool _orderByUniqueName = true;
|
||||
|
||||
[HorizontalGroup("Buttons", width: 180)]
|
||||
[Button(SdfIconType.SortAlphaDown, "@_orderByUniqueName?\"Sort By AssetName\":\"Sort By UniqueName\"",
|
||||
ButtonHeight = 30)]
|
||||
public void ToggleOrderByUniqueName()
|
||||
{
|
||||
_orderByUniqueName = !_orderByUniqueName;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private bool _showDetail = false;
|
||||
|
||||
[HorizontalGroup("Buttons", width: 120)]
|
||||
[Button(SdfIconType.TicketDetailed, "@_showDetail?\"Hide Detail\":\"Show Detail\"", ButtonHeight = 30)]
|
||||
public void ToggleShowDetail()
|
||||
{
|
||||
_showDetail = !_showDetail;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
[HorizontalGroup("Buttons", width: 50)]
|
||||
[GUIColor(1, 1f, 0)]
|
||||
[Button(SdfIconType.ArrowRepeat, "", ButtonHeight = 30)]
|
||||
[HideLabel]
|
||||
public void Refresh()
|
||||
{
|
||||
Abilities.Clear();
|
||||
var abilityAssets = EditorUtil.FindAssetsByType<AbilityAsset>(GASSettingAsset.GameplayAbilityLibPath);
|
||||
var orderedAbilityAssets = _orderByUniqueName
|
||||
? abilityAssets
|
||||
.OrderBy(x => x.UniqueName)
|
||||
.ThenBy(x => x.name)
|
||||
: abilityAssets.OrderBy(x => x.name);
|
||||
|
||||
Abilities = orderedAbilityAssets.Select(ability =>
|
||||
{
|
||||
var text = Validations.ValidateVariableName(ability.UniqueName).IsValid
|
||||
? ability.UniqueName
|
||||
: $"{ability.UniqueName}(非法UniqueName)";
|
||||
|
||||
if (_showDetail)
|
||||
{
|
||||
text += $" - asset: {ability.name}, type: {ability.GetType().FullName}";
|
||||
}
|
||||
|
||||
return text;
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
bool ExistAbilityWithEmptyUniqueName()
|
||||
{
|
||||
bool existEmpty = Abilities.Exists(string.IsNullOrEmpty);
|
||||
return existEmpty;
|
||||
}
|
||||
|
||||
bool ExistAbilityWithDuplicatedUniqueName()
|
||||
{
|
||||
var duplicateStrings = FindDuplicateStrings(Abilities);
|
||||
bool existDuplicated = duplicateStrings.Length > 0;
|
||||
if (existDuplicated)
|
||||
{
|
||||
string duplicatedUniqueName = duplicateStrings.Aggregate("", (current, d) => current + (d + ","));
|
||||
duplicatedUniqueName = duplicatedUniqueName.Remove(duplicatedUniqueName.Length - 1, 1);
|
||||
Warning_AbilityUniqueNameRepeat =
|
||||
"<size=13><color=yellow>The <color=orange>Unique Name</color> of the ability must not be <color=red><b>DUPLICATED</b></color>! " +
|
||||
$"The duplicated abilities are as follows: \n <size=15><b><color=white> {duplicatedUniqueName} </color></b></size>.</color></size>";
|
||||
}
|
||||
|
||||
return existDuplicated;
|
||||
}
|
||||
|
||||
static string[] FindDuplicateStrings(IEnumerable<string> names)
|
||||
{
|
||||
var duplicates = names
|
||||
.Where(name => !string.IsNullOrEmpty(name))
|
||||
.GroupBy(name => name)
|
||||
.Where(group => group.Count() > 1)
|
||||
.Select(group => group.Key)
|
||||
.ToArray();
|
||||
|
||||
return duplicates;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3209fb75be944c36b4f2b9d347aee120
|
||||
timeCreated: 1705290851
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f637cff7efc48542be2b4138fe99108
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55f35a69d4a54054d96e7cc375d25246
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,17 +0,0 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements">
|
||||
<ui:VisualElement name="RightContent" style="flex-grow: 1; height: 100%; max-height: 100%; min-height: 100%; flex-shrink: 0;">
|
||||
<GAS.Editor.General.VisualElement.SplitView orientation="Horizontal" usage-hints="None" fixed-pane-initial-dimension="200" fixed-pane-index="1" style="position: relative; left: 0; top: 0; flex-direction: column; width: 100%; max-width: 100%; min-width: 100%; height: 100%; max-height: 100%; min-height: 100%;">
|
||||
<ui:VisualElement name="RightTimeline" style="flex-grow: 1; padding-right: 0; width: 500px; flex-shrink: 0; height: 100%; max-height: 100%; min-height: 100%; min-width: auto;">
|
||||
<ui:IMGUIContainer name="TimerShaft" style="height: 30px; min-height: 30px; border-left-color: rgb(43, 43, 43); border-right-color: rgb(43, 43, 43); border-top-color: rgb(43, 43, 43); border-bottom-color: rgb(43, 43, 43); border-bottom-width: 1px; margin-right: 13px; max-height: 30px;" />
|
||||
<ui:ScrollView name="MainContent" mode="VerticalAndHorizontal" vertical-scroller-visibility="AlwaysVisible" style="flex-grow: 1;">
|
||||
<ui:VisualElement name="ContentTrackList" style="flex-grow: 1; height: 1000px; flex-shrink: 1; width: auto;" />
|
||||
</ui:ScrollView>
|
||||
<ui:IMGUIContainer name="SelectLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="FinishLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="DottedLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="DragItemPreview" style="position: absolute; left: 0; top: 0;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ClipInspector" style="flex-grow: 0; width: 300px; min-width: 100px; border-left-color: rgb(120, 120, 120); border-right-color: rgb(120, 120, 120); border-top-color: rgb(120, 120, 120); border-bottom-color: rgb(120, 120, 120); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; max-width: none; align-self: auto; align-items: flex-start; flex-shrink: 1; height: 100%; max-height: 100%; min-height: 100%;" />
|
||||
</GAS.Editor.General.VisualElement.SplitView>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f6767c7cb94e1940bb9595b5fba5d45
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
@ -1,15 +0,0 @@
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using GAS.General;
|
||||
|
||||
public class AbilityTimelineEditorConfig
|
||||
{
|
||||
public int FrameUnitWidth = 10;
|
||||
public const int StandardFrameUnitWidth = 1;
|
||||
public const int MaxFrameUnitLevel= 20;
|
||||
public const float MinTimerShaftFrameDrawStep = 5;
|
||||
public int DefaultFrameRate => GASTimer.FrameRate;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51b96cc42da3453c9db1934582d0a8c2
|
||||
timeCreated: 1708482904
|
@ -1,397 +0,0 @@
|
||||
using System;
|
||||
using GAS.Runtime;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UIElements;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace GAS.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// 这个类被反射引用到, 重构请小心!!
|
||||
/// </summary>
|
||||
public class AbilityTimelineEditorWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset m_VisualTreeAsset;
|
||||
|
||||
private VisualElement _root;
|
||||
|
||||
|
||||
public static AbilityTimelineEditorWindow Instance { get; private set; }
|
||||
public TimelineTrackView TrackView { get; private set; }
|
||||
|
||||
public TimelineInspector TimelineInspector { get; private set; }
|
||||
|
||||
private static EditorWindow _childInspector;
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
Instance = this;
|
||||
_root = rootVisualElement;
|
||||
|
||||
// Instantiate UXML
|
||||
VisualElement labelFromUxml = m_VisualTreeAsset.Instantiate();
|
||||
_root.Add(labelFromUxml);
|
||||
|
||||
InitAbilityAssetBar();
|
||||
InitTopBar();
|
||||
InitController();
|
||||
TimerShaftView = new TimerShaftView(_root);
|
||||
TrackView = new TimelineTrackView(_root);
|
||||
TimelineInspector = new TimelineInspector(_root);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 这个方法被反射引用到, 重构请小心!!
|
||||
/// </summary>
|
||||
public static void ShowWindow(TimelineAbilityAssetBase asset)
|
||||
{
|
||||
var wnd = GetWindow<AbilityTimelineEditorWindow>();
|
||||
wnd.titleContent = new GUIContent("AbilityTimelineEditorWindow");
|
||||
wnd.InitAbility(asset);
|
||||
|
||||
// 打开子Inspector
|
||||
EditorApplication.delayCall += () => wnd.ShowChildInspector();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
AbilityAsset.Save();
|
||||
}
|
||||
|
||||
private void InitAbility(TimelineAbilityAssetBase asset)
|
||||
{
|
||||
_abilityAsset.value = asset;
|
||||
MaxFrame.value = AbilityAsset.FrameCount;
|
||||
CurrentSelectFrameIndex = 0;
|
||||
TimerShaftView.RefreshTimerDraw();
|
||||
TrackView.RefreshTrackDraw();
|
||||
}
|
||||
|
||||
private void SaveAsset()
|
||||
{
|
||||
EditorUtility.SetDirty(AbilityAsset);
|
||||
AssetDatabase.SaveAssetIfDirty(AbilityAsset);
|
||||
}
|
||||
|
||||
#region Config
|
||||
|
||||
public AbilityTimelineEditorConfig Config { get; } = new();
|
||||
|
||||
private ObjectField _abilityAsset;
|
||||
private Button _btnShowAbilityAssetDetail;
|
||||
public TimelineAbilityAssetBase AbilityAsset => _abilityAsset.value as TimelineAbilityAssetBase;
|
||||
|
||||
// private TimelineAbilityEditorWindow AbilityAssetEditor => AbilityAsset != null
|
||||
// ? UnityEditor.Editor.CreateEditor(AbilityAsset) as TimelineAbilityEditorWindow
|
||||
// : null;
|
||||
|
||||
private void InitAbilityAssetBar()
|
||||
{
|
||||
_abilityAsset = _root.Q<ObjectField>("SequentialAbilityAsset");
|
||||
_abilityAsset.RegisterValueChangedCallback(OnSequentialAbilityAssetChanged);
|
||||
|
||||
_btnShowAbilityAssetDetail = _root.Q<Button>("BtnShowAbilityAssetDetail");
|
||||
_btnShowAbilityAssetDetail.clickable.clicked += ShowAbilityAssetDetail;
|
||||
}
|
||||
|
||||
private void OnSequentialAbilityAssetChanged(ChangeEvent<Object> evt)
|
||||
{
|
||||
if (AbilityAsset != null)
|
||||
{
|
||||
MaxFrame.value = AbilityAsset.FrameCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
Selection.activeObject = null;
|
||||
}
|
||||
|
||||
CurrentSelectFrameIndex = 0;
|
||||
TimerShaftView.RefreshTimerDraw();
|
||||
TrackView.RefreshTrackDraw();
|
||||
}
|
||||
|
||||
private void ShowAbilityAssetDetail()
|
||||
{
|
||||
if (AbilityAsset == null) return;
|
||||
Selection.activeObject = AbilityAsset;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TopBar
|
||||
|
||||
private string _previousScenePath;
|
||||
private Button BtnLoadPreviewScene;
|
||||
private Button BtnBackToScene;
|
||||
private Button BtnChildInspector;
|
||||
private ObjectField _previewObjectField;
|
||||
public GameObject PreviewObject => _previewObjectField.value as GameObject;
|
||||
|
||||
private void InitTopBar()
|
||||
{
|
||||
BtnLoadPreviewScene = _root.Q<Button>(nameof(BtnLoadPreviewScene));
|
||||
BtnLoadPreviewScene.clickable.clicked += LoadPreviewScene;
|
||||
BtnBackToScene = _root.Q<Button>(nameof(BtnBackToScene));
|
||||
BtnBackToScene.clickable.clicked += BackToScene;
|
||||
|
||||
BtnChildInspector = _root.Q<Button>(nameof(BtnChildInspector));
|
||||
BtnChildInspector.clickable.clicked += ShowChildInspector;
|
||||
|
||||
_previewObjectField = _root.Q<ObjectField>("PreviewInstance");
|
||||
_previewObjectField.RegisterValueChangedCallback(OnPreviewObjectChanged);
|
||||
}
|
||||
|
||||
private void ShowChildInspector()
|
||||
{
|
||||
if (_childInspector == null)
|
||||
{
|
||||
_childInspector = GetInspectTarget();
|
||||
_childInspector.Show();
|
||||
}
|
||||
|
||||
EditorApplication.delayCall += () =>
|
||||
DockUtilities.DockWindow(this, _childInspector, DockUtilities.DockPosition.Right);
|
||||
}
|
||||
|
||||
private void OnPreviewObjectChanged(ChangeEvent<Object> evt)
|
||||
{
|
||||
// TODO : 在这里处理预览对象的变化
|
||||
}
|
||||
|
||||
private void BackToScene()
|
||||
{
|
||||
// 判断是否有记录前一个Scene
|
||||
if (!string.IsNullOrEmpty(_previousScenePath))
|
||||
// 激活前一个Scene
|
||||
EditorSceneManager.OpenScene(_previousScenePath);
|
||||
else
|
||||
Debug.LogWarning("No previous scene available.");
|
||||
}
|
||||
|
||||
private void LoadPreviewScene()
|
||||
{
|
||||
// 记录当前Scene
|
||||
_previousScenePath = SceneManager.GetActiveScene().path;
|
||||
// 创建一个新的Scene
|
||||
var newScene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
|
||||
// 在这里添加临时预览的内容,例如放置一些对象
|
||||
// 这里只是演示,具体可以根据需求添加你的内容
|
||||
// GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
// SceneManager.MoveGameObjectToScene(cube, newScene);
|
||||
// 激活新创建的Scene
|
||||
SceneManager.SetActiveScene(newScene);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TimerShaft
|
||||
|
||||
public TimerShaftView TimerShaftView { get; private set; }
|
||||
|
||||
private int _currentMaxFrame;
|
||||
|
||||
public int CurrentMaxFrame
|
||||
{
|
||||
get => _currentMaxFrame;
|
||||
private set
|
||||
{
|
||||
if (AbilityAsset == null)
|
||||
{
|
||||
_currentMaxFrame = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_currentMaxFrame == value) return;
|
||||
_currentMaxFrame = value;
|
||||
AbilityAsset.FrameCount = _currentMaxFrame;
|
||||
SaveAsset();
|
||||
MaxFrame.value = _currentMaxFrame;
|
||||
TrackView.UpdateContentSize();
|
||||
TimerShaftView.RefreshTimerDraw();
|
||||
}
|
||||
}
|
||||
|
||||
private int _currentSelectFrameIndex;
|
||||
|
||||
public int CurrentSelectFrameIndex
|
||||
{
|
||||
get => _currentSelectFrameIndex;
|
||||
set
|
||||
{
|
||||
if (_currentSelectFrameIndex == value) return;
|
||||
_currentSelectFrameIndex = Mathf.Clamp(value, 0, MaxFrame.value);
|
||||
CurrentFrame.value = _currentSelectFrameIndex;
|
||||
TimerShaftView.RefreshTimerDraw();
|
||||
|
||||
EvaluateFrame(_currentSelectFrameIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public float CurrentFramePos => Mathf.Abs(TimerShaftView.TimeLineContainer.transform.position.x);
|
||||
public float CurrentSelectFramePos => _currentSelectFrameIndex * Config.FrameUnitWidth;
|
||||
public float CurrentEndFramePos => CurrentMaxFrame * Config.FrameUnitWidth;
|
||||
|
||||
public int GetFrameIndexByPosition(float x)
|
||||
{
|
||||
return TimerShaftView.GetFrameIndexByPosition(x);
|
||||
}
|
||||
|
||||
public int GetFrameIndexByMouse(float x)
|
||||
{
|
||||
return TimerShaftView.GetFrameIndexByMouse(x);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Controller
|
||||
|
||||
private Button BtnPlay;
|
||||
private Button BtnLeftFrame;
|
||||
private Button BtnRightFrame;
|
||||
private IntegerField CurrentFrame;
|
||||
private IntegerField MaxFrame;
|
||||
|
||||
private void InitController()
|
||||
{
|
||||
BtnPlay = _root.Q<Button>(nameof(BtnPlay));
|
||||
BtnPlay.clickable.clicked += OnPlay;
|
||||
|
||||
BtnLeftFrame = _root.Q<Button>(nameof(BtnLeftFrame));
|
||||
BtnLeftFrame.clickable.clicked += OnLeftFrame;
|
||||
|
||||
BtnRightFrame = _root.Q<Button>(nameof(BtnRightFrame));
|
||||
BtnRightFrame.clickable.clicked += OnRightFrame;
|
||||
|
||||
CurrentFrame = _root.Q<IntegerField>(nameof(CurrentFrame));
|
||||
CurrentFrame.RegisterValueChangedCallback(OnCurrentFrameChanged);
|
||||
MaxFrame = _root.Q<IntegerField>(nameof(MaxFrame));
|
||||
MaxFrame.RegisterValueChangedCallback(OnMaxFrameChanged);
|
||||
}
|
||||
|
||||
private void OnMaxFrameChanged(ChangeEvent<int> evt)
|
||||
{
|
||||
CurrentMaxFrame = evt.newValue;
|
||||
MaxFrame.value = CurrentMaxFrame;
|
||||
}
|
||||
|
||||
private void OnCurrentFrameChanged(ChangeEvent<int> evt)
|
||||
{
|
||||
CurrentSelectFrameIndex = evt.newValue;
|
||||
CurrentFrame.value = CurrentSelectFrameIndex;
|
||||
}
|
||||
|
||||
private void RefreshPlayButton()
|
||||
{
|
||||
BtnPlay.text = !IsPlaying ? "▶" : "⏹";
|
||||
BtnPlay.style.backgroundColor =
|
||||
!IsPlaying ? new Color(0.5f, 0.5f, 0.5f, 0.5f) : new Color(0.1f, 0.8f, 0.1f, 0.5f);
|
||||
}
|
||||
|
||||
private void OnPlay()
|
||||
{
|
||||
if (AbilityAsset == null) return;
|
||||
IsPlaying = !IsPlaying;
|
||||
}
|
||||
|
||||
private void OnLeftFrame()
|
||||
{
|
||||
if (AbilityAsset == null) return;
|
||||
IsPlaying = false;
|
||||
CurrentSelectFrameIndex -= 1;
|
||||
}
|
||||
|
||||
private void OnRightFrame()
|
||||
{
|
||||
if (AbilityAsset == null) return;
|
||||
IsPlaying = false;
|
||||
CurrentSelectFrameIndex += 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Clip Inspector
|
||||
|
||||
public object CurrentInspectorObject => TimelineInspector.CurrentInspectorObject;
|
||||
|
||||
public void SetInspector(object target = null)
|
||||
{
|
||||
if (AbilityAsset == null) return;
|
||||
TimelineInspector.SetInspector(target);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TimelinePreview
|
||||
|
||||
private DateTime _startTime;
|
||||
private int _startPlayFrameIndex;
|
||||
private bool _isPlaying;
|
||||
|
||||
public bool IsPlaying
|
||||
{
|
||||
get => _isPlaying;
|
||||
private set
|
||||
{
|
||||
_isPlaying = CanPlay() && value;
|
||||
|
||||
if (_isPlaying)
|
||||
{
|
||||
_startTime = DateTime.Now;
|
||||
_startPlayFrameIndex = CurrentSelectFrameIndex;
|
||||
}
|
||||
|
||||
RefreshPlayButton();
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (IsPlaying)
|
||||
{
|
||||
var deltaTime = (DateTime.Now - _startTime).TotalSeconds;
|
||||
var frameIndex = (int)(deltaTime * Config.DefaultFrameRate) + _startPlayFrameIndex;
|
||||
if (frameIndex >= CurrentMaxFrame)
|
||||
{
|
||||
frameIndex = CurrentMaxFrame;
|
||||
IsPlaying = false;
|
||||
}
|
||||
|
||||
CurrentSelectFrameIndex = frameIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private void EvaluateFrame(int frameIndex)
|
||||
{
|
||||
if (AbilityAsset == null || _previewObjectField.value == null) return;
|
||||
|
||||
foreach (var track in TrackView.TrackList)
|
||||
track.TickView(frameIndex);
|
||||
}
|
||||
|
||||
private bool CanPlay()
|
||||
{
|
||||
var canPlay = AbilityAsset != null && _previewObjectField.value != null;
|
||||
return canPlay;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Another Inspector
|
||||
|
||||
private static EditorWindow GetInspectTarget(Object targetGO = null)
|
||||
{
|
||||
Type inspectorType = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.InspectorWindow");
|
||||
EditorWindow inspectorInstance = CreateInstance(inspectorType) as EditorWindow;
|
||||
if (targetGO) Selection.activeObject = targetGO;
|
||||
return inspectorInstance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d389b67c6c74be4d9e22a30e4527d0f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_VisualTreeAsset: {fileID: 9197481963319205126, guid: 0ad52cc89065e3e4f9fef4bc5674a5f5, type: 3}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,9 +0,0 @@
|
||||
.custom-label {
|
||||
font-size: 20px;
|
||||
-unity-font-style: bold;
|
||||
color: rgb(68, 138, 255);
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
min-height: 100%;
|
||||
flex-direction: column;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28fcc296ac2d3554db81c84901f63835
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
@ -1,46 +0,0 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Assets/GAS/Editor/Ability/AbilityTimelineEditor/EditorWindow/AbilityTimelineEditorWindow.uss?fileID=7433441132597879392&guid=28fcc296ac2d3554db81c84901f63835&type=3#AbilityTimelineEditorWindow" />
|
||||
<ui:VisualElement name="Root" style="flex-grow: 1; flex-direction: column; height: 100%; min-height: 100%; max-height: 100%; flex-shrink: 0;">
|
||||
<ui:VisualElement name="AbilityAsset" style="flex-grow: 1; min-width: auto; min-height: auto; max-height: 40px; flex-direction: row; border-left-color: rgba(34, 34, 34, 0.84); border-right-color: rgba(34, 34, 34, 0.84); border-top-color: rgba(34, 34, 34, 0.84); border-bottom-color: rgba(34, 34, 34, 0.84); border-top-width: 0; border-right-width: 0; border-bottom-width: 2px; border-left-width: 0; height: 40px; align-self: auto; align-items: center;">
|
||||
<uie:ObjectField label="Ability配置 " name="SequentialAbilityAsset" type="GAS.Runtime.TimelineAbilityAsset, com.exhard.exgas.runtime" style="-unity-font-style: bold; font-size: 13px; -unity-text-align: middle-left; align-items: center; width: auto; align-self: stretch; flex-direction: row; min-width: auto; max-height: none; max-width: 300px;" />
|
||||
<ui:Button text="查看能力基本信息" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnShowAbilityAssetDetail" style="justify-content: center; height: 20px;" />
|
||||
<ui:VisualElement name="Right" style="flex-grow: 1; flex-direction: row; align-items: center; align-self: flex-start; -unity-text-align: upper-left; justify-content: flex-start; padding-left: 30px; border-left-color: rgba(0, 0, 0, 0.53); border-right-color: rgba(0, 0, 0, 0.53); border-top-color: rgba(0, 0, 0, 0.53); border-bottom-color: rgba(0, 0, 0, 0.53); border-right-width: 0; border-left-width: 2px;">
|
||||
<uie:ObjectField label="预览实例" name="PreviewInstance" type="UnityEngine.GameObject, UnityEngine.CoreModule" allow-scene-objects="true" style="align-items: center; align-self: center; flex-direction: row; height: 20px; -unity-font-style: bold; font-size: 15px; -unity-text-align: middle-center; width: 300px; border-left-color: rgb(255, 255, 255); border-right-color: rgb(255, 255, 255); border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(255, 255, 255); border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
|
||||
<ui:VisualElement name="Buttons" style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:Button text="预览场景" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnLoadPreviewScene" style="-unity-font-style: bold; width: 120px; height: 25px; align-self: auto; justify-content: flex-start; align-items: auto;" />
|
||||
<ui:Button text="返回原场景" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnBackToScene" style="width: 120px; -unity-font-style: bold; height: 25px;" />
|
||||
<ui:Button text="显示子Inspector" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnChildInspector" enable-rich-text="true" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="Content" style="flex-grow: 1; flex-direction: row; flex-shrink: 1; height: auto;">
|
||||
<ui:VisualElement name="LeftConsole" style="flex-grow: 1; width: 200px; min-width: 200px; border-left-color: rgb(41, 41, 41); border-right-color: rgb(41, 41, 41); border-top-color: rgb(41, 41, 41); border-bottom-color: rgb(41, 41, 41); border-left-width: 0; border-right-width: 2px; margin-right: 5px; max-width: 200px; height: 100%; max-height: 100%; min-height: auto; flex-shrink: 0;">
|
||||
<ui:VisualElement name="Controller" style="flex-grow: 1; flex-direction: row; height: 30px; max-height: 30px; min-width: 200px; width: 200px; max-width: 200px; border-left-color: rgba(24, 24, 24, 0.5); border-right-color: rgba(24, 24, 24, 0.5); border-top-color: rgba(24, 24, 24, 0.5); border-bottom-color: rgba(24, 24, 24, 0.5); border-right-width: 0; align-items: auto; align-self: flex-start; justify-content: space-around; position: relative; left: auto; border-bottom-width: 2px;">
|
||||
<ui:VisualElement name="ButtonGroup" style="flex-grow: 1; flex-direction: row; justify-content: flex-start; align-self: center;">
|
||||
<ui:Button text="<" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnLeftFrame" style="font-size: 13px; -unity-font-style: bold; align-self: center;" />
|
||||
<ui:Button text="▶" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnPlay" style="-unity-font-style: bold; font-size: 13px; align-self: center;" />
|
||||
<ui:Button text=">" parse-escape-sequences="true" display-tooltip-when-elided="true" name="BtnRightFrame" style="-unity-font-style: bold; font-size: 13px; align-self: center;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="FrameCount" style="flex-grow: 1; flex-direction: row-reverse; justify-content: flex-end; align-items: center; align-self: center; flex-wrap: nowrap; flex-shrink: 1;">
|
||||
<ui:IntegerField value="0" name="MaxFrame" is-delayed="true" style="width: 40px;" />
|
||||
<ui:Label tabindex="-1" text="/" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" />
|
||||
<ui:IntegerField value="0" name="CurrentFrame" readonly="false" style="width: 40px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="TrackMenu" style="flex-grow: 1; height: 100%; max-height: 100%; min-height: auto; padding-left: 3px; padding-right: 3px;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="RightContent" style="flex-grow: 1; height: 100%; max-height: 100%; min-height: 100%; flex-shrink: 0;">
|
||||
<ui:VisualElement name="RightTimeline" style="flex-grow: 1; padding-right: 0; width: auto; flex-shrink: 0; height: 100%; max-height: 100%; min-height: 100%; min-width: auto; max-width: none;">
|
||||
<ui:IMGUIContainer name="TimerShaft" style="height: 30px; min-height: 30px; border-left-color: rgb(43, 43, 43); border-right-color: rgb(43, 43, 43); border-top-color: rgb(43, 43, 43); border-bottom-color: rgb(43, 43, 43); border-bottom-width: 1px; margin-right: 13px; max-height: 30px;" />
|
||||
<ui:ScrollView name="MainContent" mode="VerticalAndHorizontal" vertical-scroller-visibility="AlwaysVisible" style="flex-grow: 1;">
|
||||
<ui:VisualElement name="ContentTrackList" style="flex-grow: 1; height: 1000px; flex-shrink: 1; width: auto;" />
|
||||
</ui:ScrollView>
|
||||
<ui:IMGUIContainer name="SelectLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="FinishLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="DottedLine" style="position: absolute; left: 0;" />
|
||||
<ui:IMGUIContainer name="DragItemPreview" style="position: absolute; left: 0; top: 0;" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ad52cc89065e3e4f9fef4bc5674a5f5
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
@ -1,55 +0,0 @@
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using UnityEngine.UIElements;
|
||||
public class TimelineInspector
|
||||
{
|
||||
private VisualElement _root;
|
||||
public object CurrentInspectorObject;
|
||||
public TimelineInspector(VisualElement root)
|
||||
{
|
||||
_root = root;
|
||||
SetInspector();
|
||||
}
|
||||
|
||||
public void SetInspector(object target=null)
|
||||
{
|
||||
UpdateInspector(false,target);
|
||||
}
|
||||
|
||||
private void UpdateInspector(bool force = false, object target = null)
|
||||
{
|
||||
if (CurrentInspectorObject == target && !force) return;
|
||||
|
||||
if (CurrentInspectorObject != null && !force)
|
||||
{
|
||||
if (CurrentInspectorObject is TrackClipBase oldTrackItem) oldTrackItem.ClipVe.OnUnSelect();
|
||||
if (CurrentInspectorObject is TrackBase oldTrack) oldTrack.OnUnSelect();
|
||||
if (CurrentInspectorObject is TrackMarkBase oldMark) oldMark.OnUnSelect();
|
||||
}
|
||||
|
||||
CurrentInspectorObject = target;
|
||||
switch (CurrentInspectorObject)
|
||||
{
|
||||
case null:
|
||||
UnityEditor.Selection.activeObject = null;
|
||||
return;
|
||||
case TrackClipBase trackClip:
|
||||
UnityEditor.Selection.activeObject = trackClip.DataInspector;
|
||||
break;
|
||||
case TrackBase track:
|
||||
UnityEditor.Selection.activeObject = track.DataInspector;
|
||||
break;
|
||||
case TrackMarkBase mark:
|
||||
UnityEditor.Selection.activeObject = mark.DataInspector;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshInspector()
|
||||
{
|
||||
UpdateInspector(true,CurrentInspectorObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de22069e09424610a3b23bf48b2c2523
|
||||
timeCreated: 1709101722
|
@ -1,172 +0,0 @@
|
||||
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using GAS.Runtime;
|
||||
|
||||
public class TimelineTrackView
|
||||
{
|
||||
private static List<Type> _trackTypeList;
|
||||
private static readonly Dictionary<string, Type> _trackTypeMap = new();
|
||||
private readonly VisualElement _root;
|
||||
private Button _btnAddTrack;
|
||||
private VisualElement _contentTrackListParent;
|
||||
private MenuTrack _menuBuffGameplayEffect;
|
||||
private MenuTrack _menuDurationalCue;
|
||||
private MenuTrack _menuInstantCue;
|
||||
private MenuTrack _menuInstantTask;
|
||||
private MenuTrack _menuOngoingTask;
|
||||
private MenuTrack _menuReleaseGameplayEffect;
|
||||
private MenuTrack _menuPassiveGameplayEffect;
|
||||
private MenuTrack _menuPassiveTask;
|
||||
private VisualElement _trackMenuParent;
|
||||
|
||||
public TimelineTrackView(VisualElement root)
|
||||
{
|
||||
_root = root;
|
||||
InitTracks();
|
||||
}
|
||||
|
||||
public List<TrackBase> TrackList { get; } = new();
|
||||
|
||||
private static AbilityTimelineEditorConfig Config => AbilityTimelineEditorWindow.Instance.Config;
|
||||
private static TimelineAbilityAssetBase AbilityAsset => AbilityTimelineEditorWindow.Instance.AbilityAsset;
|
||||
|
||||
private void InitTracks()
|
||||
{
|
||||
_contentTrackListParent = _root.Q<VisualElement>("ContentTrackList");
|
||||
_trackMenuParent = _root.Q<VisualElement>("TrackMenu");
|
||||
|
||||
RefreshTrackDraw();
|
||||
UpdateContentSize();
|
||||
}
|
||||
|
||||
public void RefreshTrackDraw()
|
||||
{
|
||||
TrackList.Clear();
|
||||
_contentTrackListParent.Clear();
|
||||
_trackMenuParent.Clear();
|
||||
if (AbilityAsset == null) return;
|
||||
|
||||
// Instant Cue
|
||||
_menuInstantCue = new MenuTrack();
|
||||
_menuInstantCue.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(InstantCueTrack), typeof(InstantCueTrackData), "Instant Cue",
|
||||
new Color(0.1f, 0.2f, 0.6f, 0.2f), new Color(0.1f, 0.6f, 0.9f, 0.9f));
|
||||
foreach (var durationalCueTrackData in AbilityAsset.InstantCues)
|
||||
{
|
||||
var instantCueTrack = new InstantCueTrack();
|
||||
instantCueTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
durationalCueTrackData);
|
||||
TrackList.Add(instantCueTrack);
|
||||
}
|
||||
|
||||
|
||||
// Release GameplayEffect
|
||||
_menuReleaseGameplayEffect = new MenuTrack();
|
||||
_menuReleaseGameplayEffect.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(ReleaseGameplayEffectTrack), typeof(ReleaseGameplayEffectTrackData), "Release Effect",
|
||||
new Color(0.9f, 0.3f, 0.35f, 0.2f), new Color(0.9f, 0.3f, 0.35f, 0.9f));
|
||||
foreach (var releaseGameplayEffectTrackData in AbilityAsset.ReleaseGameplayEffect)
|
||||
{
|
||||
var releaseGameplayEffectTrack = new ReleaseGameplayEffectTrack();
|
||||
releaseGameplayEffectTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
releaseGameplayEffectTrackData);
|
||||
TrackList.Add(releaseGameplayEffectTrack);
|
||||
}
|
||||
|
||||
|
||||
// Instant Task
|
||||
_menuInstantTask = new MenuTrack();
|
||||
_menuInstantTask.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(TaskMarkEventTrack), typeof(TaskMarkEventTrackData), "Instant Task",
|
||||
new Color(0.1f, 0.6f, 0.6f, 0.2f), new Color(0.1f, 0.6f, 0.6f, 0.9f));
|
||||
foreach (var instantTaskEventTrackData in AbilityAsset.InstantTasks)
|
||||
{
|
||||
var instantTaskEventTrack = new TaskMarkEventTrack();
|
||||
instantTaskEventTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
instantTaskEventTrackData);
|
||||
TrackList.Add(instantTaskEventTrack);
|
||||
}
|
||||
|
||||
|
||||
// Durational Cue
|
||||
_menuDurationalCue = new MenuTrack();
|
||||
_menuDurationalCue.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(DurationalCueTrack), typeof(DurationalCueTrackData), "Durational Cue",
|
||||
new Color(0.1f, 0.6f, 0.1f, 0.2f), new Color(0.1f, 0.6f, 0.1f, 1));
|
||||
foreach (var durationalCueTrackData in AbilityAsset.DurationalCues)
|
||||
{
|
||||
var cueTrack = new DurationalCueTrack();
|
||||
cueTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth, durationalCueTrackData);
|
||||
TrackList.Add(cueTrack);
|
||||
}
|
||||
|
||||
// Buff GameplayEffect
|
||||
_menuBuffGameplayEffect = new MenuTrack();
|
||||
_menuBuffGameplayEffect.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(BuffGameplayEffectTrack), typeof(BuffGameplayEffectTrackData), "Buff",
|
||||
new Color(0.9f, 0.6f, 0.6f, 0.2f), new Color(0.9f, 0.6f, 0.6f, 1));
|
||||
foreach (var buffGameplayEffectTrackData in AbilityAsset.BuffGameplayEffects)
|
||||
{
|
||||
var buffTrack = new BuffGameplayEffectTrack();
|
||||
buffTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
buffGameplayEffectTrackData);
|
||||
TrackList.Add(buffTrack);
|
||||
}
|
||||
|
||||
// Ongoing Task
|
||||
_menuOngoingTask = new MenuTrack();
|
||||
_menuOngoingTask.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(TaskClipEventTrack), typeof(TaskClipEventTrackData), "Ongoing Task",
|
||||
new Color(0.7f, 0.3f, 0.7f, 0.2f), new Color(0.5f, 0.3f, 0.5f, 1));
|
||||
foreach (var customClipEventTrackData in AbilityAsset.OngoingTasks)
|
||||
{
|
||||
var customClipTrack = new TaskClipEventTrack();
|
||||
customClipTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
customClipEventTrackData);
|
||||
TrackList.Add(customClipTrack);
|
||||
}
|
||||
|
||||
// Passive GameplayEffect
|
||||
_menuPassiveGameplayEffect = new MenuTrack();
|
||||
_menuPassiveGameplayEffect.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(PassiveGameplayEffectTrack), typeof(PassiveGameplayEffectTrackData), "Passive",
|
||||
new Color(0.8f, 0.8f, 0.2f, 0.2f), new Color(0.8f, 0.8f, 0.2f, 1));
|
||||
foreach (var passiveGameplayEffectTrackData in AbilityAsset.PassiveGameplayEffects)
|
||||
{
|
||||
var buffTrack = new PassiveGameplayEffectTrack();
|
||||
buffTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
passiveGameplayEffectTrackData);
|
||||
TrackList.Add(buffTrack);
|
||||
}
|
||||
|
||||
// Passive Task
|
||||
_menuPassiveTask = new MenuTrack();
|
||||
_menuPassiveTask.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
typeof(PassiveTaskClipEventTrack), typeof(PassiveTaskClipEventTrackData), "Passive Task",
|
||||
new Color(0.7f, 0.3f, 0.7f, 0.2f), new Color(0.5f, 0.3f, 0.5f, 1));
|
||||
foreach (var customClipEventTrackData in AbilityAsset.PassiveTasks)
|
||||
{
|
||||
var customClipTrack = new PassiveTaskClipEventTrack();
|
||||
customClipTrack.Init(_contentTrackListParent, _trackMenuParent, Config.FrameUnitWidth,
|
||||
customClipEventTrackData);
|
||||
TrackList.Add(customClipTrack);
|
||||
}
|
||||
|
||||
UpdateContentSize();
|
||||
}
|
||||
|
||||
public void UpdateContentSize()
|
||||
{
|
||||
_contentTrackListParent.style.width =
|
||||
AbilityTimelineEditorWindow.Instance.CurrentMaxFrame * Config.FrameUnitWidth;
|
||||
foreach (var track in TrackList) track.RefreshShow(Config.FrameUnitWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fd4dc4ec6be4b149e428db5c2ca0fb0
|
||||
timeCreated: 1709022190
|
@ -1,272 +0,0 @@
|
||||
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
public class TimerShaftView
|
||||
{
|
||||
private readonly VisualElement _root;
|
||||
|
||||
private int _dottedLineFrameIndex = -1;
|
||||
|
||||
private Rect _dragItemPreviewRect;
|
||||
|
||||
private bool _showDragItemPreview;
|
||||
private VisualElement contentViewPort;
|
||||
private IMGUIContainer DottedLine;
|
||||
private IMGUIContainer DragItemPreview;
|
||||
private IMGUIContainer FinishLine;
|
||||
private IMGUIContainer SelectLine;
|
||||
|
||||
private bool timerShaftMouseIn;
|
||||
|
||||
public TimerShaftView(VisualElement root)
|
||||
{
|
||||
_root = root;
|
||||
InitTimerShaft();
|
||||
}
|
||||
|
||||
private static AbilityTimelineEditorWindow EditorInst => AbilityTimelineEditorWindow.Instance;
|
||||
private static AbilityTimelineEditorConfig Config => AbilityTimelineEditorWindow.Instance.Config;
|
||||
|
||||
public IMGUIContainer TimerShaft { get; private set; }
|
||||
public VisualElement TimeLineContainer { get; private set; }
|
||||
public ScrollView MainContent { get; private set; }
|
||||
|
||||
public int DottedLineFrameIndex
|
||||
{
|
||||
get => _dottedLineFrameIndex;
|
||||
set
|
||||
{
|
||||
if (_dottedLineFrameIndex == value) return;
|
||||
_dottedLineFrameIndex = value;
|
||||
var showDottedLine = _dottedLineFrameIndex * Config.FrameUnitWidth >= EditorInst.CurrentFramePos &&
|
||||
_dottedLineFrameIndex * Config.FrameUnitWidth <
|
||||
EditorInst.CurrentFramePos + TimerShaft.contentRect.width;
|
||||
DottedLine.style.display = showDottedLine ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
DottedLine.MarkDirtyRepaint();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowDragItemPreview
|
||||
{
|
||||
get => _showDragItemPreview;
|
||||
set
|
||||
{
|
||||
if (_showDragItemPreview == value) return;
|
||||
_showDragItemPreview = value;
|
||||
DragItemPreview.MarkDirtyRepaint();
|
||||
}
|
||||
}
|
||||
|
||||
public Rect DragItemPreviewRect
|
||||
{
|
||||
get => _dragItemPreviewRect;
|
||||
set
|
||||
{
|
||||
_dragItemPreviewRect = value;
|
||||
DragItemPreview.MarkDirtyRepaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitTimerShaft()
|
||||
{
|
||||
var mainContainer = _root.Q<ScrollView>("MainContent");
|
||||
MainContent = mainContainer;
|
||||
TimeLineContainer = mainContainer.Q<VisualElement>("unity-content-container");
|
||||
contentViewPort = mainContainer.Q<VisualElement>("unity-content-viewport");
|
||||
|
||||
TimerShaft = _root.Q<IMGUIContainer>(nameof(TimerShaft));
|
||||
TimerShaft.onGUIHandler = OnTimerShaftGUI;
|
||||
TimerShaft.RegisterCallback<WheelEvent>(OnWheelEvent);
|
||||
TimerShaft.RegisterCallback<MouseDownEvent>(OnTimerShaftMouseDown);
|
||||
TimerShaft.RegisterCallback<MouseMoveEvent>(OnTimerShaftMouseMove);
|
||||
TimerShaft.RegisterCallback<MouseUpEvent>(OnTimerShaftMouseUp);
|
||||
TimerShaft.RegisterCallback<MouseOutEvent>(OnTimerShaftMouseOut);
|
||||
|
||||
SelectLine = _root.Q<IMGUIContainer>(nameof(SelectLine));
|
||||
SelectLine.onGUIHandler = OnSelectLineGUI;
|
||||
|
||||
FinishLine = _root.Q<IMGUIContainer>(nameof(FinishLine));
|
||||
FinishLine.onGUIHandler = OnFinishLineGUI;
|
||||
|
||||
DottedLine = _root.Q<IMGUIContainer>(nameof(DottedLine));
|
||||
DottedLine.onGUIHandler = OnDottedLineGUI;
|
||||
|
||||
DragItemPreview = _root.Q<IMGUIContainer>(nameof(DragItemPreview));
|
||||
DragItemPreview.onGUIHandler = OnDragItemPreviewGUI;
|
||||
}
|
||||
|
||||
public void RefreshTimerDraw()
|
||||
{
|
||||
TimerShaft.MarkDirtyRepaint();
|
||||
SelectLine.MarkDirtyRepaint();
|
||||
FinishLine.MarkDirtyRepaint();
|
||||
}
|
||||
|
||||
private void OnTimerShaftMouseDown(MouseDownEvent evt)
|
||||
{
|
||||
timerShaftMouseIn = true;
|
||||
EditorInst.CurrentSelectFrameIndex = GetFrameIndexByMouse(evt.localMousePosition.x);
|
||||
}
|
||||
|
||||
private void OnTimerShaftMouseUp(MouseUpEvent evt)
|
||||
{
|
||||
timerShaftMouseIn = false;
|
||||
}
|
||||
|
||||
private void OnTimerShaftMouseMove(MouseMoveEvent evt)
|
||||
{
|
||||
if (timerShaftMouseIn) EditorInst.CurrentSelectFrameIndex = GetFrameIndexByMouse(evt.localMousePosition.x);
|
||||
}
|
||||
|
||||
private void OnTimerShaftMouseOut(MouseOutEvent evt)
|
||||
{
|
||||
timerShaftMouseIn = false;
|
||||
}
|
||||
|
||||
public int GetFrameIndexByMouse(float x)
|
||||
{
|
||||
return GetFrameIndexByPosition(x + EditorInst.CurrentFramePos);
|
||||
}
|
||||
|
||||
public int GetFrameIndexByPosition(float x)
|
||||
{
|
||||
return Mathf.RoundToInt(x) / Config.FrameUnitWidth;
|
||||
}
|
||||
|
||||
private void OnSelectLineGUI()
|
||||
{
|
||||
if (EditorInst.CurrentSelectFramePos >= EditorInst.CurrentFramePos &&
|
||||
EditorInst.CurrentSelectFramePos < EditorInst.CurrentFramePos + TimerShaft.contentRect.width)
|
||||
{
|
||||
Handles.BeginGUI();
|
||||
Handles.color = Color.green;
|
||||
var length = contentViewPort.contentRect.height + TimerShaft.contentRect.height;
|
||||
var x = EditorInst.CurrentSelectFramePos - EditorInst.CurrentFramePos;
|
||||
x = Mathf.Max(x, 1);
|
||||
Handles.DrawLine(new Vector3(x, 0), new Vector3(x, length));
|
||||
Handles.EndGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFinishLineGUI()
|
||||
{
|
||||
if (EditorInst.CurrentEndFramePos >= EditorInst.CurrentFramePos &&
|
||||
EditorInst.CurrentEndFramePos < EditorInst.CurrentFramePos + TimerShaft.contentRect.width)
|
||||
{
|
||||
Handles.BeginGUI();
|
||||
Handles.color = Color.red;
|
||||
var length = contentViewPort.contentRect.height + TimerShaft.contentRect.height;
|
||||
var x = EditorInst.CurrentEndFramePos - EditorInst.CurrentFramePos;
|
||||
x = Mathf.Max(x, 1);
|
||||
Handles.DrawLine(new Vector3(x, 0), new Vector3(x, length));
|
||||
Handles.EndGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDottedLineGUI()
|
||||
{
|
||||
var dottedLinePos = DottedLineFrameIndex * Config.FrameUnitWidth;
|
||||
if (dottedLinePos >= EditorInst.CurrentFramePos &&
|
||||
dottedLinePos < EditorInst.CurrentFramePos + TimerShaft.contentRect.width)
|
||||
{
|
||||
Handles.BeginGUI();
|
||||
Handles.color = new Color(1, 0.5f, 0, 1);
|
||||
var length = contentViewPort.contentRect.height + TimerShaft.contentRect.height;
|
||||
var x = dottedLinePos - EditorInst.CurrentFramePos;
|
||||
x = Mathf.Max(x, 1);
|
||||
|
||||
var lineUnitSize = 10f;
|
||||
var lineUnitsCount = 0;
|
||||
for (float i = 0; i < length; i += lineUnitSize)
|
||||
if (lineUnitsCount++ % 2 == 0)
|
||||
Handles.DrawLine(new Vector3(x, i), new Vector3(x, i + lineUnitSize));
|
||||
|
||||
Handles.EndGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDragItemPreviewGUI()
|
||||
{
|
||||
if (ShowDragItemPreview)
|
||||
{
|
||||
Handles.BeginGUI();
|
||||
Handles.color = new Color(0.5f, 0.5f, 0.5f, 0.5f);
|
||||
Handles.DrawSolidRectangleWithOutline(DragItemPreviewRect, new Color(0.9f, 0.5f, 0, 0.9f), Color.white);
|
||||
Handles.EndGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnWheelEvent(WheelEvent evt)
|
||||
{
|
||||
var deltaY = (int)evt.delta.y;
|
||||
Config.FrameUnitWidth =
|
||||
Mathf.Clamp(Config.FrameUnitWidth - deltaY,
|
||||
AbilityTimelineEditorConfig.StandardFrameUnitWidth,
|
||||
Mathf.RoundToInt(AbilityTimelineEditorConfig.MaxFrameUnitLevel *
|
||||
AbilityTimelineEditorConfig.StandardFrameUnitWidth));
|
||||
|
||||
// 以鼠标为缩放中心
|
||||
// var mousePos = evt.localMousePosition.x;
|
||||
// var mouseFrame = GetFrameIndexByMouse(mousePos);
|
||||
// var mouseFramePos = mouseFrame * Config.FrameUnitWidth;
|
||||
// var deltaFrame = mouseFramePos - EditorInst.CurrentFramePos;
|
||||
// var contentWidth = contentViewPort.contentRect.width;
|
||||
// var scrollViewWidth = MainContent.worldBound.width;
|
||||
// var scrollOffsetDelta = (EditorInst.CurrentFramePos + deltaFrame * Config.FrameUnitWidth) / contentWidth *
|
||||
// scrollViewWidth;
|
||||
// MainContent.scrollOffset = new Vector2(MainContent.scrollOffset.x - scrollOffsetDelta, 0);
|
||||
|
||||
RefreshTimerDraw();
|
||||
EditorInst.TrackView.UpdateContentSize();
|
||||
}
|
||||
|
||||
private void OnTimerShaftGUI()
|
||||
{
|
||||
Handles.BeginGUI();
|
||||
Handles.color = Color.white;
|
||||
|
||||
var rect = TimerShaft.contentRect;
|
||||
var tickStep = AbilityTimelineEditorConfig.MaxFrameUnitLevel + 1 -
|
||||
Config.FrameUnitWidth / AbilityTimelineEditorConfig.StandardFrameUnitWidth;
|
||||
tickStep /= 2;
|
||||
tickStep = Mathf.Max(tickStep, 2);
|
||||
|
||||
var index = Mathf.CeilToInt(EditorInst.CurrentFramePos / Config.FrameUnitWidth);
|
||||
var startFrameOffset =
|
||||
index > 0 ? Config.FrameUnitWidth - EditorInst.CurrentFramePos % Config.FrameUnitWidth : 0;
|
||||
|
||||
var minDrawStep = AbilityTimelineEditorConfig.MinTimerShaftFrameDrawStep;
|
||||
var tooSmall = Config.FrameUnitWidth < minDrawStep;
|
||||
var drawStepFrame = tooSmall ? Mathf.CeilToInt(minDrawStep / Config.FrameUnitWidth) : 1;
|
||||
tickStep *= drawStepFrame;
|
||||
|
||||
for (var i = startFrameOffset; i <= rect.width; i += Config.FrameUnitWidth)
|
||||
{
|
||||
var isDraw = !tooSmall || index % drawStepFrame == 0;
|
||||
if (isDraw)
|
||||
{
|
||||
var isTick = index % tickStep == 0;
|
||||
var x = i;
|
||||
var startY = isTick ? rect.height * 0.5f : rect.height * 0.85f;
|
||||
var endY = rect.height;
|
||||
Handles.DrawLine(new Vector3(x, startY), new Vector3(x, endY));
|
||||
|
||||
if (isTick)
|
||||
{
|
||||
var frameStr = index.ToString();
|
||||
Handles.Label(new Vector3(x, rect.height * 0.3f), frameStr);
|
||||
}
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
Handles.EndGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5eef4c200759470f9d78578b25f638ce
|
||||
timeCreated: 1709022708
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9778b39d339623c43b5959266eec599b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 815 B |
@ -1,127 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57ce001ccda69fb42a45620a155e9f0a
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 145 B |
@ -1,127 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9779130815dc9124f8b6f8eb91b639ed
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 251 B |
@ -1,127 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92f1dbb6ded22b743a877eefd625e2e9
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 223 B |
@ -1,127 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c3a5a8bb9c5ac04cbefb66939648675
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
@ -1,127 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 275b0fae483c03b41bf38af8e22b53cb
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 2
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,31 +0,0 @@
|
||||
//
|
||||
// #if UNITY_EDITOR
|
||||
// namespace GAS.Editor
|
||||
// {
|
||||
// using Runtime;
|
||||
// using Sirenix.OdinInspector.Editor;
|
||||
// using UnityEditor;
|
||||
// using UnityEngine;
|
||||
// using GAS.General;
|
||||
//
|
||||
// [CustomEditor(typeof(TimelineAbilityAsset))]
|
||||
// public class TimelineAbilityEditorWindow : OdinEditor
|
||||
// {
|
||||
// private TimelineAbilityAsset _asset => target as TimelineAbilityAsset;
|
||||
//
|
||||
// public override void OnInspectorGUI()
|
||||
// {
|
||||
// base.OnInspectorGUI();
|
||||
//
|
||||
// EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
// if (GUILayout.Button(GASTextDefine.BUTTON_CHECK_TIMELINE_ABILITY, GUILayout.Height(30), GUILayout.Width(300))) EditAbilityTimeline();
|
||||
// EditorGUILayout.EndVertical();
|
||||
// }
|
||||
//
|
||||
// private void EditAbilityTimeline()
|
||||
// {
|
||||
// AbilityTimelineEditorWindow.ShowWindow(_asset);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// #endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 532c2163527942a1980d38f4f7b939ba
|
||||
timeCreated: 1708439991
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75b92df8baa9d394b8c750f49e1139b5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a14fb0e3c3d64a5ca183c242d3bd07f0
|
||||
timeCreated: 1709188522
|
@ -1,70 +0,0 @@
|
||||
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using System.Linq;
|
||||
using GAS.Runtime;
|
||||
|
||||
|
||||
public class TaskClip : TrackClip<TaskClipEventTrack>
|
||||
{
|
||||
private TimelineAbilityAssetBase AbilityAsset => AbilityTimelineEditorWindow.Instance.AbilityAsset;
|
||||
public TaskClipEvent TaskClipData => clipData as TaskClipEvent;
|
||||
|
||||
public TaskClipEvent ClipDataForSave
|
||||
{
|
||||
get
|
||||
{
|
||||
var cueTrackDataForSave = track.TaskClipTrackDataForSave;
|
||||
for (var i = 0; i < cueTrackDataForSave.clipEvents.Count; i++)
|
||||
if (cueTrackDataForSave.clipEvents[i] == TaskClipData)
|
||||
return track.TaskClipTrackDataForSave.clipEvents[i];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
var success = track.TaskClipTrackDataForSave.clipEvents.Remove(TaskClipData);
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
if (!success) return;
|
||||
track.RemoveTrackItem(this);
|
||||
AbilityTimelineEditorWindow.Instance.SetInspector();
|
||||
}
|
||||
|
||||
public override void RefreshShow(float newFrameUnitWidth)
|
||||
{
|
||||
base.RefreshShow(newFrameUnitWidth);
|
||||
var taskType = TaskClipData.ongoingTask.TaskData.Type;
|
||||
var shortName = taskType.Split('.').Last();
|
||||
ItemLabel.text = !string.IsNullOrEmpty(shortName) ? shortName : "Null!";
|
||||
}
|
||||
|
||||
public override void UpdateClipDataStartFrame(int newStartFrame)
|
||||
{
|
||||
var updatedClip = ClipDataForSave;
|
||||
ClipDataForSave.startFrame = newStartFrame;
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
clipData = updatedClip;
|
||||
}
|
||||
|
||||
public override void UpdateClipDataDurationFrame(int newDurationFrame)
|
||||
{
|
||||
var updatedClip = ClipDataForSave;
|
||||
ClipDataForSave.durationFrame = newDurationFrame;
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
clipData = updatedClip;
|
||||
}
|
||||
|
||||
public override void OnTickView(int frameIndex, int startFrame, int endFrame)
|
||||
{
|
||||
if (frameIndex < startFrame || frameIndex > endFrame) return;
|
||||
var ongoingAbilityTask = TaskClipData.Load();
|
||||
ongoingAbilityTask.OnEditorPreview( frameIndex, startFrame, endFrame);
|
||||
}
|
||||
|
||||
public override UnityEngine.Object DataInspector => TaskClipEditor.Create(this);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa654674f82841b0aca803e511168082
|
||||
timeCreated: 1709188590
|
@ -1,145 +0,0 @@
|
||||
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using UnityEditor;
|
||||
using Editor;
|
||||
using UnityEngine;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Sirenix.OdinInspector;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using GAS.General;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GAS.Runtime;
|
||||
|
||||
public class TaskClipEditor:OdinEditorWindow
|
||||
{
|
||||
private static IEnumerable OngoingTaskSonTypes = OngoingTaskData.OngoingTaskSonTypeChoices;
|
||||
|
||||
private static Type[] _ongoingTaskInspectorTypes;
|
||||
|
||||
public static Type[] OngoingTaskInspectorTypes =>
|
||||
_ongoingTaskInspectorTypes ??= TypeUtil.GetAllSonTypesOf(typeof(OngoingTaskInspector));
|
||||
|
||||
private static Dictionary<Type, Type> _ongoingTaskInspectorMap;
|
||||
private static Dictionary<Type, Type> OngoingTaskInspectorMap
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ongoingTaskInspectorMap != null) return _ongoingTaskInspectorMap;
|
||||
_ongoingTaskInspectorMap = new Dictionary<Type, Type>();
|
||||
foreach (var inspectorType in OngoingTaskInspectorTypes)
|
||||
{
|
||||
var taskType = inspectorType.BaseType.GetGenericArguments()[0];
|
||||
_ongoingTaskInspectorMap.Add(taskType, inspectorType);
|
||||
}
|
||||
|
||||
return _ongoingTaskInspectorMap;
|
||||
}
|
||||
}
|
||||
|
||||
private const string GRP_BOX = "GRP_BOX";
|
||||
private const string GRP_BOX_TASK = "GRP_BOX/Task";
|
||||
private TimelineAbilityAssetBase AbilityAsset => AbilityTimelineEditorWindow.Instance.AbilityAsset;
|
||||
private TaskClip _clip;
|
||||
|
||||
public static TaskClipEditor Create(TaskClip clip)
|
||||
{
|
||||
var window = new TaskClipEditor();
|
||||
window._clip = clip;
|
||||
window.Refresh();
|
||||
return window;
|
||||
}
|
||||
|
||||
[BoxGroup(GRP_BOX)]
|
||||
[HideLabel]
|
||||
[DisplayAsString(TextAlignment.Left,true)]
|
||||
public string RunInfo;
|
||||
|
||||
[Delayed]
|
||||
[BoxGroup(GRP_BOX)]
|
||||
[LabelText("Duration(f)")]
|
||||
[OnValueChanged("OnDurationFrameChanged")]
|
||||
public int Duration;
|
||||
|
||||
[Delayed]
|
||||
[BoxGroup(GRP_BOX_TASK)]
|
||||
[LabelText("OngoingTask")]
|
||||
[ValueDropdown("OngoingTaskSonTypes")]
|
||||
[InfoBox("This Task has no inspector!",InfoMessageType.Warning, "OngoingTaskIsNull")]
|
||||
[OnValueChanged("OnTaskTypeChanged")]
|
||||
public string OngoingTaskType;
|
||||
|
||||
[BoxGroup(GRP_BOX_TASK)]
|
||||
[HideReferenceObjectPicker]
|
||||
[HideIf("OngoingTaskIsNull")]
|
||||
[LabelText("Task Detail")]
|
||||
public OngoingTaskInspector OngoingTask;
|
||||
|
||||
[BoxGroup(GRP_BOX)]
|
||||
[Button]
|
||||
[GUIColor(0.9f,0.2f,0.2f)]
|
||||
void Delete()
|
||||
{
|
||||
_clip.Delete();
|
||||
}
|
||||
|
||||
void Refresh()
|
||||
{
|
||||
RunInfo = $"<b>Run(f):{_clip.TaskClipData.startFrame} -> {_clip.TaskClipData.EndFrame}</b>";
|
||||
Duration = _clip.TaskClipData.durationFrame;
|
||||
OngoingTaskType = _clip.TaskClipData.ongoingTask.TaskData.Type;
|
||||
|
||||
RefreshTaskInspector();
|
||||
}
|
||||
|
||||
void RefreshTaskInspector()
|
||||
{
|
||||
// 根据选择的OngoingAbilityTask子类,显示对应的属性
|
||||
var ongoingAbilityTask = _clip.TaskClipData.Load();
|
||||
if (OngoingTaskInspectorMap.TryGetValue(ongoingAbilityTask.GetType(), out var inspectorType))
|
||||
{
|
||||
var taskInspector = (OngoingTaskInspector)Activator.CreateInstance(inspectorType);
|
||||
taskInspector.Init(ongoingAbilityTask);
|
||||
OngoingTask = taskInspector;
|
||||
}
|
||||
else
|
||||
{
|
||||
OngoingTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDurationFrameChanged()
|
||||
{
|
||||
// 钳制
|
||||
var max = AbilityAsset.FrameCount - _clip.ClipDataForSave.startFrame;
|
||||
Duration = Mathf.Clamp(Duration, 1, max);
|
||||
_clip.UpdateClipDataDurationFrame(Duration);
|
||||
_clip.RefreshShow(_clip.FrameUnitWidth);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void OnTaskTypeChanged()
|
||||
{
|
||||
_clip.ClipDataForSave.ongoingTask.TaskData.Type = OngoingTaskType;
|
||||
_clip.ClipDataForSave.ongoingTask.TaskData.Data = null;
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
AbilityTimelineEditorWindow.Instance.TimelineInspector.RefreshInspector();
|
||||
|
||||
RefreshTaskInspector();
|
||||
}
|
||||
|
||||
bool OngoingTaskIsNull()
|
||||
{
|
||||
return OngoingTask == null;
|
||||
}
|
||||
}
|
||||
|
||||
[CustomEditor(typeof(TaskClipEditor))]
|
||||
public class TaskClipInspector:OdinEditorWithoutHeader
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cba12e6f7c134f23bfef110061a95041
|
||||
timeCreated: 1710404613
|
@ -1,97 +0,0 @@
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using GAS.Runtime;
|
||||
|
||||
public class TaskClipEventTrack:TrackBase
|
||||
{
|
||||
private TaskClipEventTrackData _taskClipEventTrackData;
|
||||
public override Type TrackDataType => typeof(TaskClipEventTrackData);
|
||||
protected override Color TrackColor => new Color(0.7f, 0.3f, 0.7f, 0.2f);
|
||||
protected override Color MenuColor => new Color(0.5f, 0.3f, 0.5f, 1);
|
||||
|
||||
private TimelineAbilityAssetBase AbilityAsset => AbilityTimelineEditorWindow.Instance.AbilityAsset;
|
||||
public TaskClipEventTrackData TaskClipTrackDataForSave
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < AbilityAsset.OngoingTasks.Count; i++)
|
||||
{
|
||||
if(AbilityAsset.OngoingTasks[i] == _taskClipEventTrackData)
|
||||
return AbilityAsset.OngoingTasks[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void TickView(int frameIndex, params object[] param)
|
||||
{
|
||||
foreach (var item in _trackItems)
|
||||
{
|
||||
var taskClip = item as TaskClip;
|
||||
taskClip.OnTickView(frameIndex, taskClip.StartFrameIndex, taskClip.EndFrameIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init(VisualElement trackParent, VisualElement menuParent, float frameWidth, TrackDataBase trackData)
|
||||
{
|
||||
base.Init(trackParent, menuParent, frameWidth, trackData);
|
||||
_taskClipEventTrackData = trackData as TaskClipEventTrackData;
|
||||
MenuText.text = _taskClipEventTrackData.trackName;
|
||||
}
|
||||
|
||||
public override void RefreshShow(float newFrameWidth)
|
||||
{
|
||||
base.RefreshShow(newFrameWidth);
|
||||
foreach (var item in _trackItems) Track.Remove(((TrackClipBase)item).ClipVe);
|
||||
_trackItems.Clear();
|
||||
|
||||
if (AbilityTimelineEditorWindow.Instance.AbilityAsset != null)
|
||||
foreach (var clipEvent in _taskClipEventTrackData.clipEvents)
|
||||
{
|
||||
var item = new TaskClip();
|
||||
item.InitTrackClip(this, Track, _frameWidth, clipEvent);
|
||||
_trackItems.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnAddTrackItem(DropdownMenuAction action)
|
||||
{
|
||||
// 添加Clip数据
|
||||
var clipEvent = new TaskClipEvent
|
||||
{
|
||||
startFrame = GetTrackIndexByMouse(action.eventInfo.localMousePosition.x),
|
||||
durationFrame = 5,
|
||||
ongoingTask = new OngoingTaskData()
|
||||
};
|
||||
TaskClipTrackDataForSave.clipEvents.Add(clipEvent);
|
||||
|
||||
// 刷新显示
|
||||
var item = new TaskClip();
|
||||
item.InitTrackClip(this, Track, _frameWidth, clipEvent);
|
||||
_trackItems.Add(item);
|
||||
|
||||
// 选中新Clip
|
||||
item.ClipVe.OnSelect();
|
||||
|
||||
Debug.Log("[EX] Add a new Custom Clip Event");
|
||||
}
|
||||
|
||||
protected override void OnRemoveTrack(DropdownMenuAction action)
|
||||
{
|
||||
// 删除数据
|
||||
AbilityAsset.OngoingTasks.Remove(_taskClipEventTrackData);
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
// 删除显示
|
||||
TrackParent.Remove(TrackRoot);
|
||||
MenuParent.Remove(MenuRoot);
|
||||
Debug.Log("[EX] Remove Task Clip Track");
|
||||
}
|
||||
|
||||
public override UnityEngine.Object DataInspector => TaskClipEventTrackEditor.Create(this);
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c984467e4d15458089c9831f5f9a55d7
|
||||
timeCreated: 1709188570
|
@ -1,60 +0,0 @@
|
||||
#if UNITY_EDITOR
|
||||
namespace GAS.Editor
|
||||
{
|
||||
using UnityEditor;
|
||||
using Editor;
|
||||
using UnityEngine;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Sirenix.OdinInspector;
|
||||
|
||||
public class TaskClipEventTrackEditor:OdinEditorWindow
|
||||
{
|
||||
private TaskClipEventTrack _track;
|
||||
|
||||
public static TaskClipEventTrackEditor Create(TaskClipEventTrack track)
|
||||
{
|
||||
var window = new TaskClipEventTrackEditor();
|
||||
window._track = track;
|
||||
window.TrackName = track.TaskClipTrackDataForSave.trackName;
|
||||
window.UpdateTrackInfo();
|
||||
return window;
|
||||
}
|
||||
|
||||
[Delayed]
|
||||
[BoxGroup]
|
||||
[LabelText("Name")]
|
||||
[OnValueChanged("OnTrackNameChanged")]
|
||||
public string TrackName;
|
||||
|
||||
[BoxGroup]
|
||||
[HideLabel]
|
||||
[DisplayAsString(TextAlignment.Left,true)]
|
||||
public string TrackInfo;
|
||||
|
||||
void UpdateTrackInfo()
|
||||
{
|
||||
string info = "";
|
||||
foreach (var clip in _track.TaskClipTrackDataForSave.clipEvents)
|
||||
{
|
||||
var taskName = clip.ongoingTask.TaskData.Type;
|
||||
var shortName = taskName.Substring(taskName.LastIndexOf('.') + 1);
|
||||
info += $"[{shortName}] Run(f):{clip.startFrame} -> {clip.EndFrame} \n";
|
||||
}
|
||||
TrackInfo = $"<b>{info}</b>";
|
||||
}
|
||||
|
||||
|
||||
void OnTrackNameChanged()
|
||||
{
|
||||
_track.TaskClipTrackDataForSave.trackName = TrackName;
|
||||
_track.MenuText.text = TrackName;
|
||||
AbilityTimelineEditorWindow.Instance.Save();
|
||||
}
|
||||
}
|
||||
|
||||
[CustomEditor(typeof(TaskClipEventTrackEditor))]
|
||||
public class TaskClipEventTrackInspector:OdinEditorWithoutHeader
|
||||
{
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6632bf9b61448918503ab3c971fb532
|
||||
timeCreated: 1710402173
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user