├── .gitignore ├── .gitmodules ├── BuffFactory ├── Editor │ ├── BuffFactoryGenerateTool.cs │ ├── BuffFactoryTemplate.cs.txt │ └── CabinIcarus.IcSkillSystem.BuffFactory.Editors.asmdef └── Runtime │ ├── BuffFactory.cs │ ├── BuffFactoryGenerateLocation.txt │ └── CabinIcarus.IcSkillSystem.BuffFactory.asmdef ├── LICENSE ├── README.md ├── ReadmeImages ├── AddBuff.png ├── Buff.png ├── Cast.png ├── ChildAndMultEditWindow.png ├── DynamicTypeSelection.png ├── ECSBuffCreateSystem.png ├── ECSBuffDestroySystem.png ├── ECSBuffSystem.png ├── ECSBuffUpdateSystem.png ├── GroupBlackboardVariable.png ├── IDamageBufff.png ├── NodeOrder.png ├── NodeOrderShow.png ├── NodeSearch.png ├── RemoveBuff.png └── UpdateBuffSystem.png ├── SkillSystem └── Scripts │ ├── Editor │ ├── Buffs │ │ └── BuffDebugWindow.cs │ ├── CabinIcarus.IcSkillSystem.Editor.asmdef │ ├── SerializationDictDrawer.cs │ ├── SimpleTypeSelectPopupWindow.cs │ ├── Utils │ │ └── TypeUtil.cs │ ├── ValueEditPopupWindow.cs │ └── ValueSDictPropertyDrawer.cs │ ├── Expansion │ ├── Editor │ │ ├── Builtin │ │ │ ├── Buffs │ │ │ │ ├── IcSkSEntityBuffDebugWindow.cs │ │ │ │ └── SkillBehaveComponentInspector.cs │ │ │ └── Entitys │ │ │ │ ├── EntityBuffInspector.cs │ │ │ │ └── EntityOdinShowID.cs │ │ └── CabinIcarus.IcSkillSystem.Expansion.Editor.asmdef │ ├── Nodes │ │ └── Runtime │ │ │ ├── Builtin │ │ │ ├── AnimatorNodes │ │ │ │ ├── AAnimatorNode.cs │ │ │ │ ├── AAnimatorSetXXXNode.cs │ │ │ │ ├── AnimationBoolNode.cs │ │ │ │ ├── AnimationBoolNode.cs.meta │ │ │ │ ├── AnimatorResetTriggerNode.cs │ │ │ │ ├── AnimatorResetTriggerNode.cs.meta │ │ │ │ ├── AnimatorTriggerNode.cs │ │ │ │ ├── AnimatorTriggerNode.cs.meta │ │ │ │ ├── PauseAnimatorWait.cs │ │ │ │ └── PauseAnimatorWait.cs.meta │ │ │ ├── CameraNodes │ │ │ │ ├── AGetCameraNode.cs │ │ │ │ ├── GetCurrentCameraNode.cs │ │ │ │ ├── GetCurrentCameraNode.cs.meta │ │ │ │ ├── GetMainCameraNode.cs │ │ │ │ └── GetMainCameraNode.cs.meta │ │ │ ├── CreteGoNodes │ │ │ │ ├── ACreateGoNode.cs │ │ │ │ ├── PositionCreateGoNode.cs │ │ │ │ └── PositionCreateGoNode.cs.meta │ │ │ ├── DestroyNode.cs │ │ │ ├── DestroyNode.cs.meta │ │ │ ├── ForExecuteActionNode.cs │ │ │ ├── ForExecuteActionNode.cs.meta │ │ │ ├── MoveNodes │ │ │ │ ├── AMoveNode.cs │ │ │ │ ├── AddForceNode.cs │ │ │ │ ├── AddForceNode.cs.meta │ │ │ │ ├── SetPositionNode.cs │ │ │ │ ├── SetPositionNode.cs.meta │ │ │ │ ├── TranslateNode.cs │ │ │ │ └── TranslateNode.cs.meta │ │ │ ├── PhysicNodes │ │ │ │ ├── ACast3DColliderNode.cs │ │ │ │ ├── ACastNode.cs │ │ │ │ ├── ACastRaycastHit3DNode.cs │ │ │ │ ├── ACastRaycastHitNode.cs │ │ │ │ ├── OverlapSphereNode.cs │ │ │ │ └── OverlapSphereNode.cs.meta │ │ │ ├── PlayAudioNodes │ │ │ │ ├── APlayAudioNode.cs │ │ │ │ ├── SelfPlayAudioNode.cs │ │ │ │ └── SelfPlayAudioNode.cs.meta │ │ │ ├── UnitySendMessageNodes │ │ │ │ ├── AUnitySendMessageNode.cs │ │ │ │ ├── ComponentSendMessageNode.cs │ │ │ │ ├── ComponentSendMessageNode.cs.meta │ │ │ │ ├── OwnerSendMessageNode.cs │ │ │ │ ├── OwnerSendMessageNode.cs.meta │ │ │ │ ├── TargetSendMessageNode.cs │ │ │ │ └── TargetSendMessageNode.cs.meta │ │ │ └── ValueNodes │ │ │ │ ├── EulerToQuaternionNode.cs │ │ │ │ ├── EulerToQuaternionNode.cs.meta │ │ │ │ ├── GetActionTaskActionNode.cs │ │ │ │ ├── GetActionTaskActionNode.cs.meta │ │ │ │ ├── GetComponentValueNodes │ │ │ │ ├── ComponentGetComponentValueNode.cs │ │ │ │ ├── ComponentGetComponentValueNode.cs.meta │ │ │ │ ├── GetComponentValueNode.cs │ │ │ │ └── GetComponentValueNode.cs.meta │ │ │ │ ├── GetGoValueNode.cs │ │ │ │ ├── GetGoValueNode.cs.meta │ │ │ │ ├── GetTargetEuler.cs │ │ │ │ ├── GetTargetEuler.cs.meta │ │ │ │ ├── GetTargetForward.cs │ │ │ │ ├── GetTargetForward.cs.meta │ │ │ │ ├── GetTargetPosition.cs │ │ │ │ ├── GetTargetPosition.cs.meta │ │ │ │ ├── LayerMaskValueNode.cs │ │ │ │ ├── LayerMaskValueNode.cs.meta │ │ │ │ ├── OwnerToBuffEntityValueNode.cs │ │ │ │ └── OwnerToBuffEntityValueNode.cs.meta │ │ │ └── CabinIcarus.IcSkillSystem.Expansion.Nodes.Runtime.asmdef │ ├── Runtime │ │ ├── Builtin │ │ │ ├── Buffs │ │ │ │ ├── Components │ │ │ │ │ ├── Base │ │ │ │ │ │ ├── IBuffDescriptionComponent.cs │ │ │ │ │ │ ├── IBuffLevelComponent.cs │ │ │ │ │ │ ├── IBuffTimeDataComponent.cs │ │ │ │ │ │ ├── IBuffTriggerTime.cs │ │ │ │ │ │ ├── IBuffType.cs │ │ │ │ │ │ ├── IBuffValueDataComponent.cs │ │ │ │ │ │ └── ILifesteal.cs │ │ │ │ │ ├── Buffs │ │ │ │ │ │ ├── Damage.cs │ │ │ │ │ │ ├── Death.cs │ │ │ │ │ │ └── Mechanics.cs │ │ │ │ │ ├── IAttributeBuff.cs │ │ │ │ │ ├── IContinuousDamageBuff.cs │ │ │ │ │ ├── IDamageBuff.cs │ │ │ │ │ ├── IDamageReduceFixedBuff.cs │ │ │ │ │ ├── IDamageReducePercentageBuff.cs │ │ │ │ │ ├── IFixedLifesteal.cs │ │ │ │ │ ├── IMakerEntity.cs │ │ │ │ │ ├── IMechanicBuff.cs │ │ │ │ │ └── IPercentageLifesteal.cs │ │ │ │ ├── Exceptions │ │ │ │ │ └── TypeErrorException.cs │ │ │ │ ├── Manager │ │ │ │ │ ├── BuffManager_Struct.cs │ │ │ │ │ └── QueryResult.cs │ │ │ │ └── Systems │ │ │ │ │ ├── Base │ │ │ │ │ ├── IStructButtCreateSystem.cs │ │ │ │ │ └── IStructButtSystem.cs │ │ │ │ │ ├── BuffTimeSystem.cs │ │ │ │ │ ├── ContinuousDamageSystem.cs │ │ │ │ │ ├── DamageReduceFixedSystem.cs │ │ │ │ │ ├── DamageReducePercentageSystem.cs │ │ │ │ │ ├── DamageSystem.cs │ │ │ │ │ ├── LifestealFixedSystem.cs │ │ │ │ │ └── LifestealPercentageSystem.cs │ │ │ ├── Entitys │ │ │ │ └── IcSkSEntityManager.cs │ │ │ ├── Skills │ │ │ │ ├── Component │ │ │ │ │ └── SkillBehaveComponent.cs │ │ │ │ ├── Condition │ │ │ │ │ └── ManaCheck.cs │ │ │ │ └── Manager │ │ │ │ │ └── SkillManager.cs │ │ │ ├── Unity │ │ │ │ ├── BuffEntityLinkComponent.cs │ │ │ │ └── SelfBlackBoardComponent.cs │ │ │ └── Utils │ │ │ │ └── ReferenceObjectPool.cs │ │ └── CabinIcarus.IcSkillSystem.Expansion.Runtime.asmdef │ └── Test │ │ ├── BuffManagerTestMonoBehaviour.cs │ │ ├── CabinIcarus.IcSkillSystem.Expansion.Tests.asmdef │ │ └── NewBuffManagerTest.cs │ └── Runtime │ ├── Buffs │ ├── Components │ │ └── IBuffDataComponent.cs │ ├── Manager │ │ └── IBuffManager.cs │ └── Systems │ │ ├── AIcStructBuffSystem.cs │ │ └── Interfaces │ │ ├── IBuffCreateSystem.cs │ │ ├── IBuffDestroySystem.cs │ │ ├── IBuffSystem.cs │ │ └── IBuffUpdateSystem.cs │ ├── CabinIcarus.IcSkillSystem.Runtime.asmdef │ ├── Entitys │ ├── IIcSkSEntity.cs │ ├── IIcSkSEntityManager.cs │ └── IcEntityStruct.cs │ ├── Skills │ ├── Com │ │ └── ISkillFilter.cs │ ├── Components │ │ └── ISkillDataComponent.cs │ ├── Condition │ │ ├── ACondition.cs │ │ └── ICondition.cs │ ├── Manager │ │ └── ISkillManager.cs │ └── Systems │ │ └── ISkillExecuteSystem.cs │ ├── Systems │ └── ISkillSystem.cs │ └── Utils │ ├── DataStructures │ ├── ECSResources.cs │ ├── FasterDictionary.cs │ ├── FasterList.cs │ ├── HashHelpers.cs │ ├── ReadOnlyCollectionStruct.cs │ ├── SerializationDict.cs │ ├── StringECSDB.cs │ ├── ThreadSafeDictionary.cs │ └── ValueS.cs │ ├── IcCheck.cs │ ├── SerializationUtil.cs │ └── TypeManager.cs ├── Utf8Json ├── Attributes.cs ├── Formatters │ ├── AnonymousFormatter.cs │ ├── CollectionFormatters.cs │ ├── DateTimeFormatter.cs │ ├── DictionaryFormatter.cs │ ├── DynamicObjectTypeFallbackFormatter.cs │ ├── EnumFormatter.cs │ ├── IgnoreFormatter.cs │ ├── MultiDimentionalArrayFormatter.cs │ ├── NullableFormatter.cs │ ├── PrimitiveFormatter.cs │ ├── PrimitiveObjectFormatter.cs │ ├── StandardClassLibraryFormatters.cs │ ├── TupleFormatter.cs │ └── ValueTupleFormatter.cs ├── IJsonFormatter.cs ├── IJsonFormatterResolver.cs ├── Internal │ ├── ArrayBuffer.cs │ ├── ArrayPool.cs │ ├── AutomataDictionary.cs │ ├── BinaryUtil.cs │ ├── ByteArrayComparer.cs │ ├── ByteArrayStringHashTable.cs │ ├── DoubleConversion │ │ ├── DiyFp.cs │ │ ├── DoubleToStringConverter.cs │ │ ├── IEEE.cs │ │ ├── PowersOfTenCache.cs │ │ ├── StringToDouble.cs │ │ └── StringToDoubleConverter.cs │ ├── Emit │ │ ├── DynamicAssembly.cs │ │ ├── ExpressionUtility.cs │ │ ├── ILGeneratorExtensions.cs │ │ ├── ILViewer.cs │ │ ├── MetaMember.cs │ │ └── MetaType.cs │ ├── FarmHash.cs │ ├── FuncExtensions.cs │ ├── GuidBits.cs │ ├── NumberConverter.cs │ ├── ReflectionExtensions.cs │ ├── StringEncoding.cs │ ├── StringMutator.cs │ ├── ThreadsafeTypeKeyHashTable.cs │ ├── UnsafeMemory.Low.cs │ └── UnsafeMemory.cs ├── JsonReader.cs ├── JsonSerializer.NonGeneric.cs ├── JsonSerializer.cs ├── JsonToken.cs ├── JsonWriter.cs ├── Resolvers │ ├── AttributeFormatterResolver.cs │ ├── BuiltinResolver.cs │ ├── CompositeResolver.cs │ ├── DynamicGenericResolver.cs │ ├── DynamicObjectResolver.cs │ ├── EnumResolver.cs │ └── StandardResolver.cs ├── Shims │ └── Reflection.cs ├── Unity │ └── ResolverAndFormatters.cs └── Utf8Json.asmdef └── xNode_IcSkill ├── Base ├── ANPBehaveNode.cs ├── ANPNode.cs ├── ASkillSNode.cs ├── Attributes │ ├── APortTooltipAttribute.cs │ ├── PortTooltipAttribute.cs │ └── PortTooltipMethodOrPropertyGetAttribute.cs ├── CabinIcarus.IcSkillSystem.xNodeIc.Base.asmdef ├── ChildGroupNode.cs ├── ChildGroupNode.cs.meta ├── GetChildGroupNode.cs ├── GetChildGroupNode.cs.meta ├── IIcSkillSystemNode.cs ├── IOutPutName.cs ├── IcSkillGroup.cs ├── IcSkillGroup.cs.meta ├── Nodes │ ├── Composite │ │ └── ACompositeNode.cs │ ├── Decorator │ │ ├── ABlackboardQueryNode.cs │ │ ├── AConditionNode.cs │ │ ├── ADecoratorNode.cs │ │ ├── AObserverNode.cs │ │ ├── AObservingDecoratorNode.cs │ │ ├── AServiceNode.cs │ │ └── AWaitForConditionNode.cs │ └── Task │ │ ├── AWaitNode_GetSecondsNode.cs │ │ └── Action │ │ ├── AActionNode.cs │ │ └── AMultiFrameActionNode.cs ├── RootNode.cs ├── RootNode.cs.meta └── ValueNode.cs ├── Editor ├── CabinIcarus.IcSkillSystem.xNodeIc.Editor.asmdef ├── xNode_Group │ ├── IcSkillGroupEditor.cs │ └── IcSkillGroupInspector.cs ├── xNode_NPBehave_Node │ ├── ABuffNodeEditor.cs │ ├── ANPBehaveNodeEditor.cs │ ├── ANPNodeEditor.cs │ ├── AQNameSelectEditor.cs │ ├── AUseSkillNodeEidotr.cs │ ├── ChildGroupNodeEditor.cs │ ├── GetChildGroupNodeEditor.cs │ ├── Nodes │ │ └── NPBehaveNodeEditors.cs │ ├── RootNodeEditor.cs │ ├── SkillConditionNodeEditor.cs │ └── Utils │ │ ├── GUIUtil.cs │ │ └── NodeEx.cs └── xNode_Nodes │ ├── SerializableTypeCodeGenerate.cs │ ├── Template │ └── ValueNodeTemplate.cs.txt │ └── ValueNodeEditor.cs └── Runtime ├── CabinIcarus.IcSkillSystem.xNodeIc.asmdef └── xNode_NPBehave_Node ├── Blackboard ├── BlackboardNode.cs ├── BlackboardNode.cs.meta ├── CreateBlackboardNode.cs ├── CreateBlackboardNode.cs.meta ├── CreateBlackboardParentNode.cs ├── CreateBlackboardParentNode.cs.meta ├── GetBlackboardValue.cs ├── GetBlackboardValue.cs.meta ├── GetOwnerBlackboardNode.cs ├── GetOwnerBlackboardNode.cs.meta ├── SetBlackBoardValueActionNode.cs ├── SetBlackBoardValueActionNode.cs.meta ├── SharedBlackboardNode.cs └── SharedBlackboardNode.cs.meta ├── Clock ├── ClockNode.cs ├── ClockNode.cs.meta ├── CreateClockNode.cs ├── CreateClockNode.cs.meta ├── UnityContextClockNode.cs └── UnityContextClockNode.cs.meta ├── Nodes ├── Composite │ ├── ParallelNode.cs │ ├── ParallelNode.cs.meta │ ├── RandomSelectorNode.cs │ ├── RandomSelectorNode.cs.meta │ ├── RandomSequenceNode.cs │ ├── RandomSequenceNode.cs.meta │ ├── SelectorNode.cs │ ├── SelectorNode.cs.meta │ ├── SequenceNode.cs │ └── SequenceNode.cs.meta ├── Decorator │ ├── BlackboardConditionNode.cs │ ├── BlackboardConditionNode.cs.meta │ ├── CooldownNode.cs │ ├── CooldownNode.cs.meta │ ├── FailerNode.cs │ ├── FailerNode.cs.meta │ ├── InverterNode.cs │ ├── InverterNode.cs.meta │ ├── ObserverNode.cs │ ├── ObserverNode.cs.meta │ ├── RandomNode.cs │ ├── RandomNode.cs.meta │ ├── RepeaterNode.cs │ ├── RepeaterNode.cs.meta │ ├── SucceederNode.cs │ ├── SucceederNode.cs.meta │ ├── TimeMaxNode.cs │ ├── TimeMaxNode.cs.meta │ ├── TimeMinNode.cs │ ├── TimeMinNode.cs.meta │ ├── ValueEqualsConditionNode.cs │ └── ValueEqualsConditionNode.cs.meta ├── SkillSystem │ ├── Buff │ │ ├── ABuffNode.cs │ │ ├── ABuffNode.cs.meta │ │ ├── AddOrRemoveBuffNode.cs │ │ ├── AddOrRemoveBuffNode.cs.meta │ │ ├── HasBuffConditionNode.cs │ │ └── HasBuffConditionNode.cs.meta │ ├── Condition │ │ ├── SkillConditionNode.cs │ │ └── SkillConditionNode.cs.meta │ └── UseSkill │ │ ├── AUseSkillNode.cs │ │ ├── UseSkillNodeNodeAction.cs │ │ └── UseSkillNodeNodeAction.cs.meta └── Task │ ├── Actions │ ├── ActionNode.cs │ ├── ActionNode.cs.meta │ ├── RootAction.cs │ └── RootAction.cs.meta │ ├── Debug │ ├── DebugActionNode.cs │ └── DebugActionNode.cs.meta │ └── Waits │ ├── WaitConditionNode.cs │ ├── WaitConditionNode.cs.meta │ ├── WaitNode_BlackboardGetSeconds.cs │ ├── WaitNode_BlackboardGetSeconds.cs.meta │ ├── WaitNode_Seconds.cs │ ├── WaitNode_Seconds.cs.meta │ ├── WaitNode_SecondsAndRandomVariance.cs │ ├── WaitNode_SecondsAndRandomVariance.cs.meta │ ├── WaitUntilStoppedNode.cs │ └── WaitUntilStoppedNode.cs.meta └── Utils └── xNodeExpansion.cs /.gitignore: -------------------------------------------------------------------------------- 1 | *.meta 2 | /UnityEditorFrame 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "NPBehave"] 2 | path = NPBehave 3 | url = https://github.com/yika-aixi/NPBehave.git 4 | [submodule "xNode"] 5 | path = xNode 6 | url = https://github.com/yika-aixi/xNode.git 7 | branch = Cabin_Icarus 8 | -------------------------------------------------------------------------------- /BuffFactory/Editor/BuffFactoryGenerateTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using UnityEditor; 5 | using UnityEditor.Compilation; 6 | using UnityEditorInternal; 7 | using UnityEngine; 8 | 9 | namespace CabinIcarus.IcSkillSystem.BuffFactory.Tool 10 | { 11 | public class BuffFactoryGenerateTool : UnityEditor.EditorWindow 12 | { 13 | [UnityEditor.MenuItem("Icarus/Skill System/Buff Factory Generate Tool")] 14 | private static void ShowWindow() 15 | { 16 | var window = GetWindow(); 17 | window.titleContent = new UnityEngine.GUIContent("Buff Factory Generate Tool"); 18 | window.Show(); 19 | } 20 | 21 | private string[] _codeLines; 22 | 23 | private List _usings; 24 | 25 | private List _switchs; 26 | 27 | private string _savePath; 28 | 29 | private void OnEnable() 30 | { 31 | var location = AssetDatabase.LoadAssetAtPath("BuffFactoryGenerateLocation"); 32 | _savePath = AssetDatabase.GetAssetPath(location); 33 | 34 | if (!string.IsNullOrWhiteSpace(_savePath)) 35 | { 36 | _savePath = Path.GetDirectoryName(_savePath); 37 | } 38 | 39 | var assembly = CompilationPipeline.GetAssemblies(AssembliesType.Player); 40 | // importer. 41 | } 42 | 43 | private void OnGUI() 44 | { 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /BuffFactory/Editor/BuffFactoryTemplate.cs.txt: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 3 | 4 | //### Using 5 | 6 | //### 7 | 8 | namespace CabinIcarus.IcSkillSystem.BuffFactory 9 | { 10 | public static class BuffFactory 11 | { 12 | public static void AddBuff(IIcSkSEntityManager entityManager, IIcSkSEntity entity, 13 | IBuffDataComponent buff) 14 | { 15 | AddBuff(entityManager, entity, buff); 16 | } 17 | 18 | public static void AddBuff(IIcSkSEntityManager entityManager, TE entity, 19 | IBuffDataComponent buff) where TE : IIcSkSEntity 20 | { 21 | if (entityManager is IStructIcSkSEntityManager structIcSkSEntityManager) 22 | { 23 | //### Switch 24 | 25 | //### 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /BuffFactory/Editor/CabinIcarus.IcSkillSystem.BuffFactory.Editors.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.BuffFactory.Editors", 3 | "references": [], 4 | "includePlatforms": [ 5 | "Editor" 6 | ], 7 | "excludePlatforms": [], 8 | "allowUnsafeCode": false, 9 | "overrideReferences": false, 10 | "precompiledReferences": [], 11 | "autoReferenced": true, 12 | "defineConstraints": [], 13 | "versionDefines": [], 14 | "noEngineReferences": false 15 | } -------------------------------------------------------------------------------- /BuffFactory/Runtime/BuffFactoryGenerateLocation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/BuffFactory/Runtime/BuffFactoryGenerateLocation.txt -------------------------------------------------------------------------------- /BuffFactory/Runtime/CabinIcarus.IcSkillSystem.BuffFactory.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.BuffFactory", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Expansion.Runtime", 5 | "CabinIcarus.IcSkillSystem.Runtime" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015 Baste Nesse Buanes 4 | Copyright (c) 2019 Levin Gäher 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SkillSystem 2 | 3 | [0.6 last Video](https://www.bilibili.com/video/av76312353) 4 | 5 | [Trello](https://trello.com/b/DF5JWisg/ic-skill-system) 6 | 7 | Example Unity Version:2019.2+ 8 | 9 | Behave Tree Create Editor 10 | 11 | Add a new buffManager, the buff needs to be a structure 12 | 13 | #### ECS Buff System 14 | 15 | ##### Create Buff 16 | 17 | Implement `IBuffDataComponent` 18 | 19 | ![](ReadmeImages/IDamageBufff.png) 20 | 21 | ![](ReadmeImages/Buff.png) 22 | 23 | ##### Buff System 24 | 25 | Create System Implement `IBuffCreateSystem` 26 | 27 | ![Create](ReadmeImages/ECSBuffCreateSystem.png) 28 | 29 | Update System Implement `IBuffUpdateSystem` 30 | 31 | ![Update](ReadmeImages/ECSBuffUpdateSystem.png) 32 | 33 | Destroy System Implement `IBuffDestroySystem` 34 | 35 | ![Destroy](ReadmeImages/ECSBuffDestroySystem.png) 36 | 37 | 38 | ##### Buff System 39 | 40 | Add Buff System 41 | 42 | ```c# 43 | 44 | BuffManager_Struct BuffManager = new BuffManager_Struct(); 45 | 46 | BuffManager.AddBuffSystem(new BuffSystem()) 47 | ``` 48 | 49 | need Implement custom BuffManager, Implement `IBuffManager` 50 | 51 | ![Update Buff System](ReadmeImages/UpdateBuffSystem.png) 52 | 53 | ![Add Buff System](ReadmeImages/ECSBuffSystem.png) 54 | 55 | Add Buff 56 | 57 | ![Add Buff](ReadmeImages/AddBuff.png) 58 | 59 | Remove Buff 60 | 61 | ![Remove Buff](ReadmeImages/RemoveBuff.png) 62 | 63 | ###Skill Group 64 | 65 | Cast Node And For Execute Action Node 66 | 67 | ![Cast](ReadmeImages/Cast.png) 68 | 69 | Child Group And Multi Group Editor Support 70 | 71 | ![ChildAndMultEditWindow](ReadmeImages/ChildAndMultEditWindow.png) 72 | 73 | Dynamic Type Select Support 74 | 75 | ![Remove](ReadmeImages/DynamicTypeSelection.png) 76 | 77 | Node Search Support 78 | 79 | ![Remove](ReadmeImages/NodeSearch.png) 80 | 81 | Node Order 82 | 83 | ![Remove](ReadmeImages/NodeOrder.png) 84 | 85 | Node Order Show 86 | 87 | ![Remove](ReadmeImages/NodeOrderShow.png) 88 | 89 | Skill Group Blackboard Variable Support 90 | 91 | ![Remove](ReadmeImages/GroupBlackboardVariable.png) 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /ReadmeImages/AddBuff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/AddBuff.png -------------------------------------------------------------------------------- /ReadmeImages/Buff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/Buff.png -------------------------------------------------------------------------------- /ReadmeImages/Cast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/Cast.png -------------------------------------------------------------------------------- /ReadmeImages/ChildAndMultEditWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/ChildAndMultEditWindow.png -------------------------------------------------------------------------------- /ReadmeImages/DynamicTypeSelection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/DynamicTypeSelection.png -------------------------------------------------------------------------------- /ReadmeImages/ECSBuffCreateSystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/ECSBuffCreateSystem.png -------------------------------------------------------------------------------- /ReadmeImages/ECSBuffDestroySystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/ECSBuffDestroySystem.png -------------------------------------------------------------------------------- /ReadmeImages/ECSBuffSystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/ECSBuffSystem.png -------------------------------------------------------------------------------- /ReadmeImages/ECSBuffUpdateSystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/ECSBuffUpdateSystem.png -------------------------------------------------------------------------------- /ReadmeImages/GroupBlackboardVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/GroupBlackboardVariable.png -------------------------------------------------------------------------------- /ReadmeImages/IDamageBufff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/IDamageBufff.png -------------------------------------------------------------------------------- /ReadmeImages/NodeOrder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/NodeOrder.png -------------------------------------------------------------------------------- /ReadmeImages/NodeOrderShow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/NodeOrderShow.png -------------------------------------------------------------------------------- /ReadmeImages/NodeSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/NodeSearch.png -------------------------------------------------------------------------------- /ReadmeImages/RemoveBuff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/RemoveBuff.png -------------------------------------------------------------------------------- /ReadmeImages/UpdateBuffSystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yika-aixi/IcSkillSystem/d380498cedc9d45eb390c2034d76e152e081a02a/ReadmeImages/UpdateBuffSystem.png -------------------------------------------------------------------------------- /SkillSystem/Scripts/Editor/Buffs/BuffDebugWindow.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using EditorGUI = UnityEditor.EditorGUI; 8 | using EditorGUILayout = UnityEditor.EditorGUILayout; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Editor 11 | { 12 | public class BuffDebugWindow : EditorWindow 13 | { 14 | public static IBuffManager EntityManager; 15 | 16 | [UnityEditor.MenuItem("Icarus/Analysis/IIcSkSEntity Buff")] 17 | private static void ShowWindow() 18 | { 19 | var window = GetWindow(); 20 | 21 | window.titleContent = new UnityEngine.GUIContent("Buff Analysis"); 22 | window.Show(); 23 | } 24 | 25 | private Vector2 _pos; 26 | private void OnGUI() 27 | { 28 | if (EntityManager == null) 29 | { 30 | EditorGUILayout.HelpBox("please set EntityManager -> BuffDebugWindow.EntityManager", 31 | MessageType.Warning); 32 | return; 33 | } 34 | 35 | var entitys = EntityManager.Entitys; 36 | 37 | EditorGUILayout.LabelField("Entity count:" + entitys.Count); 38 | 39 | EditorGUI.indentLevel++; 40 | _pos = EditorGUILayout.BeginScrollView(_pos,"box"); 41 | { 42 | foreach (var entity in entitys) 43 | { 44 | EditorGUILayout.LabelField($"{entity} Buff Count:" + 45 | EntityManager.GetAllBuff(entity).Count()); 46 | } 47 | } 48 | EditorGUILayout.EndScrollView(); 49 | EditorGUI.indentLevel--; 50 | 51 | Repaint(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Editor/CabinIcarus.IcSkillSystem.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Editor", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [] 16 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Editor/Builtin/Buffs/IcSkSEntityBuffDebugWindow.cs: -------------------------------------------------------------------------------- 1 | ////创建者:Icarus 2 | ////手动滑稽,滑稽脸 3 | ////ヾ(•ω•`)o 4 | ////https://www.ykls.app 5 | ////2019年10月16日-01:45 6 | ////CabinIcarus.IcSkillSystem.Expansion.Editor 7 | // 8 | //using CabinIcarus.IcSkillSystem.Editor; 9 | //using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 10 | // 11 | //namespace CabinIcarus.IcSkillSystem.Expansion.Editors.Builtin.Buffs 12 | //{ 13 | // public class IcSkSEntityBuffDebugWindow:ABuffDebugWindow 14 | // { 15 | // [UnityEditor.MenuItem("Icarus/Analysis/IIcSkSEntity Buff")] 16 | // private static void ShowWindow() 17 | // { 18 | // var window = GetWindow(); 19 | // 20 | // window.titleContent = new UnityEngine.GUIContent("Buff Analysis"); 21 | // window.Show(); 22 | // } 23 | // } 24 | //} -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Editor/Builtin/Entitys/EntityOdinShowID.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年10月27日-23:19 6 | //CabinIcarus.IcSkillSystem.Expansion.Editor 7 | 8 | 9 | #if ODIN_INSPECTOR 10 | using System; 11 | using System.Reflection; 12 | using System.Linq; 13 | using Sirenix.OdinInspector; 14 | using System.Collections.Generic; 15 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 16 | using Sirenix.OdinInspector.Editor; 17 | using UnityEngine; 18 | 19 | namespace CabinIcarus.IcSkillSystem.Expansion.Editors.Builtin.Entitys 20 | { 21 | public class EntityOdinShowID:OdinAttributeProcessor where T : IIcSkSEntity 22 | { 23 | public override void ProcessChildMemberAttributes( 24 | InspectorProperty parentProperty, 25 | MemberInfo member, 26 | List attributes) 27 | { 28 | if (member.Name == nameof(IIcSkSEntity.ID)) 29 | { 30 | // var label = parentProperty.Attributes.FirstOrDefault(x => x.GetType() == typeof(LabelTextAttribute)); 31 | 32 | attributes.Add(new ShowInInspectorAttribute()); 33 | 34 | // if (label != null) 35 | // { 36 | // attributes.Add(label); 37 | // } 38 | } 39 | 40 | } 41 | } 42 | 43 | public class IcEntityOdingShowID : EntityOdinShowID 44 | { 45 | } 46 | } 47 | #endif -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Editor/CabinIcarus.IcSkillSystem.Expansion.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Expansion.Editor", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Expansion.Runtime", 5 | "CabinIcarus.IcSkillSystem.Runtime", 6 | "CabinIcarus.IcSkillSystem.Editor", 7 | "CabinIcarus.IcSkillSystem.xNodeIc.Base", 8 | "XNode" 9 | ], 10 | "includePlatforms": [ 11 | "Editor" 12 | ], 13 | "excludePlatforms": [], 14 | "allowUnsafeCode": false, 15 | "overrideReferences": false, 16 | "precompiledReferences": [], 17 | "autoReferenced": true, 18 | "defineConstraints": [], 19 | "versionDefines": [], 20 | "noEngineReferences": false 21 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AAnimatorNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-22:06 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 9 | using NPBehave; 10 | using UnityEngine; 11 | using Action = NPBehave.Action; 12 | 13 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 14 | { 15 | public abstract class AAnimatorNode:ANPBehaveNode 16 | { 17 | protected Animator Anim { get; private set; } 18 | 19 | protected override Task GetOutValue() 20 | { 21 | Anim = SkillGroup.Owner.GetComponent(); 22 | 23 | return CreateAction(); 24 | } 25 | 26 | protected abstract Task CreateAction(); 27 | } 28 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AAnimatorSetXXXNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月18日-20:59 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using NPBehave; 9 | using UnityEngine; 10 | using Node = XNode.Node; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 13 | { 14 | public abstract class AAnimatorSetXXXNode:AAnimatorNode 15 | { 16 | //todo 需要editor 进行对应的显示/隐藏 17 | [Node.InputAttribute(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 18 | [SerializeField] 19 | private bool _useHash; 20 | 21 | [Node.InputAttribute(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 22 | [SerializeField] 23 | private string _name; 24 | 25 | [Node.InputAttribute(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 26 | [SerializeField] 27 | private int _hash; 28 | 29 | protected bool UseHash => GetInputValue(nameof(_useHash),_useHash); 30 | 31 | protected string Name => GetInputValue(nameof(_name), _name); 32 | 33 | protected int Hash => GetInputValue(nameof(_hash), _hash); 34 | 35 | protected override Task CreateAction() 36 | { 37 | return new Action(_setXxx); 38 | } 39 | 40 | private void _setXxx() 41 | { 42 | if (UseHash) 43 | { 44 | HashMode(Hash); 45 | } 46 | else 47 | { 48 | NameMode(); 49 | } 50 | } 51 | 52 | protected abstract void NameMode(); 53 | 54 | protected abstract void HashMode(in int hash); 55 | } 56 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimationBoolNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月18日-21:03 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using UnityEngine; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 11 | { 12 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Animator/Bool")] 13 | public class AnimationBoolNode:AAnimatorSetXXXNode 14 | { 15 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 16 | private bool _value; 17 | 18 | protected override void NameMode() 19 | { 20 | Anim.SetBool(Name,GetInputValue(nameof(_value),_value)); 21 | } 22 | 23 | protected override void HashMode(in int hash) 24 | { 25 | Anim.SetBool(hash,GetInputValue(nameof(_value),_value)); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimationBoolNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1720ae79fea581944ae614c0902dcd02 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimatorResetTriggerNode.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 2 | { 3 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Animator/Reset Trigger")] 4 | public class AnimatorResetTriggerNode:AAnimatorSetXXXNode 5 | { 6 | protected override void NameMode() 7 | { 8 | Anim.ResetTrigger(Name); 9 | } 10 | 11 | protected override void HashMode(in int hash) 12 | { 13 | Anim.ResetTrigger(hash); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimatorResetTriggerNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd873db7ce5394949bb0b68d9063790f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimatorTriggerNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-22:09 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 9 | { 10 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Animator/Trigger")] 11 | public class AnimatorTriggerNode:AAnimatorSetXXXNode 12 | { 13 | protected override void NameMode() 14 | { 15 | Anim.SetTrigger(Name); 16 | } 17 | 18 | protected override void HashMode(in int hash) 19 | { 20 | Anim.SetTrigger(hash); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/AnimatorTriggerNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d8824ce58b87b7428ef5d6f20984f82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/PauseAnimatorWait.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月19日-21:21 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 9 | using NPBehave; 10 | using UnityEngine; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 13 | { 14 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Animator/Pause Second")] 15 | public class PauseAnimatorWait:AAnimatorNode 16 | { 17 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 18 | [PortTooltip("Pause time (Second)")] 19 | private float _time; 20 | 21 | protected override Task CreateAction() 22 | { 23 | var wait = new Wait(_getSecond); 24 | wait.OnStart = _stop; 25 | wait.OnComplete = _play; 26 | wait.OnStop = _play; 27 | 28 | return wait; 29 | } 30 | 31 | private float _getSecond() 32 | { 33 | return GetInputValue(nameof(_time), _time); 34 | } 35 | 36 | private void _stop() 37 | { 38 | Anim.enabled = false; 39 | } 40 | 41 | private void _play() 42 | { 43 | Anim.enabled = true; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/AnimatorNodes/PauseAnimatorWait.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08fff448ed7c7164fa414ff4e533a035 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CameraNodes/AGetCameraNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using NPBehave; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | public abstract class AGetCameraNode : ANPBehaveNode 9 | { 10 | [Output] 11 | [PortTooltipMethodOrPropertyGet(nameof(GetCameraTooltip))] 12 | protected Camera Camera; 13 | 14 | protected sealed override Action GetOutValue() 15 | { 16 | return new Action(_getMainCamera); 17 | } 18 | 19 | private void _getMainCamera() 20 | { 21 | if (!Camera) 22 | { 23 | Camera = GetCamera(); 24 | } 25 | } 26 | 27 | protected abstract Camera GetCamera(); 28 | 29 | protected virtual string GetCameraTooltip() 30 | { 31 | return "Camera"; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CameraNodes/GetCurrentCameraNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Camera/Get/Current")] 6 | public class GetCurrentCameraNode:AGetCameraNode 7 | { 8 | protected override Camera GetCamera() 9 | { 10 | return Camera.current; 11 | } 12 | 13 | protected override string GetCameraTooltip() 14 | { 15 | return Camera ? $"Current Camera: {Camera.name}" : "Current Camera"; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CameraNodes/GetCurrentCameraNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b06ef25451201b446970696c55796507 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CameraNodes/GetMainCameraNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Camera/Get/Main")] 6 | public class GetMainCameraNode : AGetCameraNode 7 | { 8 | protected override Camera GetCamera() 9 | { 10 | return Camera.main; 11 | } 12 | 13 | protected override string GetCameraTooltip() 14 | { 15 | return Camera ? $"Main Camera: {Camera.name}" : "Main Camera"; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CameraNodes/GetMainCameraNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a26de5874da4ac745bb2c35a162ac9b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CreteGoNodes/ACreateGoNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-21:55 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 9 | using NPBehave; 10 | using UnityEngine; 11 | using XNode; 12 | 13 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 14 | { 15 | public abstract class ACreateGoNode:ANPBehaveNode 16 | { 17 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 18 | [SerializeField] 19 | private GameObject _go; 20 | 21 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 22 | [SerializeField] 23 | private Quaternion _quaternion = Quaternion.identity; 24 | 25 | [Output(ShowBackingValue.Always)] 26 | private GameObject _instantiates; 27 | 28 | protected GameObject Go => GetInputValue(nameof(_go),_go); 29 | 30 | protected Quaternion Quaternion => GetInputValue(nameof(_quaternion),_quaternion); 31 | 32 | protected sealed override Action GetOutValue() 33 | { 34 | return new Action(_create); 35 | } 36 | 37 | protected override object GetPortValue(NodePort port) 38 | { 39 | if (port.fieldName == nameof(_instantiates)) 40 | { 41 | return _instantiates; 42 | } 43 | 44 | return null; 45 | } 46 | 47 | private void _create() 48 | { 49 | _instantiates = CreateGo(); 50 | } 51 | 52 | protected abstract GameObject CreateGo(); 53 | } 54 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CreteGoNodes/PositionCreateGoNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-21:55 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using UnityEngine; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 11 | { 12 | [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Create GameObject/Position")] 13 | public class PositionCreateGoNode:ACreateGoNode 14 | { 15 | //基于自身坐标 16 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 17 | [SerializeField] 18 | private bool _basedOnItselfPos = true; 19 | 20 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 21 | [SerializeField] 22 | private Vector3 _pos; 23 | 24 | protected override GameObject CreateGo() 25 | { 26 | var pos = GetInputValue(nameof(_pos),_pos); 27 | 28 | if (_basedOnItselfPos) 29 | { 30 | pos += SkillGroup.Owner.transform.position; 31 | } 32 | 33 | return Instantiate(Go,pos, Quaternion); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/CreteGoNodes/PositionCreateGoNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf0ccd37192b4df8b134b13d2f543049 3 | timeCreated: 1575732452 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/DestroyNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 6 | { 7 | [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Destroy Target")] 8 | public class DestroyNode:ANPBehaveNode 9 | { 10 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 11 | private GameObject _target; 12 | 13 | protected override Action GetOutValue() 14 | { 15 | return new Action(_destroy); 16 | } 17 | 18 | private void _destroy() 19 | { 20 | var target = GetInputValue(nameof(_target), _target); 21 | 22 | if (target) 23 | { 24 | Destroy(target); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/DestroyNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1caba32e769db7b46a23b00db2fef1e1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ForExecuteActionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e06732d20454fb39617d31d05a82589 3 | timeCreated: 1575341082 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/AMoveNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using NPBehave; 4 | using UnityEngine; 5 | using XNode; 6 | 7 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 8 | { 9 | public abstract class AMoveNode:ANPBehaveNode 10 | { 11 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 12 | private GameObject _target; 13 | 14 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 15 | private Action.Result _moveResult = Action.Result.PROGRESS; 16 | 17 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 18 | private Action.Result _completeResult = Action.Result.SUCCESS; 19 | 20 | protected Action.Result MoveResult => GetInputValue(nameof(_moveResult),_moveResult); 21 | 22 | protected Action.Result CompleteResult => GetInputValue(nameof(_completeResult),_completeResult); 23 | 24 | protected Transform Tran => GetInputValue(nameof(_target),SkillGroup.Owner)?.transform; 25 | 26 | protected sealed override Action GetOutValue() 27 | { 28 | return new Action(Move); 29 | } 30 | 31 | protected abstract Action.Result Move(Action.Request arg); 32 | } 33 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/AddForceNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Action = NPBehave.Action; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Move/Add Force")] 7 | public class AddForceNode : AMoveNode 8 | { 9 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 10 | private Vector3 _forward; 11 | 12 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 13 | private ForceMode _mode; 14 | 15 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 16 | private float _force; 17 | 18 | protected override Action.Result Move(Action.Request arg) 19 | { 20 | var rigid = Tran.GetComponent(); 21 | 22 | if (rigid) 23 | { 24 | rigid.AddForce(GetInputValue(nameof(_forward),_forward) * GetInputValue(nameof(_force),_force),GetInputValue(nameof(_mode),_mode)); 25 | } 26 | 27 | return CompleteResult; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/AddForceNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8aa4c4db1d164869a6f633397d9f4c13 3 | timeCreated: 1575735840 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/SetPositionNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Move/Set Position")] 8 | public class SetPositionNode:AMoveNode 9 | { 10 | [SerializeField] 11 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | [PortTooltip("New Postion")] 13 | private Vector3 _pos; 14 | 15 | private void _setPos() 16 | { 17 | Tran.position = GetInputValue(nameof(_pos),_pos); 18 | } 19 | 20 | protected override Action.Result Move(Action.Request arg) 21 | { 22 | _setPos(); 23 | 24 | return Action.Result.SUCCESS; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/SetPositionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d04dfe40de04870acc02b27a7331717 3 | timeCreated: 1574071093 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/MoveNodes/TranslateNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 743d96ced70da7b44b4bcb8aa6fa0a6d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PhysicNodes/ACast3DColliderNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | public abstract class ACast3DColliderNode:ACastNode 9 | { 10 | protected Collider[] Buffer; 11 | 12 | [SerializeField] 13 | protected QueryTriggerInteraction TriggerInteraction; 14 | 15 | [Node.OutputAttribute()] 16 | [PortTooltip("result is `IEnumerable`")] 17 | protected IEnumerable Result; 18 | 19 | protected ACast3DColliderNode() 20 | { 21 | if (MaxHitSize < 1) 22 | { 23 | MaxHitSize = 1; 24 | } 25 | 26 | Buffer = new Collider[MaxHitSize]; 27 | } 28 | 29 | protected override object GetPortValue(NodePort port) 30 | { 31 | if (port.fieldName == nameof(Result)) 32 | { 33 | return Result; 34 | } 35 | 36 | return null; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PhysicNodes/ACastRaycastHit3DNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | public abstract class ACastRaycastHit3DNode:ACastRaycastHitNode 9 | { 10 | [SerializeField,Input(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 11 | private Vector3 _direction; 12 | 13 | [SerializeField,Input(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 14 | private float _maxDistance; 15 | 16 | protected Vector3 Direction => GetInputValue(nameof(_direction), _direction); 17 | 18 | public float MaxDistance => GetInputValue(nameof(_maxDistance),_maxDistance); 19 | 20 | protected RaycastHit[] Buffer; 21 | 22 | [SerializeField] 23 | protected QueryTriggerInteraction TriggerInteraction; 24 | 25 | [Output()] 26 | [PortTooltip("result is `IEnumerable`")] 27 | protected IEnumerable Result; 28 | 29 | protected ACastRaycastHit3DNode() 30 | { 31 | if (MaxHitSize < 1) 32 | { 33 | MaxHitSize = 1; 34 | } 35 | 36 | Buffer = new RaycastHit[MaxHitSize]; 37 | } 38 | 39 | protected override object GetPortValue(NodePort port) 40 | { 41 | if (port.fieldName == nameof(Result)) 42 | { 43 | return Result; 44 | } 45 | 46 | return null; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PhysicNodes/ACastRaycastHitNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using XNode; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 5 | { 6 | public abstract class ACastRaycastHitNode:ACastNode 7 | { 8 | [SerializeField,Input(Node.ShowBackingValue.Always,Node.ConnectionType.Override,Node.TypeConstraint.Strict)] 9 | [Node.LabelAttribute("Use All")] 10 | private bool _all; 11 | 12 | protected bool UseAll => GetInputValue(nameof(_all), _all); 13 | } 14 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PhysicNodes/OverlapSphereNode.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Condition/Physic/Overlap Sphere Cast")] 7 | public class OverlapSphereNode:ACast3DColliderNode 8 | { 9 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 10 | private float _radius; 11 | 12 | protected override bool Condition() 13 | { 14 | DebugStart(); 15 | 16 | bool result = false; 17 | 18 | var size = Physics.OverlapSphereNonAlloc(Origin, GetInputValue(nameof(_radius),_radius), Buffer, Mask,TriggerInteraction); 19 | if (size > 0) 20 | { 21 | Result = Buffer.Take(size); 22 | 23 | DebugStop(); 24 | 25 | result = true; 26 | } 27 | 28 | DebugStop(); 29 | 30 | return result; 31 | } 32 | 33 | protected override void OnDrawGizmos() 34 | { 35 | Gizmos.DrawWireSphere(Origin,GetInputValue(nameof(_radius),_radius)); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PhysicNodes/OverlapSphereNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52746032e4fb497d9b70641039e5e2b6 3 | timeCreated: 1575272547 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PlayAudioNodes/APlayAudioNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-23:09 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 9 | using NPBehave; 10 | using UnityEngine; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 13 | { 14 | 15 | public abstract class APlayAudioNode:ANPBehaveNode 16 | { 17 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 18 | [SerializeField] 19 | private AudioClip _clip; 20 | 21 | protected AudioClip Clip => GetInputValue(nameof(_clip), _clip); 22 | } 23 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PlayAudioNodes/SelfPlayAudioNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月17日-23:13 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using NPBehave; 9 | using UnityEngine; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 12 | { 13 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Play Audio/Self")] 14 | public class SelfPlayAudioNode:APlayAudioNode 15 | { 16 | protected override Action GetOutValue() 17 | { 18 | return new Action(_play); 19 | } 20 | 21 | private void _play() 22 | { 23 | var source = SkillGroup.Owner.GetComponent(); 24 | 25 | if (!source) 26 | { 27 | source = SkillGroup.Owner.AddComponent(); 28 | } 29 | 30 | source.clip = Clip; 31 | 32 | source.Play(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/PlayAudioNodes/SelfPlayAudioNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d987547c4431d6d489a7754b42030464 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/AUnitySendMessageNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using NPBehave; 4 | using UnityEngine; 5 | using UnityEngine.Serialization; 6 | 7 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 8 | { 9 | // [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/")] 10 | public abstract class AUnitySendMessageNode:ANPBehaveNode 11 | { 12 | [SerializeField] 13 | protected SendMessageOptions Options; 14 | 15 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 16 | private string _messageName; 17 | 18 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 19 | [PortTooltip("contain ancestor")] 20 | private bool _isUpwards; 21 | 22 | [Input(ShowBackingValue.Always,ConnectionType.Override)] 23 | private object _value; 24 | 25 | protected string MessageName => GetInputValue(nameof(_messageName),_messageName); 26 | 27 | protected object Value => GetInputValue(nameof(_value),_value); 28 | 29 | public bool IsUpwards => GetInputValue(nameof(_isUpwards),_isUpwards); 30 | 31 | protected override Action GetOutValue() 32 | { 33 | return new Action(Send); 34 | } 35 | 36 | protected abstract void Send(); 37 | } 38 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/ComponentSendMessageNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 4 | { 5 | [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Send Message/Component")] 6 | public class ComponentSendMessageNode:AUnitySendMessageNode 7 | { 8 | [Input(ShowBackingValue.Unconnected,ConnectionType.Override,TypeConstraint.Inherited)] 9 | private Component _component; 10 | 11 | protected override void Send() 12 | { 13 | var target = GetInputValue(nameof(_component), _component); 14 | 15 | if (IsUpwards) 16 | { 17 | target?.SendMessageUpwards(MessageName,Value,Options); 18 | } 19 | else 20 | { 21 | target?.SendMessage(MessageName,Value,Options); 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/ComponentSendMessageNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c337ef9fa6842efb1a3509de1a200cd 3 | timeCreated: 1575728890 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/OwnerSendMessageNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 4 | { 5 | [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Send Message/Owner")] 6 | public class OwnerSendMessageNode:AUnitySendMessageNode 7 | { 8 | protected override void Send() 9 | { 10 | if (IsUpwards) 11 | { 12 | SkillGroup.Owner?.SendMessageUpwards(MessageName,Value,Options); 13 | } 14 | else 15 | { 16 | SkillGroup.Owner?.SendMessage(MessageName,Value,Options); 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/OwnerSendMessageNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dded7b1bb0d445c8bfb53fc568c55248 3 | timeCreated: 1575724092 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/TargetSendMessageNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 4 | { 5 | [CreateNodeMenuAttribute("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Send Message/Target")] 6 | public class TargetSendMessageNode:AUnitySendMessageNode 7 | { 8 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 9 | private GameObject _target; 10 | 11 | protected override void Send() 12 | { 13 | var target = GetInputValue(nameof(_target), _target); 14 | if (IsUpwards) 15 | { 16 | target?.SendMessageUpwards(MessageName,Value,Options); 17 | } 18 | else 19 | { 20 | target?.SendMessage(MessageName,Value,Options); 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/UnitySendMessageNodes/TargetSendMessageNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84147ecce1f04234b0bd1294f6019248 3 | timeCreated: 1575727721 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/EulerToQuaternionNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月19日-22:50 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using System; 9 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 10 | using UnityEngine; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 13 | { 14 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Euler To Quaternion Value")] 15 | public class EulerToQuaternionNode:ValueNode 16 | { 17 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 18 | [SerializeField] 19 | private Vector3 _euler; 20 | 21 | public override Type ValueType { get; } = typeof(Quaternion); 22 | 23 | protected override object GetOutValue() 24 | { 25 | return Quaternion.Euler(GetInputValue(nameof(_euler), _euler)); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/EulerToQuaternionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a6d9c9325fa6db4f99b003adc78efdb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetActionTaskActionNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 5 | { 6 | [CreateNodeMenu("CabinIcarus/Nodes/NPBehave/Get Action Value")] 7 | public class GetActionTaskActionNode:ValueNode 8 | { 9 | public override Type ValueType { get; } = typeof(Action); 10 | 11 | [Input(ShowBackingValue.Always,ConnectionType.Multiple,TypeConstraint.Strict)] 12 | private NPBehave.Action _action; 13 | 14 | protected override object GetOutValue() 15 | { 16 | var action = GetInputValue(nameof(_action), _action); 17 | 18 | return action?.GetAction; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetActionTaskActionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dfe4cfad69c49f4a867717e07220006 3 | timeCreated: 1575266702 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetComponentValueNodes/ComponentGetComponentValueNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | [CreateNodeMenu("CabinIcarus/Nodes/NPBehave/Component Get Component")] 9 | public abstract class ComponentGetComponentValueNode:ValueNode 10 | { 11 | public override Type ValueType { get; } = typeof(Component); 12 | 13 | public override bool IsChangeValueType { get; } = true; 14 | 15 | public override Type BaseType { get; } = typeof(Component); 16 | 17 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 18 | private Component _target; 19 | 20 | protected override object GetOutValue() 21 | { 22 | #if UNITY_EDITOR 23 | if (!Application.isPlaying) 24 | { 25 | return null; 26 | } 27 | #endif 28 | var target = GetInputValue(nameof(_target), _target); 29 | 30 | if (!target) 31 | { 32 | return null; 33 | } 34 | 35 | return target.GetComponent(GetCurrentValueType()); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetComponentValueNodes/ComponentGetComponentValueNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1924d76ba2ff9234393bc6ab01cae96f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetComponentValueNodes/GetComponentValueNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | [CreateNodeMenu("CabinIcarus/Nodes/NPBehave/Go Get Component")] 9 | public class GetComponentValueNode:ValueNode 10 | { 11 | public override Type ValueType { get; } = typeof(Component); 12 | 13 | public override bool IsChangeValueType { get; } = true; 14 | 15 | public override Type BaseType { get; } = typeof(Component); 16 | 17 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 18 | [PortTooltip("No Input use Owner")] 19 | private GameObject _target; 20 | 21 | protected override object GetOutValue() 22 | { 23 | #if UNITY_EDITOR 24 | if (!Application.isPlaying) 25 | { 26 | return null; 27 | } 28 | #endif 29 | var target = GetInputValue(nameof(_target), SkillGroup.Owner); 30 | 31 | return target.GetComponent(GetCurrentValueType()); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetComponentValueNodes/GetComponentValueNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e31a44698950cf74b94de70ccd9a40f5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetGoValueNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 6 | { 7 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Component To GameObject")] 8 | public class GetGoValueNode:ValueNode 9 | { 10 | public override Type ValueType { get; } = typeof(GameObject); 11 | 12 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 13 | private Component _component; 14 | 15 | protected override object GetOutValue() 16 | { 17 | var com = GetInputValue(nameof(_component), _component); 18 | 19 | if (!com) 20 | { 21 | return null; 22 | } 23 | 24 | return com.gameObject; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetGoValueNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd2ea0a096f0bfa49b9df6be11582846 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetEuler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Target Euler Value")] 9 | public class GetTargetEuler:ValueNode 10 | { 11 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | [PortTooltip("no input use Owner")] 13 | private GameObject _target; 14 | 15 | public override Type ValueType { get; } = typeof(Vector3); 16 | 17 | protected override object GetOutValue() 18 | { 19 | #if UNITY_EDITOR 20 | if (!Application.isPlaying) 21 | { 22 | return null; 23 | } 24 | #endif 25 | var target = GetInputValue(nameof(_target), SkillGroup.Owner); 26 | 27 | return target.transform.rotation.eulerAngles; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetEuler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0453860434c4107a658a8c083cbca81 3 | timeCreated: 1575732071 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetForward.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Target Forward")] 9 | public class GetTargetForward:ValueNode 10 | { 11 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | [PortTooltip("no input use Owner")] 13 | private GameObject _target; 14 | 15 | [SerializeField] 16 | private bool _isReverse; 17 | 18 | public override Type ValueType { get; } = typeof(Vector3); 19 | 20 | protected override object GetOutValue() 21 | { 22 | #if UNITY_EDITOR 23 | if (!Application.isPlaying) 24 | { 25 | return null; 26 | } 27 | #endif 28 | var target = GetInputValue(nameof(_target), SkillGroup.Owner); 29 | 30 | var forward = target.transform.forward; 31 | return _isReverse ? -forward : forward; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetForward.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7879bc8126184ccdb191a84b54f03abc 3 | timeCreated: 1575737077 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetPosition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 7 | { 8 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Target Position")] 9 | public class GetTargetPosition:ValueNode 10 | { 11 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | [PortTooltip("no input use Owner")] 13 | private GameObject _target; 14 | 15 | [SerializeField, Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 16 | private bool _loacal; 17 | 18 | public override Type ValueType { get; } = typeof(Vector3); 19 | 20 | protected override object GetOutValue() 21 | { 22 | #if UNITY_EDITOR 23 | if (!Application.isPlaying) 24 | { 25 | return null; 26 | } 27 | #endif 28 | 29 | var target = GetInputValue(nameof(_target), SkillGroup.Owner); 30 | 31 | if (_loacal) 32 | { 33 | return target.transform.localPosition; 34 | } 35 | 36 | return target.transform.position; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/GetTargetPosition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9230856485f74f478c7b8e350a875138 3 | timeCreated: 1575733142 -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/LayerMaskValueNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 6 | { 7 | [CreateNodeMenu("CabinIcarus/Nodes/UnityEngine/Layer Mask")] 8 | public class LayerMaskValueNode:ValueNode 9 | { 10 | public override Type ValueType { get; } = typeof(LayerMask); 11 | 12 | [SerializeField] 13 | private LayerMask _mask; 14 | 15 | protected override object GetOutValue() 16 | { 17 | return _mask; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/LayerMaskValueNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83e9f46f69df22a4795f088a2da64cff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/OwnerToBuffEntityValueNode.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | //using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 3 | // 4 | //namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Nodes 5 | //{ 6 | // [CreateNodeMenu("CabinIcarus/IcSkillSystem/Entity/Go To Entity Value")] 7 | // public class OwnerToBuffEntityValueNode:ValueNode 8 | // { 9 | // [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 10 | // private IcSkSEntityManager _entityManager; 11 | // 12 | // public override Type ValueType { get; } = typeof(IcSkSEntity); 13 | // 14 | // protected override object GetOutValue() 15 | // { 16 | // var entityManager = GetInputValue(nameof(_entityManager), _entityManager); 17 | // 18 | // if (entityManager == null) 19 | // { 20 | // return new IcSkSEntity(-1); 21 | // } 22 | // 23 | // return entityManager.FindBindEntity(SkillGroup.Owner.gameObject); 24 | // } 25 | // } 26 | //} -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/Builtin/ValueNodes/OwnerToBuffEntityValueNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a18eee3c9947c18469c1d1e8d1f67da2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Nodes/Runtime/CabinIcarus.IcSkillSystem.Expansion.Nodes.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Expansion.Nodes.Runtime", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime", 5 | "CabinIcarus.IcSkillSystem.Expansion.Runtime", 6 | "CabinIcarus.IcSkillSystem.xNodeIc.Base", 7 | "CabinIcarus.IcSkillSystem.BuffFactory", 8 | "CabinIcarus.NPBehave", 9 | "XNode" 10 | ], 11 | "includePlatforms": [], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffDescriptionComponent.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月16日-22:33 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// buff 描述 12 | /// 13 | public interface IBuffDescriptionComponent 14 | { 15 | /// 16 | /// buff名字 17 | /// 18 | string Name { get; set; } 19 | 20 | /// 21 | /// buff 描述 22 | /// 23 | string Description { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffLevelComponent.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月16日-22:34 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// buff 等级 12 | /// 13 | public interface IBuffLevelComponent 14 | { 15 | int Level { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffTimeDataComponent.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:02 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// buff 时间 12 | /// 13 | public interface IBuffTimeDataComponent 14 | { 15 | /// 16 | /// 持续时间 17 | /// 18 | float Duration { get; set;} 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffTriggerTime.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 2 | { 3 | /// 4 | /// 持续触发型buff 5 | /// 6 | public interface IBuffTriggerTime:IBuffTimeDataComponent 7 | { 8 | /// 9 | /// 最后的触发时间 10 | /// 11 | float LastTriggerTime { get; set; } 12 | 13 | /// 14 | /// 触发间隔 15 | /// 16 | float TriggerInterval { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffType.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 2 | { 3 | /// 4 | /// buff 类型 5 | /// 6 | public interface IBuffType 7 | { 8 | int Type { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/IBuffValueDataComponent.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:25 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// buff value 12 | /// 13 | public interface IBuffValueDataComponent 14 | { 15 | /// 16 | /// buff 值 17 | /// 18 | float Value { get; set;} 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Base/ILifesteal.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月27日-21:59 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// 吸血 12 | /// 13 | public interface ILifesteal:IBuffValueDataComponent 14 | { 15 | } 16 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Buffs/Damage.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月28日-14:40 6 | //Assembly-CSharp 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 11 | { 12 | public struct Damage:IDamageBuff 13 | { 14 | public float Value { get; set; } 15 | public int Type { get; set; } 16 | public int ID { get; } 17 | public IcEntityStruct Entity { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Buffs/Death.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月28日-15:14 6 | //Assembly-CSharp 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 12 | { 13 | public struct DeathStruct:IBuffDataComponent,IMakerEntity 14 | { 15 | public IcEntityStruct Entity { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/Buffs/Mechanics.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月28日-14:39 6 | //Assembly-CSharp 7 | 8 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 9 | { 10 | public interface IPercentage{} 11 | 12 | public struct Mechanics:IMechanicBuff 13 | { 14 | public MechanicsType MechanicsType { get; set; } 15 | public float Value { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IAttributeBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | public enum AttributeType 7 | { 8 | None, 9 | /// 10 | /// 力量 11 | /// 12 | Strength, 13 | /// 14 | /// 敏捷 15 | /// 16 | Agility, 17 | /// 18 | /// 智力 19 | /// 20 | Intelligence 21 | } 22 | 23 | /// 24 | /// 属性buff 25 | /// 26 | public interface IAttributeBuff:IBuffDataComponent,IBuffValueDataComponent 27 | { 28 | AttributeType Type { get; } 29 | } 30 | 31 | /// 32 | /// 属性buff 33 | /// 34 | // public interface IAttributeStructBuff:IStructBuffDataComponent,IBuffValueDataComponent 35 | // { 36 | // AttributeType Type { get; } 37 | // } 38 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IContinuousDamageBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | /// 7 | /// 持续伤害buff 8 | /// 9 | public interface IContinuousDamageBuff: 10 | IBuffDataComponent, 11 | IBuffValueDataComponent, 12 | IBuffDescriptionComponent, 13 | IBuffType, 14 | IBuffTriggerTime, 15 | IMakerEntity 16 | { 17 | } 18 | 19 | // /// 20 | // /// 持续伤害buff 21 | // /// 22 | // public interface IContinuousDamageStructBuff: 23 | // IStructBuffDataComponent, 24 | // IBuffValueDataComponent, 25 | // IBuffType, 26 | // IBuffTriggerTime 27 | // { 28 | // } 29 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IDamageBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | /// 7 | /// 伤害 buff 8 | /// 9 | public interface IDamage:IBuffValueDataComponent,IBuffType,IMakerEntity 10 | { 11 | } 12 | 13 | /// 14 | /// 伤害 buff 15 | /// 16 | public interface IDamageBuff:IDamage,IBuffDataComponent 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IDamageReduceFixedBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | /// 7 | /// 固定伤害减少 buff 8 | /// 9 | public interface IDamageReduceFixedBuff:IBuffDataComponent,IBuffValueDataComponent,IBuffDescriptionComponent,IBuffType 10 | { 11 | } 12 | 13 | // /// 14 | // /// 固定伤害减少 buff 15 | // /// 16 | // public interface IDamageReduceFixedStructBuff:IStructBuffDataComponent,IBuffValueDataComponent,IBuffType 17 | // { 18 | // } 19 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IDamageReducePercentageBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | /// 7 | /// 百分比伤害减少 buff 8 | /// 9 | public interface IDamageReducePercentageBuff:IBuffDataComponent,IBuffValueDataComponent,IBuffDescriptionComponent,IBuffType 10 | { 11 | } 12 | 13 | // /// 14 | // /// 百分比伤害减少 buff 15 | // /// 16 | // public interface IDamageReducePercentageStructBuff:IStructBuffDataComponent,IBuffValueDataComponent,IBuffType 17 | // { 18 | // } 19 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IFixedLifesteal.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月27日-22:02 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 12 | { 13 | /// 14 | /// 固定值吸血 15 | /// 16 | public interface IFixedLifesteal:ILifesteal,IBuffDataComponent,IBuffType 17 | { 18 | } 19 | 20 | // /// 21 | // /// 固定值吸血 22 | // /// 23 | // public interface IFixedLifestealStruct:ILifesteal,IStructBuffDataComponent 24 | // { 25 | // } 26 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IMakerEntity.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 4 | { 5 | public interface IMakerEntity 6 | { 7 | IcEntityStruct Entity { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IMechanicBuff.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 5 | { 6 | public enum MechanicsType 7 | { 8 | None, 9 | /// 10 | /// 生命 11 | /// 12 | Health, 13 | /// 14 | /// 法力 15 | /// 16 | Mana, 17 | /// 18 | /// 攻击 19 | /// 20 | Attack, 21 | /// 22 | /// 魔法攻击 23 | /// 24 | Magic, 25 | /// 26 | /// 盔甲 27 | /// 28 | Armor, 29 | /// 30 | /// 法术抗性 31 | /// 32 | MagicResistance, 33 | /// 34 | /// 攻击速度 35 | /// 36 | AttackSpeed, 37 | /// 38 | /// 移动速度 39 | /// 40 | MoveSpeed, 41 | /// 42 | /// 闪避值 43 | /// 44 | Evasion, 45 | } 46 | 47 | /// 48 | /// 能力buff 49 | /// 50 | public interface IMechanicBuff:IBuffDataComponent,IBuffValueDataComponent 51 | { 52 | MechanicsType MechanicsType { get; set; } 53 | } 54 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Components/IPercentageLifesteal.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月27日-22:02 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components 12 | { 13 | /// 14 | /// 百分比吸血 15 | /// 16 | public interface IPercentageLifesteal:ILifesteal,IBuffDataComponent,IBuffType 17 | { 18 | } 19 | 20 | // /// 21 | // /// 百分比吸血 22 | // /// 23 | // public interface IPercentageLifestealStruct:ILifesteal,IStructBuffDataComponent 24 | // { 25 | // } 26 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Exceptions/TypeErrorException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace IcSkillSystem.SkillSystem.Scripts.Expansion.Runtime.Builtin.Buffs.Exceptions 4 | { 5 | public class TypeErrorException:Exception 6 | { 7 | public Type TargetType { get; } 8 | 9 | public TypeErrorException(Type targetType) 10 | { 11 | TargetType = targetType; 12 | } 13 | 14 | public TypeErrorException(string message, Type targetType) : base(message) 15 | { 16 | TargetType = targetType; 17 | } 18 | 19 | public TypeErrorException(string message, Exception innerException, Type targetType) : base(message, innerException) 20 | { 21 | TargetType = targetType; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Manager/QueryResult.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs 2 | { 3 | 4 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/Base/IStructButtCreateSystem.cs: -------------------------------------------------------------------------------- 1 | namespace SkillSystem.SkillSystem.Scripts.Expansion.Runtime.Builtin.Buffs.Systems.Base 2 | { 3 | public interface IStructButtCreateSystem 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/Base/IStructButtSystem.cs: -------------------------------------------------------------------------------- 1 |  2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 3 | 4 | namespace SkillSystem.SkillSystem.Scripts.Expansion.Runtime.Builtin.Buffs.Systems.Base 5 | { 6 | // public interface IStructButtSystem:IBuffSystem 7 | // { 8 | // } 9 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/BuffTimeSystem.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月23日-23:00 6 | //CabinIcarus.IcSkillSystem.Expansion.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 10 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 11 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 12 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 13 | using UnityEngine; 14 | 15 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs.Systems 16 | { 17 | public class BuffTimeSystem:IBuffUpdateSystem where T:struct,IBuffDataComponent,IBuffTimeDataComponent 18 | { 19 | private readonly IStructBuffManager _buffManager; 20 | 21 | public BuffTimeSystem(IStructBuffManager buffManager) 22 | { 23 | this._buffManager = buffManager; 24 | } 25 | public void Execute() 26 | { 27 | foreach (var entity in _buffManager.Entitys) 28 | { 29 | var buffs = _buffManager.GetBuffs(entity); 30 | 31 | for (var i = 0; i < buffs.Count; i++) 32 | { 33 | var buff = buffs[i]; 34 | 35 | buff.Duration -= Time.deltaTime; 36 | 37 | if (buff.Duration <= 0) 38 | { 39 | _buffManager.RemoveBuff(entity, buff); 40 | } 41 | } 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/ContinuousDamageSystem.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs.Systems 7 | { 8 | /// 9 | /// 持续伤害 10 | /// 11 | public class ContinuousDamageSystem:AIcStructBuffSystem where T:struct,IContinuousDamageBuff where TDamageBuff : struct,IDamageBuff 12 | { 13 | public override void Execute() 14 | { 15 | foreach (var entity in BuffManager.Entitys) 16 | { 17 | var buffs = BuffManager.GetBuffs(entity); 18 | 19 | for (var i = 0; i < buffs.Count; i++) 20 | { 21 | var buff = buffs[i]; 22 | 23 | if (buff.LastTriggerTime - buff.Duration >= 24 | buff.TriggerInterval) 25 | { 26 | buff.LastTriggerTime = buff.Duration; 27 | 28 | BuffManager.AddBuff(entity, new TDamageBuff() 29 | { 30 | Entity = buff.Entity, 31 | Type = buff.Type, 32 | Value = buff.Value, 33 | }); 34 | } 35 | 36 | BuffManager.SetBuffData(entity,buff,i); 37 | } 38 | } 39 | } 40 | 41 | #region Init 42 | 43 | public override void Create(IIcSkSEntity entity, int index) 44 | { 45 | var buff = BuffManager.GetBuffData(entity, index); 46 | 47 | buff.LastTriggerTime = buff.Duration; 48 | } 49 | 50 | #endregion 51 | 52 | public ContinuousDamageSystem(IStructBuffManager buffManager) : base(buffManager) 53 | { 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/DamageReduceFixedSystem.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs.Systems 7 | { 8 | /// 9 | /// 固定减少伤害,如果存在多个一样的buff,只会使用最后一个 10 | /// 11 | public class DamageReduceFixedSystem:IBuffCreateSystem 12 | where TDamageReduceFixedBuff : struct,IDamageReduceFixedBuff 13 | where TDamageBuff : struct,IDamageBuff 14 | { 15 | private readonly IStructBuffManager _buffManager; 16 | 17 | public DamageReduceFixedSystem(IStructBuffManager buffManager) 18 | { 19 | this._buffManager = buffManager; 20 | } 21 | 22 | public void Create(IIcSkSEntity entity, int index) 23 | { 24 | var fixedBuffs = _buffManager.GetBuffs(entity); 25 | 26 | if (fixedBuffs.Count == 0) 27 | { 28 | return; 29 | } 30 | 31 | //todo 只使用最后一个减伤buff 32 | TDamageReduceFixedBuff damageReduceFixedBuff = fixedBuffs[fixedBuffs.Count - 1]; 33 | 34 | TDamageBuff damageBuff = _buffManager.GetBuffData(entity, index); 35 | 36 | if (damageBuff.Type == damageReduceFixedBuff.Type) 37 | { 38 | damageBuff.Value -= damageReduceFixedBuff.Value; 39 | 40 | if (damageBuff.Value <= 0) 41 | { 42 | damageBuff.Value = 0; 43 | } 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Buffs/Systems/DamageReducePercentageSystem.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Runtime.Builtin.Buffs.Systems 7 | { 8 | /// 9 | /// 百分比伤害减少,如果存在多个一样的buff,只会使用最后一个 10 | /// 11 | public class DamageReducePercentageSystem:IBuffCreateSystem 12 | where TDamageReducePercentageBuff : struct,IDamageReducePercentageBuff 13 | where TDamageBuff : struct,IDamageBuff 14 | { 15 | private readonly IStructBuffManager _buffManager; 16 | 17 | public DamageReducePercentageSystem(IStructBuffManager buffManager) 18 | { 19 | this._buffManager = buffManager; 20 | } 21 | 22 | public void Create(IIcSkSEntity entity, int index) 23 | { 24 | var fixedBuffs = _buffManager.GetBuffs(entity); 25 | 26 | if (fixedBuffs.Count == 0) 27 | { 28 | return; 29 | } 30 | 31 | //todo 只使用最后一个减伤buff 32 | TDamageReducePercentageBuff damageReduceFixedBuff = fixedBuffs[fixedBuffs.Count - 1]; 33 | 34 | TDamageBuff damageBuff = _buffManager.GetBuffData(entity, index); 35 | 36 | if (damageBuff.Type == damageReduceFixedBuff.Type) 37 | { 38 | damageBuff.Value -= damageBuff.Value * damageReduceFixedBuff.Value; 39 | 40 | if (damageBuff.Value <= 0) 41 | { 42 | damageBuff.Value = 0; 43 | } 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Skills/Condition/ManaCheck.cs: -------------------------------------------------------------------------------- 1 | //using System.Collections.Generic; 2 | //using CabinIcarus.IcSkillSystem.Expansion.Runtime.Buffs.Components; 3 | //using CabinIcarus.IcSkillSystem.Runtime.Buffs; 4 | //using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 5 | //using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 6 | //using CabinIcarus.IcSkillSystem.Runtime.Skills.Condition; 7 | // 8 | //namespace SkillSystem.SkillSystem.Scripts.Expansion.Runtime.Builtin.Skills.Condition 9 | //{ 10 | // /// 11 | // /// 法力值检查 12 | // /// 13 | // public class ManaCheck:ACondition 14 | // { 15 | // public float NeedManaValue; 16 | // 17 | // /// 18 | // /// 必须需要魔法值 19 | // /// false的话如果没有魔法值也可以释放,有魔法值会忽略 20 | // /// 21 | // public bool MustNeedMana = true; 22 | // 23 | // private List _buffs; 24 | // 25 | // public ManaCheck(IBuffManager buffManager) : base(buffManager) 26 | // { 27 | // _buffs = new List(); 28 | // } 29 | // 30 | // public override bool Check(IIcSkSEntity icSkSEntity) 31 | // { 32 | // _buffManager.GetBuffs(icSkSEntity,x=>x.MechanicsType == MechanicsType.Mana,_buffs); 33 | // if (_buffs.Count > 0) 34 | // { 35 | // var buff = _buffs[0]; 36 | // 37 | // var result = buff.Value >= NeedManaValue; 38 | // 39 | // if (result) 40 | // { 41 | // buff.Value -= NeedManaValue; 42 | // } 43 | // 44 | // return result; 45 | // } 46 | // 47 | // return !MustNeedMana; 48 | // } 49 | // } 50 | //} -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Skills/Manager/SkillManager.cs: -------------------------------------------------------------------------------- 1 | //using System.Collections.Generic; 2 | //using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 3 | //using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 4 | //using CabinIcarus.IcSkillSystem.Runtime.Skills.Manager; 5 | //using CabinIcarus.IcSkillSystem.Runtime.Skills.Systems; 6 | // 7 | //namespace SkillSystem.SkillSystem.Scripts.Expansion.Runtime.Builtin.Skills.Manager 8 | //{ 9 | // public class SkillManager:ISkillManager 10 | // { 11 | // private List _skillSystem; 12 | // 13 | // public SkillManager() 14 | // { 15 | // _skillSystem = new List(); 16 | // } 17 | // 18 | // public void UseSkill(IIcSkSEntity icSkSEntity, ISkillDataComponent skill) 19 | // { 20 | // foreach (var system in _skillSystem) 21 | // { 22 | // if (system.Filter(icSkSEntity,skill)) 23 | // { 24 | // system.Execute(icSkSEntity,skill); 25 | // } 26 | // } 27 | // } 28 | // 29 | //// public void RemoveSkill(IEntity entity, ISkillDataComponent skill) 30 | //// { 31 | //// } 32 | // 33 | // public ISkillManager AddSkillSystem(ISkillExecuteSystem skillSystem) 34 | // { 35 | // _skillSystem.Add(skillSystem); 36 | // return this; 37 | // } 38 | // } 39 | //} -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Unity/BuffEntityLinkComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Expansion.Builtin.Component 7 | { 8 | public class BuffEntityLinkComponent : MonoBehaviour 9 | { 10 | [NonSerialized] 11 | public IBuffManager EntityManager; 12 | [NonSerialized] 13 | public IIcSkSEntity IcSkSEntity; 14 | 15 | public void Init(IBuffManager entityManager, IIcSkSEntity icSkSEntity) 16 | { 17 | EntityManager = entityManager; 18 | Link(icSkSEntity); 19 | } 20 | 21 | public void Link(IIcSkSEntity icSkSEntity) 22 | { 23 | this.IcSkSEntity = icSkSEntity; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/Builtin/Unity/SelfBlackBoardComponent.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Expansion.Builtin.Component 6 | { 7 | public class SelfBlackBoardComponent:MonoBehaviour 8 | { 9 | public Blackboard Blackboard { get; private set; } 10 | 11 | public bool UseUnityContextClock = true; 12 | 13 | public void Init() 14 | { 15 | if (!UseUnityContextClock) 16 | { 17 | _clock = new Clock(); 18 | } 19 | Blackboard = new Blackboard(UseUnityContextClock ? UnityContext.GetClock() : _clock); 20 | } 21 | 22 | private Clock _clock; 23 | 24 | void Update() 25 | { 26 | _clock?.Update(Time.deltaTime); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Runtime/CabinIcarus.IcSkillSystem.Expansion.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Expansion.Runtime", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime", 5 | "CabinIcarus.NPBehave", 6 | "XNode", 7 | "CabinIcarus.IcSkillSystem.xNodeIc.Base" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [] 17 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Expansion/Test/CabinIcarus.IcSkillSystem.Expansion.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Expansion.Tests", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Expansion.Runtime", 5 | "CabinIcarus.IcSkillSystem.Runtime", 6 | "UnityEditor.TestRunner", 7 | "UnityEngine.TestRunner" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": true, 13 | "precompiledReferences": [ 14 | "nunit.framework.dll" 15 | ], 16 | "autoReferenced": false, 17 | "defineConstraints": [ 18 | "UNITY_INCLUDE_TESTS" 19 | ], 20 | "versionDefines": [] 21 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Components/IBuffDataComponent.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-18:59 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Components 9 | { 10 | /// 11 | /// buff 组件 12 | /// 13 | public interface IBuffDataComponent 14 | { 15 | } 16 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Systems/AIcStructBuffSystem.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems 6 | { 7 | public abstract class AIcStructBuffSystem: 8 | IBuffCreateSystem, 9 | IBuffUpdateSystem,IBuffDestroySystem 10 | where TEntity : IIcSkSEntity 11 | where TBuffType : struct, IBuffDataComponent 12 | { 13 | protected readonly IStructBuffManager BuffManager; 14 | 15 | protected AIcStructBuffSystem(IStructBuffManager buffManager) 16 | { 17 | BuffManager = buffManager; 18 | } 19 | 20 | public virtual void Execute() 21 | { 22 | } 23 | 24 | public virtual void Create(TEntity entity, int index) 25 | { 26 | } 27 | 28 | public virtual void Destroy(TEntity entity, int index) 29 | { 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Systems/Interfaces/IBuffCreateSystem.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:03 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces 12 | { 13 | /// 14 | /// buff 创建系统 15 | /// 16 | public interface IBuffCreateSystem:IBuffSystem where TEntity : IIcSkSEntity 17 | { 18 | void Create(TEntity entity,int index); 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Systems/Interfaces/IBuffDestroySystem.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:05 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 9 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces 12 | { 13 | /// 14 | /// buff 销毁系统 15 | /// 16 | public interface IBuffDestroySystem:IBuffSystem where TEntity : IIcSkSEntity 17 | { 18 | void Destroy(TEntity entity,int index); 19 | } 20 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Systems/Interfaces/IBuffSystem.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:59 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Systems; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces 11 | { 12 | public interface IBuffSystem:ISkillSystem 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Buffs/Systems/Interfaces/IBuffUpdateSystem.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月14日-19:05 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Systems.Interfaces 9 | { 10 | /// 11 | /// buff 更新系统 12 | /// 13 | public interface IBuffUpdateSystem:IBuffSystem 14 | { 15 | void Execute(); 16 | } 17 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/CabinIcarus.IcSkillSystem.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.Runtime", 3 | "references": [ 4 | "Utf8Json" 5 | ], 6 | "includePlatforms": [], 7 | "excludePlatforms": [], 8 | "allowUnsafeCode": false, 9 | "overrideReferences": false, 10 | "precompiledReferences": [], 11 | "autoReferenced": true, 12 | "defineConstraints": [], 13 | "versionDefines": [] 14 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Entitys/IIcSkSEntity.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月15日-19:04 6 | //CabinIcarus.SkillSystem.Runtime 7 | 8 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys 9 | { 10 | public interface IIcSkSEntity 11 | { 12 | int ID { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Entitys/IIcSkSEntityManager.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 2 | using CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys 5 | { 6 | public interface IIcSkSEntityManager where TEntity : IIcSkSEntity 7 | { 8 | FasterReadOnlyList Entitys { get; } 9 | 10 | IBuffManager BuffManager { get;} 11 | 12 | TEntity CreateEntity(); 13 | 14 | TEntity CreateEntity(int id); 15 | 16 | bool DestroyEntity(int id); 17 | 18 | bool DestroyEntity(TEntity entity); 19 | 20 | void Update(); 21 | 22 | void AddBuff(TEntity entity, T buff) where T : IBuffDataComponent; 23 | 24 | bool RemoveBuff(TEntity entity,T buff) where T : IBuffDataComponent; 25 | 26 | bool HasBuff(TEntity entity, T buff) where T : IBuffDataComponent; 27 | } 28 | 29 | public interface IStructIcSkSEntityManager : IIcSkSEntityManager where TEntity : IIcSkSEntity 30 | { 31 | new void AddBuff(TEntity entity, T buff) where T :struct, IBuffDataComponent; 32 | 33 | new bool RemoveBuff(TEntity entity,T buff) where T :struct, IBuffDataComponent; 34 | 35 | new bool HasBuff(TEntity entity, T buff) where T :struct, IBuffDataComponent; 36 | } 37 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Entitys/IcEntityStruct.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys 4 | { 5 | public struct IcEntityStruct 6 | { 7 | private readonly uint id; 8 | 9 | public IcEntityStruct(uint id) 10 | { 11 | this.id = id; 12 | } 13 | 14 | public static implicit operator uint(IcEntityStruct ecsString) 15 | { 16 | return ecsString.id; 17 | } 18 | } 19 | 20 | public static class IcEntityStructEX 21 | { 22 | public static IIcSkSEntity ToIIcSkSEntity(this IcEntityStruct entityStruct) 23 | { 24 | return ResourcesECSDB.FromECS(entityStruct); 25 | } 26 | 27 | public static IcEntityStruct FromIIcSkSEntity(this IIcSkSEntity entity) 28 | { 29 | return new IcEntityStruct(ResourcesECSDB.ToECS(entity)); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Com/ISkillFilter.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月18日-23:41 6 | //CabinIcarus.IcSkillSystem.Runtime 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 9 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 10 | 11 | namespace CabinIcarus.SkillSystem.Runtime.Skills.Com 12 | { 13 | public interface ISkillFilter 14 | { 15 | /// 16 | /// 过滤技能 17 | /// 18 | /// 19 | /// 20 | bool Filter(T IIIcSkSEntity,ISkillDataComponent skill) where T : IIcSkSEntity; 21 | } 22 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Components/ISkillDataComponent.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Runtime.Skills.Components 2 | { 3 | public interface ISkillDataComponent 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Condition/ACondition.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Runtime.Skills.Condition 6 | { 7 | public abstract class ACondition:ICondition where TEntity : IIcSkSEntity 8 | { 9 | protected readonly IBuffManager _buffManager; 10 | 11 | protected ACondition(IBuffManager buffManager) 12 | { 13 | this._buffManager = buffManager; 14 | } 15 | 16 | public abstract bool Check(TEntity icSkSEntity); 17 | } 18 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Condition/ICondition.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Runtime.Skills.Condition 4 | { 5 | public interface ICondition where TEntity : IIcSkSEntity 6 | { 7 | bool Check(TEntity icSkSEntity); 8 | } 9 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Manager/ISkillManager.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 2 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 3 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Systems; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Runtime.Skills.Manager 6 | { 7 | public interface ISkillManager 8 | { 9 | void UseSkill(IIcSkSEntity icSkSEntity, ISkillDataComponent skill); 10 | 11 | //void RemoveSkill(IEntity entity, ISkillDataComponent skill); 12 | 13 | ISkillManager AddSkillSystem(ISkillExecuteSystem skillSystem); 14 | } 15 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Skills/Systems/ISkillExecuteSystem.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 2 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 3 | using CabinIcarus.IcSkillSystem.Runtime.Systems; 4 | using CabinIcarus.SkillSystem.Runtime.Skills.Com; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Runtime.Skills.Systems 7 | { 8 | public interface ISkillExecuteSystem:ISkillSystem,ISkillFilter 9 | { 10 | void Execute(IIcSkSEntity icSkSEntity,ISkillDataComponent skill); 11 | } 12 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Systems/ISkillSystem.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Runtime.Systems 2 | { 3 | public interface ISkillSystem 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Utils/DataStructures/ECSResources.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils 2 | { 3 | /// 4 | /// https://github.com/sebas77/Svelto.ECS/blob/master/Svelto.ECS.Components/ECSResources/ECSResources.cs 5 | /// 6 | /// 7 | public struct ECSResources 8 | { 9 | internal uint id; 10 | 11 | public static implicit operator T(ECSResources ecsString) { return ResourcesECSDB.FromECS(ecsString.id); } 12 | } 13 | 14 | static class ResourcesECSDB 15 | { 16 | internal static readonly FasterList _resources = new FasterList(); 17 | 18 | internal static uint ToECS(T resource) 19 | { 20 | _resources.Add(resource); 21 | 22 | return (uint)_resources.Count; 23 | } 24 | 25 | public static T FromECS(uint id) 26 | { 27 | if (id - 1 < _resources.Count) 28 | return _resources[(int) id - 1]; 29 | 30 | return default(T); 31 | } 32 | } 33 | 34 | public static class ResourceExtensions 35 | { 36 | public static void Set(ref this ECSResources resource, T newText) 37 | { 38 | if (resource.id != 0) 39 | ResourcesECSDB._resources[(int) resource.id] = newText; 40 | else 41 | resource.id = ResourcesECSDB.ToECS(newText); 42 | } 43 | 44 | public static void Set(ref this ECSString resource, string newText) 45 | { 46 | if (resource.id != 0) 47 | ResourcesECSDB._resources[(int) resource.id] = newText; 48 | else 49 | resource.id = ResourcesECSDB.ToECS(newText); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Utils/DataStructures/SerializationDict.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils 6 | { 7 | [Serializable] 8 | public class SerializationDict:Dictionary,ISerializationCallbackReceiver 9 | { 10 | #region Serialize 11 | 12 | #if UNITY_EDITOR 13 | public const string KeysFieldName = nameof(_keys); 14 | public const string ValuesFieldName = nameof(_values); 15 | #endif 16 | 17 | [SerializeField] 18 | List _keys = new List(); 19 | 20 | [SerializeField] 21 | List _values = new List(); 22 | 23 | public void OnBeforeSerialize() 24 | { 25 | _keys.Clear(); 26 | _values.Clear(); 27 | 28 | foreach (var keyValuePair in this) 29 | { 30 | _keys.Add(keyValuePair.Key); 31 | 32 | var value = keyValuePair.Value; 33 | 34 | _values.Add(value); 35 | } 36 | } 37 | 38 | public void OnAfterDeserialize() 39 | { 40 | Clear(); 41 | 42 | for (var i = 0; i < _keys.Count; i++) 43 | { 44 | var key = _keys[i]; 45 | 46 | if (i >= _values.Count - 1) 47 | { 48 | _values.Add(default); 49 | } 50 | 51 | var value = _values[i]; 52 | 53 | Add(key,value); 54 | } 55 | } 56 | 57 | #endregion 58 | } 59 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Utils/DataStructures/StringECSDB.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils 2 | { 3 | /// 4 | /// https://github.com/sebas77/Svelto.ECS/blob/master/Svelto.ECS.Components/ECSResources/StringECSDB.cs 5 | /// 6 | public struct ECSString 7 | { 8 | internal uint id; 9 | 10 | ECSString(uint toEcs) 11 | { 12 | id = toEcs; 13 | } 14 | 15 | public static implicit operator string(ECSString ecsString) 16 | { 17 | return ResourcesECSDB.FromECS(ecsString.id); 18 | } 19 | 20 | public static implicit operator ECSString(string text) 21 | { 22 | return new ECSString(ResourcesECSDB.ToECS(text)); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Utils/IcCheck.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils 4 | { 5 | public class CheckFailureException:Exception 6 | { 7 | public string CheckFunctionName { get; } 8 | 9 | public CheckFailureException(string checkFunctionName, string message) : base(message) 10 | { 11 | CheckFunctionName = checkFunctionName; 12 | } 13 | } 14 | 15 | public static class IcCheck 16 | { 17 | public static bool UseException = true; 18 | 19 | class Trace 20 | { 21 | internal static void Assert(bool assertion, string functionName,string v) 22 | { 23 | #if NETFX_CORE 24 | System.Diagnostics.Contracts.Contract.Assert(assertion, $"Check {functionName} Failure. Message:{v}"); 25 | #else 26 | System.Diagnostics.Trace.Assert(assertion, $"Check {functionName} Failure. Message:{v}"); 27 | #endif 28 | } 29 | } 30 | 31 | public static void True(bool value) 32 | { 33 | True(value,string.Empty); 34 | } 35 | 36 | public static void True(bool value, string message) 37 | { 38 | if (UseException) 39 | { 40 | if (!value) 41 | throw new CheckFailureException(nameof(True), message); 42 | } 43 | 44 | Trace.Assert(value,nameof(True), message); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /SkillSystem/Scripts/Runtime/Utils/SerializationUtil.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月16日-01:00 6 | //CabinIcarus.IcSkillSystem.Runtime 7 | 8 | using System; 9 | using Utf8Json; 10 | 11 | namespace CabinIcarus.IcSkillSystem.SkillSystem.Runtime.Utils 12 | { 13 | public static class SerializationUtil 14 | { 15 | public static string ToString(T value) 16 | { 17 | return JsonSerializer.ToJsonString(value); 18 | } 19 | 20 | public static T ToValue(string str) 21 | { 22 | if (string.IsNullOrEmpty(str) || str == "null") 23 | { 24 | return default; 25 | } 26 | 27 | return JsonSerializer.Deserialize(str); 28 | } 29 | 30 | public static object ToValue(string str,Type type) 31 | { 32 | if (string.IsNullOrEmpty(str) || str == "null") 33 | { 34 | return null; 35 | } 36 | 37 | var value = JsonSerializer.NonGeneric.Deserialize(type,str); 38 | return value; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Utf8Json/Attributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Utf8Json 6 | { 7 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] 8 | public class JsonFormatterAttribute : Attribute 9 | { 10 | public Type FormatterType { get; private set; } 11 | public object[] Arguments { get; private set; } 12 | 13 | public JsonFormatterAttribute(Type formatterType) 14 | { 15 | this.FormatterType = formatterType; 16 | } 17 | 18 | public JsonFormatterAttribute(Type formatterType, params object[] arguments) 19 | { 20 | this.FormatterType = formatterType; 21 | this.Arguments = arguments; 22 | } 23 | } 24 | 25 | [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = true)] 26 | public class SerializationConstructorAttribute : Attribute 27 | { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Utf8Json/Formatters/AnonymousFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utf8Json.Formatters 4 | { 5 | public sealed class AnonymousFormatter : IJsonFormatter 6 | { 7 | readonly JsonSerializeAction serialize; 8 | readonly JsonDeserializeFunc deserialize; 9 | 10 | public AnonymousFormatter(JsonSerializeAction serialize, JsonDeserializeFunc deserialize) 11 | { 12 | this.serialize = serialize; 13 | this.deserialize = deserialize; 14 | } 15 | 16 | public void Serialize(ref JsonWriter writer, T value, IJsonFormatterResolver formatterResolver) 17 | { 18 | if (serialize == null) throw new InvalidOperationException(this.GetType().Name + " does not support Serialize."); 19 | serialize(ref writer, value, formatterResolver); 20 | } 21 | 22 | public T Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) 23 | { 24 | if (deserialize == null) throw new InvalidOperationException(this.GetType().Name + " does not support Deserialize."); 25 | return deserialize(ref reader, formatterResolver); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Utf8Json/Formatters/IgnoreFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utf8Json.Formatters 4 | { 5 | public sealed class IgnoreFormatter : IJsonFormatter 6 | { 7 | public void Serialize(ref JsonWriter writer, T value, IJsonFormatterResolver formatterResolver) 8 | { 9 | writer.WriteNull(); 10 | } 11 | 12 | public T Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) 13 | { 14 | reader.ReadNextBlock(); 15 | return default(T); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Utf8Json/IJsonFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utf8Json 4 | { 5 | public delegate void JsonSerializeAction(ref JsonWriter writer, T value, IJsonFormatterResolver resolver); 6 | public delegate T JsonDeserializeFunc(ref JsonReader reader, IJsonFormatterResolver resolver); 7 | 8 | public interface IJsonFormatter 9 | { 10 | } 11 | 12 | public interface IJsonFormatter : IJsonFormatter 13 | { 14 | void Serialize(ref JsonWriter writer, T value, IJsonFormatterResolver formatterResolver); 15 | T Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver); 16 | } 17 | 18 | public interface IObjectPropertyNameFormatter 19 | { 20 | void SerializeToPropertyName(ref JsonWriter writer, T value, IJsonFormatterResolver formatterResolver); 21 | T DeserializeFromPropertyName(ref JsonReader reader, IJsonFormatterResolver formatterResolver); 22 | } 23 | 24 | public interface IOverwriteJsonFormatter : IJsonFormatter 25 | { 26 | void DeserializeTo(ref T value, ref JsonReader reader, IJsonFormatterResolver formatterResolver); 27 | } 28 | 29 | public enum CollectionDeserializeToBehaviour 30 | { 31 | Add, // default is add(protobuf-merge, json.net-populateobject 32 | OverwriteReplace 33 | } 34 | 35 | public static class JsonFormatterExtensions 36 | { 37 | public static string ToJsonString(this IJsonFormatter formatter, T value, IJsonFormatterResolver formatterResolver) 38 | { 39 | var writer = new JsonWriter(); 40 | formatter.Serialize(ref writer, value, formatterResolver); 41 | return writer.ToString(); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Utf8Json/Internal/ArrayBuffer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utf8Json.Internal 4 | { 5 | public struct ArrayBuffer 6 | { 7 | public T[] Buffer; 8 | public int Size; 9 | 10 | public ArrayBuffer(int initialSize) 11 | { 12 | this.Buffer = new T[initialSize]; 13 | this.Size = 0; 14 | } 15 | 16 | public void Add(T value) 17 | { 18 | if (Size >= this.Buffer.Length) 19 | { 20 | Array.Resize(ref Buffer, Size * 2); 21 | } 22 | 23 | Buffer[Size++] = value; 24 | } 25 | 26 | public T[] ToArray() 27 | { 28 | if (Buffer.Length == Size) 29 | { 30 | return Buffer; 31 | } 32 | 33 | var result = new T[Size]; 34 | Array.Copy(Buffer, result, Size); 35 | return result; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Utf8Json/Internal/ArrayPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Utf8Json.Internal 4 | { 5 | internal sealed class BufferPool : ArrayPool 6 | { 7 | public static readonly BufferPool Default = new BufferPool(65535); 8 | 9 | public BufferPool(int bufferLength) 10 | : base(bufferLength) 11 | { 12 | } 13 | } 14 | 15 | internal class ArrayPool 16 | { 17 | readonly int bufferLength; 18 | readonly object gate; 19 | int index; 20 | T[][] buffers; 21 | 22 | public ArrayPool(int bufferLength) 23 | { 24 | this.bufferLength = bufferLength; 25 | this.buffers = new T[4][]; 26 | this.gate = new object(); 27 | } 28 | 29 | public T[] Rent() 30 | { 31 | lock (gate) 32 | { 33 | if (index >= buffers.Length) 34 | { 35 | Array.Resize(ref buffers, buffers.Length * 2); 36 | } 37 | 38 | if (buffers[index] == null) 39 | { 40 | buffers[index] = new T[bufferLength]; 41 | } 42 | 43 | var buffer = buffers[index]; 44 | buffers[index] = null; 45 | index++; 46 | 47 | return buffer; 48 | } 49 | } 50 | 51 | public void Return(T[] array) 52 | { 53 | if (array.Length != bufferLength) 54 | { 55 | throw new InvalidOperationException("return buffer is not from pool"); 56 | } 57 | 58 | lock (gate) 59 | { 60 | if (index != 0) 61 | { 62 | buffers[--index] = array; 63 | } 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Utf8Json/Internal/FuncExtensions.cs: -------------------------------------------------------------------------------- 1 | #if NETSTANDARD 2 | 3 | using System; 4 | 5 | namespace Utf8Json.Internal 6 | { 7 | // Unity compiler can't understand this. 8 | 9 | internal static class FuncExtensions 10 | { 11 | // hack of avoid closure allocation(() => value). 12 | public static Func AsFunc(this T value) 13 | { 14 | return new Func(value.ReturnBox); 15 | } 16 | 17 | public static Func AsFuncFast(this T value) where T : class 18 | { 19 | return new Func(value.Return); 20 | } 21 | 22 | static T Return(this T value) 23 | { 24 | return value; 25 | } 26 | 27 | static T ReturnBox(this object value) 28 | { 29 | return (T)value; 30 | } 31 | } 32 | } 33 | 34 | 35 | #endif -------------------------------------------------------------------------------- /Utf8Json/Internal/StringEncoding.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace Utf8Json.Internal 4 | { 5 | internal static class StringEncoding 6 | { 7 | public static readonly Encoding UTF8 = new UTF8Encoding(false); 8 | } 9 | } -------------------------------------------------------------------------------- /Utf8Json/Internal/StringMutator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Utf8Json.Internal 5 | { 6 | internal static class StringMutator 7 | { 8 | /// 9 | /// MyProperty -> MyProperty 10 | /// 11 | public static string Original(string s) 12 | { 13 | return s; 14 | } 15 | 16 | /// 17 | /// MyProperty -> myProperty 18 | /// 19 | public static string ToCamelCase(string s) 20 | { 21 | if (string.IsNullOrEmpty(s) || char.IsLower(s, 0)) 22 | { 23 | return s; 24 | } 25 | 26 | var array = s.ToCharArray(); 27 | array[0] = char.ToLowerInvariant(array[0]); 28 | return new string(array); 29 | } 30 | 31 | /// 32 | /// MyProperty -> my_property 33 | /// 34 | public static string ToSnakeCase(string s) 35 | { 36 | if (string.IsNullOrEmpty(s)) return s; 37 | 38 | var sb = new StringBuilder(); 39 | for (int i = 0; i < s.Length; i++) 40 | { 41 | var c = s[i]; 42 | 43 | if (Char.IsUpper(c)) 44 | { 45 | // first 46 | if (i == 0) 47 | { 48 | sb.Append(char.ToLowerInvariant(c)); 49 | } 50 | else if (char.IsUpper(s[i - 1])) // WriteIO => write_io 51 | { 52 | sb.Append(char.ToLowerInvariant(c)); 53 | } 54 | else 55 | { 56 | sb.Append("_"); 57 | sb.Append(char.ToLowerInvariant(c)); 58 | } 59 | } 60 | else 61 | { 62 | sb.Append(c); 63 | } 64 | } 65 | 66 | return sb.ToString(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Utf8Json/JsonToken.cs: -------------------------------------------------------------------------------- 1 | namespace Utf8Json 2 | { 3 | // 0 = None, 1 ~ 4 is block token, 5 ~ 9 = value token, 10 ~ 11 = delimiter token 4 | // you can use range-check if optimization needed. 5 | 6 | public enum JsonToken : byte 7 | { 8 | None = 0, 9 | /// { 10 | BeginObject = 1, 11 | /// } 12 | EndObject = 2, 13 | /// [ 14 | BeginArray = 3, 15 | /// ] 16 | EndArray = 4, 17 | /// 0~9, - 18 | Number = 5, 19 | /// " 20 | String = 6, 21 | /// t 22 | True = 7, 23 | /// f 24 | False = 8, 25 | /// n 26 | Null = 9, 27 | /// , 28 | ValueSeparator = 10, 29 | /// : 30 | NameSeparator = 11 31 | } 32 | } -------------------------------------------------------------------------------- /Utf8Json/Utf8Json.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Utf8Json", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": true, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [], 11 | "versionDefines": [] 12 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/ANPBehaveNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 4 | { 5 | public abstract class ANPBehaveNode:ANPNode where T : Node 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/ANPNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月19日-21:33 6 | //Assembly-CSharp 7 | 8 | using CabinIcarus.IcSkillSystem.xNode_Group; 9 | using UnityEngine; 10 | using XNode; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 13 | { 14 | public abstract class ANPNode:Node,IIcSkillSystemNode 15 | { 16 | public IcSkillGroup SkillGroup { get; set; } 17 | 18 | [Output()] 19 | public T OutValue; 20 | 21 | public T GetDefaultOutputValue() 22 | { 23 | return (T) GetOutputPort(nameof(OutValue)).GetOutputValue(); 24 | } 25 | 26 | protected sealed override void Init() 27 | { 28 | base.Init(); 29 | 30 | if (!_editorNoPlay()) 31 | { 32 | OnInit(); 33 | } 34 | } 35 | 36 | protected virtual void OnInit() 37 | { 38 | } 39 | 40 | public sealed override object GetValue(NodePort port) 41 | { 42 | if (_editorNoPlay()) 43 | { 44 | return null; 45 | } 46 | 47 | if (port == null) 48 | { 49 | return null; 50 | } 51 | 52 | if (port.fieldName == nameof(OutValue)) 53 | { 54 | OutValue = GetOutValue(); 55 | 56 | return OutValue; 57 | } 58 | return GetPortValue(port); 59 | } 60 | 61 | protected virtual object GetPortValue(NodePort port) 62 | { 63 | return null; 64 | } 65 | 66 | bool _editorNoPlay() 67 | { 68 | #if UNITY_EDITOR 69 | //没有播放,不执行创建 70 | if (!Application.isPlaying) 71 | { 72 | return true; 73 | } 74 | #endif 75 | return false; 76 | } 77 | 78 | protected abstract T GetOutValue(); 79 | } 80 | 81 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/ASkillSNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月23日-20:11 6 | //CabinIcarus.IcSkillSystem.xNodeIc.Base 7 | 8 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 9 | using NPBehave; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 12 | { 13 | public abstract class ASkillSNode :ANPBehaveNode 14 | { 15 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 16 | private IIcSkSEntityManager _entityManager; 17 | 18 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 19 | private IIcSkSEntity _target; 20 | 21 | protected IIcSkSEntityManager EntityManager => GetInputValue(nameof(_entityManager),_entityManager); 22 | 23 | public IIcSkSEntity Target => GetInputValue(nameof(_target),_target); 24 | } 25 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Attributes/APortTooltipAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes 4 | { 5 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,AllowMultiple = false,Inherited = false)] 6 | public class APortTooltipAttribute:Attribute 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Attributes/PortTooltipAttribute.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月19日-22:24 6 | //Assembly-CSharp 7 | 8 | using System; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes 11 | { 12 | /// 13 | /// 临时的节点提示 14 | /// 15 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,AllowMultiple = false,Inherited = false)] 16 | public class PortTooltipAttribute:APortTooltipAttribute 17 | { 18 | /// 19 | /// 悬浮的提示 20 | /// 21 | public string Tooltip { get; } 22 | 23 | /// 24 | /// 方法或属性名 25 | /// 26 | public string MethodOrPropertyName { get; } 27 | 28 | /// 29 | /// 30 | /// 31 | /// 节点是输入时悬浮的提示 32 | public PortTooltipAttribute(string tooltip) 33 | { 34 | Tooltip = tooltip; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Attributes/PortTooltipMethodOrPropertyGetAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes 4 | { 5 | /// 6 | /// 临时的节点提示 -- 方法或属性名, 方法优先级高于属性 7 | /// string xxx(){} 8 | /// string xxxxx => "" 9 | /// 10 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,AllowMultiple = false,Inherited = false)] 11 | public class PortTooltipMethodOrPropertyGetAttribute:APortTooltipAttribute 12 | { 13 | /// 14 | /// 方法或属性名 15 | /// 16 | public string MethodOrPropertyName { get; } 17 | 18 | /// 19 | /// 20 | /// 21 | /// 节点是输入时悬浮的提示 22 | public PortTooltipMethodOrPropertyGetAttribute(string tooltip) 23 | { 24 | MethodOrPropertyName = tooltip; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/CabinIcarus.IcSkillSystem.xNodeIc.Base.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.xNodeIc.Base", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime", 5 | "XNode", 6 | "CabinIcarus.NPBehave" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [] 16 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/ChildGroupNode.cs: -------------------------------------------------------------------------------- 1 | using XNode; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/ChildGroup/Main")] 6 | public class ChildGroupNode:ANPBehaveNode 7 | { 8 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 9 | private NPBehave.Node _main; 10 | 11 | #if UNITY_EDITOR 12 | public const string MainNodeFieldName = nameof(_main); 13 | #endif 14 | internal GetChildGroupNode GetChildGroupNode; 15 | 16 | protected override NPBehave.Node GetOutValue() 17 | { 18 | _main = GetInputValue(nameof(_main), _main); 19 | 20 | return _main; 21 | } 22 | 23 | protected override object GetPortValue(NodePort port) 24 | { 25 | return GetChildGroupNode.GetInputValue(port.fieldName); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/ChildGroupNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12cc93db3f28fd2429132296a8593da7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Base/GetChildGroupNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4426433802f143ba852374eb312dcf54 3 | timeCreated: 1575205180 -------------------------------------------------------------------------------- /xNode_IcSkill/Base/IIcSkillSystemNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.xNode_Group; 2 | 3 | namespace CabinIcarus.IcSkillSystem 4 | { 5 | public interface IIcSkillSystemNode 6 | { 7 | IcSkillGroup SkillGroup { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/IOutPutName.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月23日-00:59 6 | //Assembly-CSharp 7 | 8 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 9 | { 10 | public interface IOutPutName 11 | { 12 | string OutPutName { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/IcSkillGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aeaa421bd2db8dc46976b8cc2922fd5e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Composite/ACompositeNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-23:01 6 | //Assembly-CSharp 7 | 8 | using System.Collections.Generic; 9 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 10 | using NPBehave; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 13 | { 14 | public abstract class ACompositeNode:ANPBehaveNode where T : Node 15 | { 16 | [Input(typeConstraint = TypeConstraint.Inherited)] 17 | [PortTooltip("节点,可多个")] 18 | private Node _nodes; 19 | 20 | protected override T GetOutValue() 21 | { 22 | var nodes = GetInputValues(nameof(_nodes), _nodes); 23 | 24 | if (nodes == null) 25 | return null; 26 | 27 | return GetNode(nodes); 28 | } 29 | 30 | protected abstract T GetNode(IEnumerable inputNodes); 31 | } 32 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/ABlackboardQueryNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | public abstract class ABlackboardQueryNode:AObservingDecoratorNode 7 | { 8 | [SerializeField] 9 | private string[] _keys; 10 | 11 | protected override BlackboardQuery GetDecoratorNode() 12 | { 13 | return new BlackboardQuery(_keys,Stops,IsConditionMet,DecorateeNode); 14 | } 15 | 16 | protected abstract bool IsConditionMet(); 17 | } 18 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/AConditionNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月22日-00:08 6 | //Assembly-CSharp 7 | 8 | using NPBehave; 9 | using UnityEngine; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 12 | { 13 | public abstract class AConditionNode:AObservingDecoratorNode 14 | { 15 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 16 | private float _checkInterval; 17 | 18 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 19 | private float _randomVariance; 20 | 21 | protected sealed override Condition GetDecoratorNode() 22 | { 23 | return new Condition(Condition,Stops,GetInputValue(nameof(_checkInterval),_checkInterval), 24 | GetInputValue(nameof(_randomVariance),_randomVariance),DecorateeNode); 25 | } 26 | 27 | protected abstract bool Condition(); 28 | } 29 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/ADecoratorNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | public abstract class ADecoratorNode:ANPBehaveNode where T : Node 7 | { 8 | [Input(ShowBackingValue.Unconnected,ConnectionType.Override,TypeConstraint.Inherited)] 9 | protected Node _decorateeNode; 10 | 11 | protected Node DecorateeNode; 12 | protected sealed override T GetOutValue() 13 | { 14 | DecorateeNode = GetInputValue(nameof(_decorateeNode), _decorateeNode); 15 | 16 | return GetDecoratorNode(); 17 | } 18 | 19 | protected abstract T GetDecoratorNode(); 20 | } 21 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/AObserverNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 4 | { 5 | public abstract class AObserverNode:ADecoratorNode 6 | { 7 | protected override Observer GetDecoratorNode() 8 | { 9 | return new Observer(OnStart,OnStop,DecorateeNode); 10 | } 11 | 12 | protected abstract void OnStop(bool result); 13 | 14 | protected abstract void OnStart(); 15 | } 16 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/AObservingDecoratorNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-23:59 6 | //Assembly-CSharp 7 | 8 | using NPBehave; 9 | using UnityEngine; 10 | 11 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 12 | { 13 | public abstract class AObservingDecoratorNode:ADecoratorNode where T : Node 14 | { 15 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 16 | private Stops _stops; 17 | 18 | protected Stops Stops => GetInputValue(nameof(_stops), _stops); 19 | } 20 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/AServiceNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | public abstract class AServiceNode:ADecoratorNode 7 | { 8 | [SerializeField] 9 | private float _interval; 10 | 11 | [SerializeField] 12 | private float _randomVariation; 13 | 14 | protected override Service GetDecoratorNode() 15 | { 16 | return new Service(_interval, _randomVariation,Execute, DecorateeNode); 17 | } 18 | 19 | protected abstract void Execute(); 20 | } 21 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Decorator/AWaitForConditionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | public abstract class AWaitForConditionNode:ADecoratorNode 7 | { 8 | [SerializeField] 9 | private float _checkInterval; 10 | 11 | [SerializeField] 12 | private float _randomVariance; 13 | 14 | protected override WaitForCondition GetDecoratorNode() 15 | { 16 | return new WaitForCondition(Condition, _checkInterval, _randomVariance, DecorateeNode); 17 | } 18 | 19 | protected abstract bool Condition(); 20 | } 21 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Task/AWaitNode_GetSecondsNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/FuncAction Get Seconds")] 7 | [NodeWidth(300)] 8 | public abstract class AWaitNode_GetSecondsNode:ANPBehaveNode 9 | { 10 | [SerializeField] 11 | private float _randomVariance; 12 | 13 | protected override Wait GetOutValue() 14 | { 15 | return new Wait(GetSeconds,_randomVariance); 16 | } 17 | 18 | protected abstract float GetSeconds(); 19 | } 20 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Task/Action/AActionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 4 | { 5 | public abstract class AActionNode : ANPBehaveNode 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/Nodes/Task/Action/AMultiFrameActionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | public abstract class AMultiFrameAction:AActionNode 7 | { 8 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 9 | private Action.Result _executeResult = Action.Result.PROGRESS; 10 | 11 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 12 | private Action.Result _completeResult = Action.Result.SUCCESS; 13 | 14 | protected Action.Result ExecuteResult => GetInputValue(nameof(_executeResult),_executeResult); 15 | 16 | protected Action.Result CompleteResult => GetInputValue(nameof(_completeResult),_completeResult); 17 | 18 | protected sealed override Action GetOutValue() 19 | { 20 | return new Action(Execute); 21 | } 22 | 23 | protected virtual Action.Result Execute(Action.Request arg) 24 | { 25 | if (arg == Action.Request.CANCEL) 26 | { 27 | return Complete(); 28 | } 29 | 30 | return ExecuteResult; 31 | } 32 | 33 | protected virtual Action.Result Complete() 34 | { 35 | return CompleteResult; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/RootNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Root")] 8 | public class RootNode : ANPBehaveNode 9 | { 10 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 11 | [PortTooltip("黑板")] 12 | private Blackboard _blackBoard; 13 | 14 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 15 | [PortTooltip("Clock")] 16 | private Clock _clok; 17 | 18 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 19 | [PortTooltip("主节点")] 20 | private Node _mainNode; 21 | 22 | protected override Root GetOutValue() 23 | { 24 | var black = GetInputValue(nameof(_blackBoard),_blackBoard); 25 | var clok = GetInputValue(nameof(_clok), _clok); 26 | var mainNode = GetInputValue(nameof(_mainNode)); 27 | if (black != null && clok != null && mainNode != null) 28 | { 29 | return new Root(black,clok,mainNode); 30 | } 31 | 32 | return null; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Base/RootNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01317fd21427d0d4ebdd4122d47b1468 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/CabinIcarus.IcSkillSystem.xNodeIc.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.xNodeIc.Editor", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime", 5 | "CabinIcarus.IcSkillSystem.Expansion.Runtime", 6 | "CabinIcarus.IcSkillSystem.xNodeIc.Base", 7 | "CabinIcarus.IcSkillSystem.xNodeIc", 8 | "CabinIcarus.NPBehave", 9 | "XNode", 10 | "XNodeEditor", 11 | "CabinIcarus.IcSkillSystem.Editor" 12 | ], 13 | "includePlatforms": [ 14 | "Editor" 15 | ], 16 | "excludePlatforms": [], 17 | "allowUnsafeCode": false, 18 | "overrideReferences": false, 19 | "precompiledReferences": [], 20 | "autoReferenced": true, 21 | "defineConstraints": [], 22 | "versionDefines": [] 23 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/ABuffNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 4 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems.Buff; 5 | using UnityEngine; 6 | using XNode; 7 | using XNodeEditor; 8 | using Node = NPBehave.Node; 9 | 10 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor 11 | { 12 | public abstract class ABuffNodeEditor:AQNameSelectEditor 13 | { 14 | protected override Type GetBaseType() 15 | { 16 | return typeof(IBuffDataComponent); 17 | } 18 | 19 | protected override string GetAQNamePropertyName() 20 | { 21 | return "_buffAQName"; 22 | } 23 | 24 | protected override void Init() 25 | { 26 | base.Init(); 27 | 28 | UpdateDynamicPort(); 29 | } 30 | 31 | protected override void DrawBody() 32 | { 33 | DrawSelectPop(new GUIContent("Buff: ")); 34 | 35 | base.DrawBody(); 36 | } 37 | 38 | protected override IEnumerable GetDynamicPort() 39 | { 40 | return TNode.DynamicInputs; 41 | } 42 | } 43 | 44 | [CustomNodeEditor(typeof(AddOrRemoveBuffNode))] 45 | public class AddOrRemoveBuffNodeEditor:ABuffNodeEditor 46 | { 47 | } 48 | 49 | [CustomNodeEditor(typeof(HasBuffConditionNode))] 50 | public class HasBuffNodeNodeEditor:ABuffNodeEditor 51 | { 52 | } 53 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/ANPBehaveNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 3 | using NPBehave; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor 7 | { 8 | public abstract class ANPBehaveNodeEditor: ANPNodeEditor where T : ANPBehaveNode where AT : Node 9 | { 10 | protected override void ColorCheck() 11 | { 12 | var NPBNodeInputs = TNode.Inputs.Where(x => typeof(Node).IsAssignableFrom(x.ValueType)); 13 | 14 | foreach (var nodePort in NPBNodeInputs) 15 | { 16 | if (!nodePort.IsConnected) 17 | { 18 | Error = true; 19 | } 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/AUseSkillNodeEidotr.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月20日-00:17 6 | //Assembly-CSharp-Editor 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 11 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems; 12 | using UnityEditor; 13 | using UnityEngine; 14 | using XNode; 15 | using XNodeEditor; 16 | 17 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor 18 | { 19 | [CustomNodeEditor(typeof(UseSkillNodeNodeAction))] 20 | public abstract class AUseSkillNodeEditor:AQNameSelectEditor 21 | { 22 | protected override Type GetBaseType() 23 | { 24 | return typeof(ISkillDataComponent); 25 | } 26 | 27 | protected override string GetAQNamePropertyName() 28 | { 29 | return "_skillComponentAQName"; 30 | } 31 | 32 | protected override IEnumerable GetDynamicPort() 33 | { 34 | return TNode.DynamicInputs; 35 | } 36 | 37 | protected override void Init() 38 | { 39 | base.Init(); 40 | 41 | UpdateDynamicPort(); 42 | } 43 | 44 | protected override void DrawBody() 45 | { 46 | DrawSelectPop(new GUIContent("Skill: ")); 47 | 48 | base.DrawBody(); 49 | } 50 | 51 | } 52 | 53 | [CustomNodeEditor(typeof(UseSkillNodeNodeAction))] 54 | public class UseSkillNodeNodeActionEditor : AUseSkillNodeEditor 55 | { 56 | } 57 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/SkillConditionNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Condition; 4 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 5 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems; 6 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 7 | using NPBehave; 8 | using UnityEditor; 9 | using UnityEngine; 10 | using XNodeEditor; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor 13 | { 14 | [CustomNodeEditor(typeof(SkillConditionNode))] 15 | public class SkillConditionNodeEditor:AQNameSelectEditor 16 | { 17 | protected override Type GetBaseType() 18 | { 19 | return typeof(ACondition); 20 | } 21 | 22 | protected override void Init() 23 | { 24 | base.Init(); 25 | UpdateDynamicPort(); 26 | } 27 | 28 | protected override void DrawBody() 29 | { 30 | DrawSelectPop(new GUIContent("Skill Condition")); 31 | 32 | base.DrawBody(); 33 | } 34 | 35 | protected override string GetAQNamePropertyName() 36 | { 37 | return "_conditionAQName"; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/Utils/GUIUtil.cs: -------------------------------------------------------------------------------- 1 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor.Utils 2 | { 3 | 4 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_NPBehave_Node/Utils/NodeEx.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using UnityEditor; 3 | using XNode; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Editor.Utils 6 | { 7 | public static class NodeEx 8 | { 9 | public static void PortRename(this Node self,NodePort port,string newName) 10 | { 11 | if (port == null) 12 | { 13 | return; 14 | } 15 | 16 | var oldName = port.fieldName; 17 | 18 | var fieldNameFieldInfo = port.GetType().GetField(NodePort.FieldNameEditor,BindingFlags.Instance | BindingFlags.NonPublic); 19 | 20 | fieldNameFieldInfo.SetValue(port,newName); 21 | 22 | SerializedObject nodeSerObj = new SerializedObject(self); 23 | 24 | var portsSer = nodeSerObj.FindProperty(Node.PortFieldName); 25 | 26 | var keysSer = portsSer.FindPropertyRelative(Node.KeysFieldName); 27 | 28 | for (var i = 0; i < keysSer.arraySize; i++) 29 | { 30 | if (keysSer.GetArrayElementAtIndex(i).stringValue == oldName) 31 | { 32 | keysSer.GetArrayElementAtIndex(i).stringValue = newName; 33 | break; 34 | } 35 | } 36 | 37 | nodeSerObj.ApplyModifiedProperties(); 38 | 39 | EditorUtility.SetDirty(self); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Editor/xNode_Nodes/Template/ValueNodeTemplate.cs.txt: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace %NAMESPACE% 6 | { 7 | [CreateNodeMenu("CabinIcarus/Nodes/%ASSEMBLY%/%NAME% Value")] 8 | public partial class %NAME%ValueNode:ValueNode 9 | { 10 | [SerializeField] 11 | private %TYPE% _value; 12 | 13 | public override Type ValueType { get; } = typeof(%TYPE%); 14 | 15 | protected override object GetOutValue() 16 | { 17 | return _value; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/CabinIcarus.IcSkillSystem.xNodeIc.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CabinIcarus.IcSkillSystem.xNodeIc", 3 | "references": [ 4 | "CabinIcarus.IcSkillSystem.Runtime", 5 | "CabinIcarus.IcSkillSystem.xNodeIc.Base", 6 | "CabinIcarus.NPBehave", 7 | "XNode", 8 | "CabinIcarus.IcSkillSystem.BuffFactory", 9 | "CabinIcarus.IcSkillSystem.Expansion.Runtime" 10 | ], 11 | "includePlatforms": [], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [] 19 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/BlackboardNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | using Node = XNode.Node; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 7 | { 8 | public abstract class BlackboardNode:ANPNode 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/BlackboardNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d24c55f4670f440494cc60624628edc4 3 | timeCreated: 1568879089 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/CreateBlackboardNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Create")] 8 | public class CreateBlackboardNode:BlackboardNode 9 | { 10 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 11 | protected Clock Clock; 12 | 13 | private Blackboard _black; 14 | 15 | protected override Blackboard GetOutValue() 16 | { 17 | var clock = GetInputValue(nameof(Clock), Clock); 18 | 19 | if (clock != null) 20 | // 每个node 之应该创建一个 21 | if (_black == null) 22 | _black = new Blackboard(clock); 23 | 24 | return _black; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/CreateBlackboardNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e4c096369cbca146b2a9b53106493e0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/CreateBlackboardParentNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Create Parent")] 8 | public class CreateBlackboardParentNode:CreateBlackboardNode 9 | { 10 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 11 | private Blackboard _blackboardNodeInput; 12 | 13 | private Blackboard _black; 14 | 15 | protected override Blackboard GetOutValue() 16 | { 17 | var clock = GetInputValue(nameof(Clock), Clock); 18 | var parent = GetInputValue(nameof(_blackboardNodeInput), _blackboardNodeInput); 19 | if (clock != null && parent != null) 20 | // 每个node 之应该创建一个 21 | if (_black == null) 22 | _black = new Blackboard(parent,clock); 23 | 24 | return _black; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/CreateBlackboardParentNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9e559a956b410c4ea7ab0d4a31fb4e6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/GetBlackboardValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using CabinIcarus.IcSkillSystem.Runtime.xNode_Nodes; 4 | using NPBehave; 5 | using UnityEngine; 6 | using Node = XNode.Node; 7 | 8 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 9 | { 10 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Get Blackboard Value")] 11 | public class GetBlackboardValue:ValueNode 12 | { 13 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 14 | [PortTooltip("no input use Blackboard of from Root")] 15 | private Blackboard _blackBoard; 16 | 17 | [SerializeField] 18 | private string _key; 19 | 20 | public override Type ValueType { get; } = typeof(object); 21 | 22 | public override bool IsChangeValueType { get; } = true; 23 | 24 | protected override object GetOutValue() 25 | { 26 | 27 | #if UNITY_EDITOR 28 | if (!Application.isPlaying) 29 | { 30 | return null;; 31 | } 32 | #endif 33 | var blackboard = GetInputValue(nameof(_blackBoard), _blackBoard); 34 | 35 | if (blackboard == null) 36 | { 37 | blackboard = SkillGroup.RootNode.Blackboard; 38 | } 39 | 40 | 41 | return blackboard.Get(_key); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/GetBlackboardValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6fc2cf419fa7b14e82682c6e375026c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/GetOwnerBlackboardNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Expansion.Builtin.Component; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 3 | using NPBehave; 4 | using UnityEngine; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 7 | { 8 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Get Owner")] 9 | public class GetOwnerBlackboardNode : BlackboardNode 10 | { 11 | [SerializeField, Input(ShowBackingValue.Never, ConnectionType.Override, TypeConstraint.Strict)] 12 | [PortTooltipMethodOrPropertyGet(nameof(_port))] 13 | private bool _useUnityContextClock; 14 | 15 | protected override Blackboard GetOutValue() 16 | { 17 | var blackboard = SkillGroup.Owner.GetComponent(); 18 | 19 | if (!blackboard) 20 | { 21 | blackboard = SkillGroup.Owner.AddComponent(); 22 | blackboard.UseUnityContextClock = GetInputValue(nameof(_useUnityContextClock), _useUnityContextClock); 23 | } 24 | 25 | if (blackboard.Blackboard == null) 26 | { 27 | blackboard.Init(); 28 | } 29 | 30 | return blackboard.Blackboard; 31 | } 32 | 33 | private string _port => 34 | $"When the owner does not have the `{nameof(SelfBlackBoardComponent)}` component, `Clock` uses `UnityContext` or self when adding the ` {nameof(SelfBlackBoardComponent)}` component. true uses UnityContent, false to use self"; 35 | } 36 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/GetOwnerBlackboardNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01f116b1429de1a478303138a6265fdd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/SetBlackBoardValueActionNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年11月18日-02:59 6 | //CabinIcarus.IcSkillSystem.xNodeIc 7 | 8 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 9 | using NPBehave; 10 | using UnityEngine; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 13 | { 14 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Set Blackboard Value")] 15 | public class SetBlackBoardValueActionNode:ANPBehaveNode 16 | { 17 | [SerializeField,Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 18 | [PortTooltip("黑板")] 19 | private Blackboard _blackBoard; 20 | 21 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 22 | [PortTooltip("New Value")] 23 | private object _newValue; 24 | 25 | [SerializeField] 26 | private string _key; 27 | 28 | protected override Action GetOutValue() 29 | { 30 | return new Action(_set); 31 | } 32 | 33 | private void _set() 34 | { 35 | var blackboard = GetInputValue(nameof(_blackBoard), _blackBoard); 36 | 37 | var newValue = GetInputValue(nameof(_newValue),_newValue); 38 | 39 | blackboard?.Set(_key,newValue); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/SetBlackBoardValueActionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6db5d62d748d865488ca96d82e9a0365 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/SharedBlackboardNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Blackboard/Get Shared")] 8 | public class SharedBlackboardNode:BlackboardNode 9 | { 10 | [SerializeField,Input(ShowBackingValue.Unconnected,ConnectionType.Override,TypeConstraint.Strict)] 11 | private string _key; 12 | 13 | protected override Blackboard GetOutValue() 14 | { 15 | var key = GetInputValue(nameof(_key), _key); 16 | 17 | return UnityContext.GetSharedBlackboard(key); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Blackboard/SharedBlackboardNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a5665902fc8bde47ad570f3c553ad30 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/ClockNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | using Node = XNode.Node; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 7 | { 8 | public abstract class ClockNode:ANPNode 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/ClockNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed2f72304efc48748c8bdb07107dfb85 3 | timeCreated: 1568879154 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/CreateClockNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Clock/Create")] 8 | public class CreateClockNode:ClockNode 9 | { 10 | protected override Clock GetOutValue() 11 | { 12 | return new Clock(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/CreateClockNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc1ba9205505c764d92e44ae14d16c7e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/UnityContextClockNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NPBehave; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime 7 | { 8 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Clock/Get UnityContext")] 9 | public class UnityContextClockNode:ClockNode 10 | { 11 | protected override Clock GetOutValue() 12 | { 13 | return UnityContext.GetClock(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Clock/UnityContextClockNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f3174f2c8b643a409670379acbd1b6f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/ParallelNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-19:30 6 | //Assembly-CSharp 7 | 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using NPBehave; 11 | using UnityEngine; 12 | 13 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 14 | { 15 | [XNode.Node.CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Composite/Parallel")] 16 | public class ParallelNode:ACompositeNode 17 | { 18 | [SerializeField] 19 | private Parallel.Policy _successPolicy; 20 | 21 | [SerializeField] 22 | private Parallel.Policy _failurePolicy; 23 | 24 | protected override Parallel GetNode(IEnumerable inputNodes) 25 | { 26 | return new Parallel(_successPolicy,_failurePolicy,inputNodes.ToArray()); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/ParallelNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0489a26a8ae4630a622333ff7601316 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/RandomSelectorNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-23:06 6 | //Assembly-CSharp 7 | 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using NPBehave; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 13 | { 14 | [XNode.Node.CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Composite/Random Selector")] 15 | public class RandomSelectorNode:ACompositeNode 16 | { 17 | protected override RandomSelector GetNode(IEnumerable inputNodes) 18 | { 19 | return new RandomSelector(inputNodes.ToArray()); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/RandomSelectorNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 885f4aaccdd14e2a840abc04ad029d1c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/RandomSequenceNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-23:07 6 | //Assembly-CSharp 7 | 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using NPBehave; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 13 | { 14 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Composite/Random Sequence")] 15 | public class RandomSequenceNode:ACompositeNode 16 | { 17 | protected override RandomSequence GetNode(IEnumerable inputNodes) 18 | { 19 | return new RandomSequence(inputNodes.ToArray()); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/RandomSequenceNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66bc687373254961b080a32ead456885 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/SelectorNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月21日-23:05 6 | //Assembly-CSharp 7 | 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using NPBehave; 11 | 12 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 13 | { 14 | [XNode.Node.CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Composite/Selector")] 15 | public class SelectorNode:ACompositeNode 16 | { 17 | protected override Selector GetNode(IEnumerable inputNodes) 18 | { 19 | return new Selector(inputNodes.ToArray()); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/SelectorNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 961fc06df4dd41369574f7617baefe71 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/SequenceNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using NPBehave; 4 | using Node = NPBehave.Node; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Composite 7 | { 8 | [XNode.Node.CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Composite/Sequence")] 9 | public class SequenceNode : ACompositeNode 10 | { 11 | protected override Sequence GetNode(IEnumerable inputNodes) 12 | { 13 | return new Sequence(inputNodes.ToArray()); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Composite/SequenceNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7179220c8971cb49962533167236059 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/BlackboardConditionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Blackboard Condition")] 7 | public class BlackboardConditionNode:AObservingDecoratorNode 8 | { 9 | [SerializeField] 10 | private string _key; 11 | 12 | [SerializeField] 13 | private Operator _operator; 14 | 15 | [Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Inherited)] 16 | private object _value; 17 | 18 | protected override BlackboardCondition GetDecoratorNode() 19 | { 20 | _value = GetInputValue(nameof(_value),_value); 21 | 22 | return new BlackboardCondition(_key,_operator,_value,Stops,DecorateeNode); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/BlackboardConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39f82dfbc697e444da4cf4b4deb1e2d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/CooldownNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Cooldown")] 7 | public class CooldownNode:ADecoratorNode 8 | { 9 | [SerializeField] 10 | private float _cooldownTime; 11 | [SerializeField] 12 | private float _randomVariation; 13 | 14 | [SerializeField] 15 | private bool _startAfterDecoratee; 16 | [SerializeField] 17 | private bool _resetOnFailiure; 18 | 19 | protected override Cooldown GetDecoratorNode() 20 | { 21 | return new Cooldown(_cooldownTime,_randomVariation,_startAfterDecoratee,_resetOnFailiure,DecorateeNode); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/CooldownNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 491723534cfee444db4ec489e2f34c86 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/FailerNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Failer")] 6 | public class FailerNode:ADecoratorNode 7 | { 8 | protected override Failer GetDecoratorNode() 9 | { 10 | return new Failer(DecorateeNode); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/FailerNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2744e32997279e74b8913770cb238a83 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/InverterNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Inverter")] 6 | public class InverterNode:ADecoratorNode 7 | { 8 | protected override Inverter GetDecoratorNode() 9 | { 10 | return new Inverter(DecorateeNode); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/InverterNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7125ee61d5eea924f9310ef5558ac8a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/ObserverNode.cs: -------------------------------------------------------------------------------- 1 | using XNode; 2 | using Node = NPBehave.Node; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Observer")] 7 | public class ObserverNode:AObserverNode 8 | { 9 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 10 | private Node _start; 11 | 12 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 13 | private Node _stop; 14 | 15 | [Output()] 16 | private bool _stopResult; 17 | 18 | protected override void OnStop(bool result) 19 | { 20 | _stopResult = result; 21 | var node = GetInputValue(nameof(_stop), _stop); 22 | _executeNode(node); 23 | } 24 | 25 | protected override void OnStart() 26 | { 27 | var node = GetInputValue(nameof(_start), _start); 28 | _executeNode(node); 29 | } 30 | 31 | void _executeNode(Node node) 32 | { 33 | if (node != null) 34 | { 35 | if (node.RootNode == null) 36 | { 37 | node.SetRoot(OutValue.RootNode); 38 | } 39 | 40 | node.Start(); 41 | } 42 | } 43 | 44 | protected override object GetPortValue(NodePort port) 45 | { 46 | if (port.fieldName == nameof(_stopResult)) 47 | { 48 | return _stopResult; 49 | } 50 | return base.GetPortValue(port); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/ObserverNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 366ac85d34c9483eba0a54666e63731c 3 | timeCreated: 1575880364 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/RandomNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Random = NPBehave.Random; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Random")] 7 | public class RandomNode:ADecoratorNode 8 | { 9 | [SerializeField] 10 | private float _probability; 11 | 12 | protected override Random GetDecoratorNode() 13 | { 14 | return new Random(_probability,DecorateeNode); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/RandomNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ece22cac6f0b1b842bdd5835d04083aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/RepeaterNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Repeater")] 8 | public class RepeaterNode:ADecoratorNode 9 | { 10 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 11 | [PortTooltip("-1 infinitly loop")] 12 | private int _loopCount = -1; 13 | 14 | protected override Repeater GetDecoratorNode() 15 | { 16 | return new Repeater(GetInputValue(nameof(_loopCount),_loopCount), DecorateeNode); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/RepeaterNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdae6d6a9090bb74eb9b6f50289305b5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/SucceederNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Succeeder")] 6 | public class SucceederNode:ADecoratorNode 7 | { 8 | protected override Succeeder GetDecoratorNode() 9 | { 10 | return new Succeeder(DecorateeNode); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/SucceederNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 813c672294e449549a8056006abf5f35 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/TimeMaxNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/TimeMax")] 7 | public class TimeMaxNode:ADecoratorNode 8 | { 9 | [SerializeField] 10 | private float _limit; 11 | 12 | [SerializeField] 13 | private float _randomVariation; 14 | 15 | [SerializeField] 16 | private bool _waitForChildButFailOnLimitReached; 17 | 18 | protected override TimeMax GetDecoratorNode() 19 | { 20 | return new TimeMax(_limit, _randomVariation, _waitForChildButFailOnLimitReached, DecorateeNode); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/TimeMaxNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99f9005d35979634b9c552bc3e46ea9d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/TimeMinNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/TimeMin")] 7 | public class TimeMinNode : ADecoratorNode 8 | { 9 | [SerializeField] 10 | private float _limit; 11 | 12 | [SerializeField] 13 | private float _randomVariation; 14 | 15 | [SerializeField] 16 | private bool _waitOnFailure; 17 | 18 | protected override TimeMin GetDecoratorNode() 19 | { 20 | return new TimeMin(_limit, _randomVariation, _waitOnFailure, DecorateeNode); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/TimeMinNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7acf7cd480dc07b49a0e4c450c198f21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/ValueEqualsConditionNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Decorator/Value Equals Or NoEquals Condition")] 6 | public class ValueEqualsConditionNode:AConditionNode 7 | { 8 | [SerializeField] 9 | private bool _equals; 10 | 11 | [Input(ShowBackingValue.Always,ConnectionType.Override)] 12 | private object _aValue; 13 | 14 | [Input(ShowBackingValue.Always,ConnectionType.Override)] 15 | private object _bValue; 16 | 17 | protected override bool Condition() 18 | { 19 | var aValue = GetInputValue(nameof(_aValue), _aValue); 20 | var bValue = GetInputValue(nameof(_bValue), _bValue); 21 | 22 | return _equals ? _compare(aValue, bValue) : !_compare(aValue,bValue); 23 | } 24 | 25 | private bool _compare(object aValue, object bValue) 26 | { 27 | if (aValue == null && bValue == null) 28 | { 29 | return true; 30 | } 31 | 32 | if (aValue == null) 33 | { 34 | return false; 35 | } 36 | 37 | return aValue.Equals(bValue); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Decorator/ValueEqualsConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9aab5bc464db4a28aa85a9026f8e60cb 3 | timeCreated: 1569483848 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/ABuffNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Components; 3 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Utils; 4 | using NPBehave; 5 | using UnityEngine; 6 | 7 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems.Buff 8 | { 9 | public abstract class ABuffNode:ASkillSNode 10 | { 11 | [SerializeField] 12 | private string _buffAQName; 13 | 14 | protected Type BuffType; 15 | 16 | protected IBuffDataComponent Buff 17 | { 18 | get 19 | { 20 | if (BuffType == null) 21 | { 22 | return null; 23 | } 24 | 25 | return (IBuffDataComponent) this.DynamicInputCreateInstance(BuffType); 26 | } 27 | } 28 | 29 | protected sealed override Node GetOutValue() 30 | { 31 | BuffType = Type.GetType(_buffAQName); 32 | 33 | return Execute(); 34 | } 35 | 36 | protected abstract Node Execute(); 37 | } 38 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/ABuffNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efb23862a219434ebac0709733c42238 3 | timeCreated: 1569466041 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/AddOrRemoveBuffNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | using Action = NPBehave.Action; 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems.Buff 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Skill/Buff/Add or Remove")] 7 | public class AddOrRemoveBuffNode:ABuffNode 8 | { 9 | [SerializeField] 10 | private bool _isAddBuff = true; 11 | 12 | protected override Node Execute() 13 | { 14 | if (_isAddBuff) 15 | { 16 | return new Action(_addBuff); 17 | } 18 | 19 | return new Action(_removeBuff); 20 | } 21 | 22 | private void _removeBuff() 23 | { 24 | BuffFactory.RemoveBuff(EntityManager, Target,Buff); 25 | } 26 | 27 | private void _addBuff() 28 | { 29 | BuffFactory.AddBuff(EntityManager, Target,Buff); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/AddOrRemoveBuffNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5052272d15a649c083de70a4080182c3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/HasBuffConditionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems.Buff 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Skill/Buff/Has Condition")] 7 | public class HasBuffConditionNode:ABuffNode 8 | { 9 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 10 | private Stops _stops; 11 | 12 | [SerializeField,Input(ShowBackingValue.Unconnected,ConnectionType.Override,TypeConstraint.Inherited)] 13 | protected Node DecorateeNode; 14 | 15 | protected override Node Execute() 16 | { 17 | return new Condition(_hasBuff,GetInputValue(nameof(_stops),_stops),GetInputValue(nameof(DecorateeNode),DecorateeNode)); 18 | } 19 | 20 | private bool _hasBuff() 21 | { 22 | return BuffFactory.HasBuff(EntityManager, Target, Buff); 23 | } 24 | 25 | // private IBuffDataComponent _hasBuff() 26 | // { 27 | // //todo 暂时先这样写下 28 | // Debug.LogError("空值比较 -----------"); 29 | // return (IBuffDataComponent) Activator.CreateInstance(BuffType); 30 | // } 31 | } 32 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Buff/HasBuffConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f28c12d1f8898441b9f1e2baf7fad89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/Condition/SkillConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8485c6a0cf6c4e48966e1f81b6b5e14 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/UseSkill/AUseSkillNode.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月25日-20:58 6 | //Assembly-CSharp 7 | 8 | using System; 9 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 10 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Utils; 11 | using CabinIcarus.IcSkillSystem.Runtime.Buffs.Entitys; 12 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Components; 13 | using CabinIcarus.IcSkillSystem.Runtime.Skills.Manager; 14 | using UnityEngine; 15 | using Action = NPBehave.Action; 16 | 17 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems 18 | { 19 | public abstract class AUseSkillNode:ANPNode 20 | { 21 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 22 | protected ISkillManager SkillManager; 23 | 24 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 25 | [PortTooltip("目标")] 26 | protected IIcSkSEntity Target; 27 | 28 | [SerializeField] 29 | private string _skillComponentAQName; 30 | 31 | protected ISkillDataComponent Skill; 32 | 33 | protected sealed override Action GetOutValue() 34 | { 35 | return new Action(_use); 36 | } 37 | 38 | private void _use() 39 | { 40 | SkillManager = GetInputValue(nameof(SkillManager), SkillManager); 41 | Target = GetInputValue(nameof(Target), Target); 42 | 43 | var skillType = Type.GetType(_skillComponentAQName); 44 | 45 | if (skillType == null) 46 | { 47 | return; 48 | } 49 | 50 | Skill = (ISkillDataComponent) this.DynamicInputCreateInstance(skillType); 51 | } 52 | 53 | protected abstract void UseSkill(); 54 | } 55 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/UseSkill/UseSkillNodeNodeAction.cs: -------------------------------------------------------------------------------- 1 | //创建者:Icarus 2 | //手动滑稽,滑稽脸 3 | //ヾ(•ω•`)o 4 | //https://www.ykls.app 5 | //2019年09月19日-23:12 6 | //Assembly-CSharp 7 | 8 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.SkillSystems 9 | { 10 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Skill/Use")] 11 | public class UseSkillNodeNodeAction:AUseSkillNode 12 | { 13 | protected override void UseSkill() 14 | { 15 | SkillManager.UseSkill(Target,Skill); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/SkillSystem/UseSkill/UseSkillNodeNodeAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6452159a5fa01942b3fc38d65f564dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Actions/ActionNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | 3 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 4 | { 5 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Root Start Or Stop")] 6 | public class ActionNode:ANPBehaveNode 7 | { 8 | protected override Action GetOutValue() 9 | { 10 | throw new System.NotImplementedException(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Actions/ActionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc7738d226b64c5f86b4e8625df6bbee 3 | timeCreated: 1575882229 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Actions/RootAction.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Root Start Or Stop")] 7 | public class RootAction:ANPBehaveNode 8 | { 9 | [SerializeField] 10 | private bool _start; 11 | 12 | protected override Action GetOutValue() 13 | { 14 | return new Action(multiframeFunc2: request => 15 | { 16 | if (request != Action.Request.START) 17 | { 18 | return Action.Result.SUCCESS; 19 | } 20 | 21 | var root = OutValue.RootNode; 22 | 23 | if (_start) 24 | { 25 | root.Start(); 26 | } 27 | else 28 | { 29 | root.Stop(); 30 | } 31 | 32 | return Action.Result.PROGRESS; 33 | }); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Actions/RootAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21190344d554466cb20a2a1f96d3ae77 3 | timeCreated: 1573892894 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Debug/DebugActionNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CabinIcarus.IcSkillSystem.Nodes.Runtime; 3 | using UnityEngine; 4 | using Action = NPBehave.Action; 5 | 6 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 7 | { 8 | public enum LogType 9 | { 10 | Log, 11 | Warning, 12 | Error 13 | } 14 | 15 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Actions/Debug")] 16 | public class DebugActionNode:ANPBehaveNode 17 | { 18 | [SerializeField] 19 | public LogType Type; 20 | 21 | [Input(ShowBackingValue.Never,ConnectionType.Override,TypeConstraint.Inherited)] 22 | private object _message; 23 | 24 | protected override Action GetOutValue() 25 | { 26 | return new Action(_log); 27 | } 28 | 29 | private void _log() 30 | { 31 | _message = GetInputValue(nameof(_message)); 32 | 33 | switch (Type) 34 | { 35 | case LogType.Error: 36 | UnityEngine.Debug.LogError(_message); 37 | break; 38 | case LogType.Warning: 39 | UnityEngine.Debug.LogWarning(_message); 40 | break; 41 | case LogType.Log: 42 | UnityEngine.Debug.Log(_message); 43 | break; 44 | default: 45 | throw new ArgumentOutOfRangeException(); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Debug/DebugActionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab478aff09e44f68bf7aa45b2d55311b 3 | timeCreated: 1573888995 -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitConditionNode.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Decorator; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/Seconds Condition")] 7 | public class WaitConditionNode:AConditionNode 8 | { 9 | 10 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 11 | private float _waitTime; 12 | 13 | private bool _init = false; 14 | private float _currentTime; 15 | protected override bool Condition() 16 | { 17 | if (!_init) 18 | { 19 | _init = true; 20 | _currentTime = GetInputValue(nameof(_waitTime), _waitTime); 21 | } 22 | 23 | _currentTime -= Time.fixedDeltaTime; 24 | 25 | if (_currentTime <= 0) 26 | { 27 | _init = false; 28 | return true; 29 | } 30 | 31 | return false; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7611febfa7f8c79439682da6143d8e35 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_BlackboardGetSeconds.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/Blackboard Get Seconds")] 7 | [NodeWidth(300)] 8 | public class WaitNode_BlackboardGetSeconds:ANPBehaveNode 9 | { 10 | [SerializeField] 11 | private string _blackboardKey; 12 | 13 | [SerializeField] 14 | private float _randomVariance; 15 | 16 | protected override Wait GetOutValue() 17 | { 18 | return new Wait(_blackboardKey,_randomVariance); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_BlackboardGetSeconds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db08343b0cb391d44b8962745099b27b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_Seconds.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/Seconds")] 8 | [NodeWidth(300)] 9 | public class WaitNode_Seconds:ANPBehaveNode 10 | { 11 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | private float _seconds; 13 | 14 | protected override Wait GetOutValue() 15 | { 16 | return new Wait(_getSeconds); 17 | } 18 | 19 | private float _getSeconds() 20 | { 21 | return GetInputValue(nameof(_seconds),_seconds); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_Seconds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e58f830937684349a1e02cfdd3cb930 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_SecondsAndRandomVariance.cs: -------------------------------------------------------------------------------- 1 | using CabinIcarus.IcSkillSystem.Nodes.Runtime.Attributes; 2 | using NPBehave; 3 | using UnityEngine; 4 | 5 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 6 | { 7 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/Seconds and Variance")] 8 | [NodeWidth(300)] 9 | public class WaitNode_SecondsAndRandomVariance:ANPBehaveNode 10 | { 11 | [SerializeField,Input(ShowBackingValue.Always,ConnectionType.Override,TypeConstraint.Strict)] 12 | private float _seconds; 13 | 14 | [SerializeField] 15 | private float _randomVariance; 16 | 17 | protected override Wait GetOutValue() 18 | { 19 | return new Wait(_getSeconds(),_randomVariance); 20 | } 21 | 22 | private float _getSeconds() 23 | { 24 | return GetInputValue(nameof(_seconds),_seconds); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitNode_SecondsAndRandomVariance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64dfa57f8b04c1342aaeeaddcff03c45 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitUntilStoppedNode.cs: -------------------------------------------------------------------------------- 1 | using NPBehave; 2 | using UnityEngine; 3 | 4 | namespace CabinIcarus.IcSkillSystem.Nodes.Runtime.Tasks 5 | { 6 | [CreateNodeMenu("CabinIcarus/IcSkillSystem/Behave Nodes/Task/Wait/Until Stopped")] 7 | [NodeWidth(300)] 8 | public class WaitUntilStoppedNode:ANPBehaveNode 9 | { 10 | [SerializeField] 11 | private bool _sucessWhenStopped; 12 | 13 | protected override WaitUntilStopped GetOutValue() 14 | { 15 | return new WaitUntilStopped(_sucessWhenStopped); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /xNode_IcSkill/Runtime/xNode_NPBehave_Node/Nodes/Task/Waits/WaitUntilStoppedNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba09d12fd6449e9499904de225ccc78f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | --------------------------------------------------------------------------------