3UN6NREN32ZBQW4EWI7ED4WVQILCU2EIE7DQGFWZR3OUDCO3ZSPQC 6XQ2S7MOI246AHRKTVDUFBPGM4UCYOFAMGSACBPBC3OAER5W6DNQC T335DLFOLSLEXGXPND75IPX5Z2VCMFUJQZXZCHCK3CN7Q5WZGWKAC SNVZVI6EFLP6UDCYDY3CWR4TK5N2TEUCLYOTY3DUIOQLJ3SM2NIAC DTKCWM4J7PFNWAAES3RZHQGDA6PTDNX4TZVOXAKF5V7LCZBI3XUAC QOAVQCDV2MRAPUX62ZLDTUB6AXYSAGEEWIEZIG4TGIQKCLP5T5GAC IFN4UDLTN7TD26CPONDCRHW4G3DJEXEYV62ZHZC4QD7DKJ76JAEQC 6UYO5OFJ5JDP3ANPDJ3NG66EQHMTBAAP6K4LPRG3DH34R2S4VZUAC L4TF5YRRHYUPEAF72DU2GO3PBK5CXXHPYZB5SX3NRCUN6AQELH2QC CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC HXTSBPAP75A7EC4RKWYQMVPPHPNZFPHUORBZWDHGEB6MPAGI7G7AC XF52N4U7HWXOF4PDSCR7LCUENLTSXLWEZGS2IJ6562KYI567Z2GAC COV4RS6N6Z7PJ5S6LZGNSTP77UJNTKN42OI6K7CBQH6TKCS7ITLQC public List<RuneEffect> RuneEffects = new();public void Cast(EffectContext context) {foreach (var runeEffect in RuneEffects) {var effectData = new EffectInput(context, new Transform[] { context.EffectLocation }, TagFighter.Resources.StatModifierAccessor.Permanent);var root = runeEffect.Nodes.Where(effectStep => effectStep is EffectEndNode).FirstOrDefault() as EffectEndNode;if (root == null) {UnityEngine.Debug.Log("No Root Step For Effect");}else {foreach (var effect in runeEffect.Nodes) {effect.Data = effectData;}root.Run();}}}
fileFormatVersion: 2guid: 4585b32f67d50794cad3c057a0f091a1MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Collections.Generic;using UnityEngine;public class RuneEffect : ScriptableObject{public string Guid;[SerializeField]List<EffectStepNode> _nodes = new();public List<EffectStepNode> Nodes {get { return _nodes; }}public void AddNode(EffectStepNode node) {_nodes.Add(node);}public void DeleteNode(EffectStepNode node) {_nodes.Remove(node);}}}
fileFormatVersion: 2guid: 0f872a0aa6a91af4595bbd6253e83d4dfolderAsset: yesDefaultImporter:externalObjects: {}userData:assetBundleName:assetBundleVariant:
fileFormatVersion: 2guid: 3dc95a7b871ab2641907a1e7f40b2aeaMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;// using System.Collections.Generic;// using UnityEngine;using System;using System.Collections.Generic;namespace TagFighter.Effects{[Serializable]public class SinglePort<PortType> : IPort<PortType>where PortType : EffectStepNode{public PortType Node;public Type InnerType => typeof(PortType);public PortCapacity Capacity => PortCapacity.Single;public IEnumerable<EffectStepNode> Connections() {if (Node != null) {yield return Node;}}public bool IsAllowedConnect(EffectStepNode node) {// UnityEngine.Debug.Log($"{node.GetType()} {typeof(PortType)} {node as PortType}");return node is PortType;}public bool TryConnect(EffectStepNode node) {var success = false;if (IsAllowedConnect(node)) {Node = node as PortType;success = true;}return success;}public bool TryDisconnect(EffectStepNode value) {var success = false;if (ReferenceEquals(Node, value)) {Node = null;success = true;}return success;}}}
fileFormatVersion: 2guid: 5568df72189813a4495aee285a7eeb1dMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
using System;using System.Collections.Generic;namespace TagFighter.Effects{[Serializable]public class MultiPort<PortType> : IPort<PortType>where PortType : EffectStepNode{public List<PortType> Nodes = new();public Type InnerType => typeof(PortType);public PortCapacity Capacity => PortCapacity.Multi;public IEnumerable<EffectStepNode> Connections() {return Nodes;}public bool IsAllowedConnect(EffectStepNode node) {return node is PortType;}public bool TryConnect(EffectStepNode node) {var success = false;if (IsAllowedConnect(node)) {Nodes.Add(node as PortType);success = true;}return success;}public bool TryDisconnect(EffectStepNode value) {var success = false;var inputNode = value as PortType;if (inputNode != null) {Nodes.Remove(inputNode);success = true;}return success;}}}
fileFormatVersion: 2guid: 5682a78b3327e264da73c87539a3c91fMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Collections.Generic;public interface IPort<out PortType>where PortType : EffectStepNode{public System.Type InnerType {get;}public bool IsAllowedConnect(EffectStepNode node);public PortCapacity Capacity { get; }public bool TryConnect(EffectStepNode node);public bool TryDisconnect(EffectStepNode node);public IEnumerable<EffectStepNode> Connections();}}
fileFormatVersion: 2guid: 47686678ca1657841be5cfc89a2ce95cfolderAsset: yesDefaultImporter:externalObjects: {}userData:assetBundleName:assetBundleVariant:
fileFormatVersion: 2guid: bfce83ffec5b7b14a85ec10ce4e193abMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Collections.Generic;using System.Linq;using CareBoo.Serially;public class ZipStep : SequenceGetterStep{[UnityEngine.SerializeField]MultiPort<SequenceGetterStep> _in = new();[UnityEngine.SerializeReference, ShowSerializeReference]public IResourceOperator Operator;public override IEnumerable<double> Get() {return _in.Nodes.Select(getter => getter.Get()).Aggregate((current, next) =>current.Zip(next, (first, second) =>Operator.Operate(first, second)));}public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Zip";}}
fileFormatVersion: 2guid: d6d2df47b220a6e4da83d3a02400a38fMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{public abstract class SingleSetterStep : SetterNode{// [SerializeField]// protected SingleGetterStep Input;// public override IEnumerable<IPort<EffectStepNode>> Inputs() {// if (Input != null) {// yield return Input;// }// }}}
fileFormatVersion: 2guid: bd34bf8514de0af4996e67b24ad947e0MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;// using System.Collections.Generic;// using UnityEngine;namespace TagFighter.Effects{public abstract class SingleGetterStep : EffectStepNode{public abstract double Get();}}
fileFormatVersion: 2guid: 197330efc91666644bf5b27d4a453deaMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;// using System.Collections.Generic;// using UnityEngine;namespace TagFighter.Effects{public abstract class SetterNode : EffectStepNode{public abstract void Set();}}
fileFormatVersion: 2guid: d7357abba650b624c8bb40b2d0c77179MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;namespace TagFighter.Effects{public abstract class SequenceSetterStep : SetterNode{// [SerializeField]// protected SequenceGetterStep Input;// public override IEnumerable<EffectStepNode> Inputs() {// if (Input != null) {// yield return Input;// }// }}}
fileFormatVersion: 2guid: aff62bda1997e384eb9fb765aa33b08eMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;// using UnityEngine;using System.Collections.Generic;namespace TagFighter.Effects{public abstract class SequenceGetterStep : EffectStepNode{public abstract IEnumerable<double> Get();}}
fileFormatVersion: 2guid: 2218d79eb8bf91d44964631b5b2626a8MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
using UnityEngine;namespace TagFighter.Effects{public class RuneRunner : MonoBehaviour{[ContextMenuItem("Cast Rune", "Cast")]public RuneRef Rune;public Transform Target;public Transform Caster;void Cast() {if (Rune == null || Target == null || Caster == null) {return;}Debug.Log($"Casting {Rune} By {Caster} On {Target}");var context = new EffectContext() {EffectLocation = Target,Caster = Caster,};Rune.Cast(context);}}}
fileFormatVersion: 2guid: bb9a9a2cce40a384084a18925a111186MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Collections.Generic;using System.Linq;public class RepeatStep : SequenceGetterStep{[UnityEngine.SerializeField]SinglePort<SingleGetterStep> _in = new();public override IEnumerable<double> Get() {var value = _in.Node.Get();return Data.Affected.Select(transform => value);}public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Repeat";}}
fileFormatVersion: 2guid: 844f2211c024f444f876e89a2321a495MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Linq;using System.Reflection;using System.Text;// using System.Collections.Generic;// using System.Linq;public class PawnSetterStep : SequenceSetterStep{[UnityEngine.SerializeField]SinglePort<SequenceGetterStep> _in = new();[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]public CareBoo.Serially.SerializableType Resource;public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Pawn Set";public override void Set() {if (Resource.Type == null) {UnityEngine.Debug.Log($"{Guid} Inner types are null");return;}var getSpecificMethod = typeof(PawnSetterStep).GetMethod(nameof(SetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0]);var value = getSpecificMethod.Invoke(this, null);}void SetSpecific<TResource, TUnitType>()where TResource : Resources.Resource<TUnitType>where TUnitType : Resources.IUnitType {var result = _in.Node.Get();var message = new StringBuilder();foreach (var res in result) {message.Append($"{res} ,");}UnityEngine.Debug.Log($"{nameof(PawnSetterStep)} result {message}");var set = result.Zip(Data.Affected.Select(transform => transform.GetComponent<TResource>()), (value, resource) => (value, resource));foreach (var (value, resource) in set) {Data.StatAccessor.AddCurrentModifier(resource, (Resources.Unit<TUnitType>)value);}}}}
fileFormatVersion: 2guid: 9aba2983d5b304644a37facc1967f5deMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Collections.Generic;using System.Linq;using System.Reflection;// using System.Linq;public class PawnGetterStep : SequenceGetterStep{[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]public CareBoo.Serially.SerializableType Resource;public override IEnumerable<double> Get() {if (Resource.Type == null) {UnityEngine.Debug.Log($"{Guid} Inner types are null");return Data.Affected.Select(transform => 0d);}var getSpecificMethod = typeof(PawnGetterStep).GetMethod(nameof(GetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0]);var value = getSpecificMethod.Invoke(this, null);return value as IEnumerable<double>;}IEnumerable<double> GetSpecific<TResource, TUnitType>()where TResource : Resources.Resource<TUnitType>where TUnitType : Resources.IUnitType {UnityEngine.Debug.Log($"{nameof(PawnGetterStep)} {typeof(TResource)}");return Data.Affected.Select(transform => (double)transform.GetComponent<TResource>().GetCurrent().AsPrimitive());}public override IPort<EffectStepNode> Input => null;public override string ShortName => "Pawn Get";}}
fileFormatVersion: 2guid: d1839c979b8eab84c8a7dc0b9c703552MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using System.Collections;// using System.Collections.Generic;// using UnityEngine;namespace TagFighter.Effects{public abstract class GetterNode : EffectStepNode{}}
fileFormatVersion: 2guid: ba8070acc07ec7f448050fe3c5cd4278MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{// using System.Collections.Generic;using System.Linq;public class FoldStep : SingleGetterStep{[UnityEngine.SerializeField]SinglePort<SequenceGetterStep> _in = new();[UnityEngine.SerializeReference, CareBoo.Serially.ShowSerializeReference]public IResourceOperator Operator;public override double Get() {return _in.Node.Get().Aggregate((current, next) => Operator.Operate(current, next));}public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Fold";}}
fileFormatVersion: 2guid: 1e617bbf0f60a3b4ea4e62021fa21a72MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{// using System.Collections.Generic;using UnityEngine;public enum PortCapacity{None = 0,Single = 1,Multi = 2,}/// <summary>/// <see cref="FoldStep"/> Input: Single Sequence<Double> Output: Double/// <see cref="ZipStep"/> Input: Multi Sequence<Double> Output: Sequence<Double>/// <see cref="RepeatStep"/> Input: Single Double Output: Sequence<Double>///////// <see cref="ConstValueStep"/> Input: None Output: Double/// <see cref="ContextGetterStep"/> Input: None Output: Double/// <see cref="PawnGetterStep"/> Input: None Output: Sequence<Double>/// </summary>public abstract class EffectStepNode : ScriptableObject{public Vector2 Position;public string Guid;public EffectInput Data;public abstract IPort<EffectStepNode> Input { get; }public abstract string ShortName { get; }}}
fileFormatVersion: 2guid: ae5625888aa1b3849a0329320febbfa9MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{// using System.Collections.Generic;// using System.Linq;public class EffectEndNode : EffectStepNode{[UnityEngine.SerializeField]SinglePort<SetterNode> _in = new();public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Root";// public override IEnumerable<IPort<EffectStepNode>> Outputs => Enumerable.Empty<IPort<EffectStepNode>>();public void Run() {_in.Node.Set();}}}
fileFormatVersion: 2guid: 95498ab7ed723494fb6b3c000a0f1c35MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Reflection;using TagFighter.Effects.ResourceLocationAccessors.ContextRegisters;public class ContextSetterStep : SingleSetterStep{[UnityEngine.SerializeField]SinglePort<SingleGetterStep> _in = new();[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]public CareBoo.Serially.SerializableType Resource;[CareBoo.Serially.TypeFilter(derivedFrom: typeof(ContextRegister<>))]public CareBoo.Serially.SerializableType Register;public override IPort<EffectStepNode> Input {get {return _in;}}public override string ShortName => "Context Set";public override void Set() {if (Register.Type == null || Resource.Type == null) {UnityEngine.Debug.Log($"{Guid} Inner types are null");return;}var getSpecificMethod = typeof(ContextSetterStep).GetMethod(nameof(SetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0], Register.Type);var value = getSpecificMethod.Invoke(this, null);}void SetSpecific<TResource, TUnitType, TContextRegister>()where TResource : Resources.Resource<TUnitType>where TUnitType : Resources.IUnitTypewhere TContextRegister : IContextRegister {var result = _in.Node.Get();UnityEngine.Debug.Log($"{nameof(ContextSetterStep)} {typeof(TResource)} {typeof(TContextRegister)} result {result}");Data.Context.SetResource<TResource, TUnitType, TContextRegister>((Resources.Unit<TUnitType>)result);}}}
fileFormatVersion: 2guid: c5c37fc06b3d0ad45b6305eb93d68542MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{using System.Reflection;// using System.Collections.Generic;// using System.Linq;using TagFighter.Effects.ResourceLocationAccessors.ContextRegisters;public class ContextGetterStep : SingleGetterStep{[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]public CareBoo.Serially.SerializableType Resource;[CareBoo.Serially.TypeFilter(derivedFrom: typeof(ContextRegister<>))]public CareBoo.Serially.SerializableType Register;public override double Get() {if (Register.Type == null || Resource.Type == null) {UnityEngine.Debug.Log($"{Guid} Inner types are null");return 0;}var getSpecificMethod = typeof(ContextGetterStep).GetMethod(nameof(GetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0], Register.Type);var value = getSpecificMethod.Invoke(this, null);return (int)value;}int GetSpecific<TResource, TUnitType, TContextRegister>()where TResource : Resources.Resource<TUnitType>where TUnitType : Resources.IUnitTypewhere TContextRegister : IContextRegister {UnityEngine.Debug.Log($"{nameof(ContextGetterStep)} {typeof(TResource)} {typeof(TContextRegister)}");return Data.Context.GetResource<TResource, TUnitType, TContextRegister>().AsPrimitive();}public override IPort<EffectStepNode> Input => null;public override string ShortName => "Context Get";}}
fileFormatVersion: 2guid: c419ef0e55c3e694cb24080375e68c2eMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.Effects{// using System.Collections.Generic;// using System.Linq;public class ConstValueStep : SingleGetterStep{[UnityEngine.SerializeField]double _value;public override double Get() {UnityEngine.Debug.Log($"{nameof(ConstValueStep)} = {_value}");return _value;}public override IPort<EffectStepNode> Input => null;public override string ShortName => "Const";}}
%YAML 1.1%TAG !u! tag:unity3d.com,2011:--- !u!114 &11400000MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: c4299eb7af6691f4a82ce6a25fd96981, type: 3}m_Name: Rune 1m_EditorClassIdentifier:RuneSprite: {fileID: 0}Rune:DisplayName:Speed: 0ManaCost: 0Effects:- Mode:rid: -2Effect:rid: 786323897757204480references:version: 2RefIds:- rid: -2type: {class: , ns: , asm: }- rid: 786323897757204480type: {class: UnaryResourceEffect, ns: TagFighter.Effects, asm: Assembly-CSharp}data:From:Resource:rid: -2Location:rid: 786323897757204481Multiplier: 1Addend: 0To:Resource:rid: -2Location:rid: -2Multiplier: 1Addend: 0- rid: 786323897757204481type: {class: Context, ns: TagFighter.Effects.ResourceLocationAccessors.Get,asm: Assembly-CSharp}data:Register:rid: -2
fileFormatVersion: 2guid: 9a3a6cebec0d9f94e982f833295e7fdeNativeFormatImporter:externalObjects: {}mainObjectFileID: 11400000userData:assetBundleName:assetBundleVariant:
%YAML 1.1%TAG !u! tag:unity3d.com,2011:--- !u!114 &-7959464409387560310MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: bfce83ffec5b7b14a85ec10ce4e193ab, type: 3}m_Name: ZipStepm_EditorClassIdentifier:Position: {x: 334, y: 386}Guid: cc7813f0-37d2-44d5-8409-72ef640e47fa_in:Nodes:- {fileID: 3470929320567701890}- {fileID: 6806886774387728050}Operator:rid: 2346208790267035649references:version: 2RefIds:- rid: 2346208790267035649type: {class: Average, ns: TagFighter.Effects.Operators, asm: Assembly-CSharp}--- !u!114 &-7310262609116166999MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 844f2211c024f444f876e89a2321a495, type: 3}m_Name: PawnSetterStepm_EditorClassIdentifier:Position: {x: 677, y: 380}Guid: 92f81450-a6df-4e4d-912d-de9cedc42ad1_in:Node: {fileID: 8736044092964998325}Resource:typeId: 30a0ddc8-3fcf-496a-b578-81dbf333c7ec--- !u!114 &-5841318192641428412MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: c5c37fc06b3d0ad45b6305eb93d68542, type: 3}m_Name: ContextGetterStepm_EditorClassIdentifier:Position: {x: 337, y: 380}Guid: 938c11fc-01ec-42e1-9011-b345df3cb2cfResource:typeId: da13f1c1-4359-4eb9-b969-7db50afe6423Register:typeId: 47eae1ff-9ff5-41fd-b08e-0f674b3848e6--- !u!114 &-4619482893835212189MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 95498ab7ed723494fb6b3c000a0f1c35, type: 3}m_Name: ContextSetterStepm_EditorClassIdentifier:Position: {x: 674, y: 386}Guid: dec38d9a-6558-4198-8cf5-88d7803084f4_in:Node: {fileID: -1307332316521653590}Resource:typeId: da13f1c1-4359-4eb9-b969-7db50afe6423Register:typeId: 47eae1ff-9ff5-41fd-b08e-0f674b3848e6--- !u!114 &-3229689855982809186MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 4585b32f67d50794cad3c057a0f091a1, type: 3}m_Name: 270aa0c6-4d02-473f-9070-b95a78891ce1m_EditorClassIdentifier:Guid: 270aa0c6-4d02-473f-9070-b95a78891ce1_nodes:- {fileID: -1327748367674765543}- {fileID: -5841318192641428412}- {fileID: 8736044092964998325}- {fileID: -7310262609116166999}--- !u!114 &-1327748367674765543MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: ae5625888aa1b3849a0329320febbfa9, type: 3}m_Name: EffectEndNodem_EditorClassIdentifier:Position: {x: 865.8, y: 380}Guid: 990a7b12-86b0-4294-aafd-6ce87974a50f_in:Node: {fileID: -7310262609116166999}--- !u!114 &-1307332316521653590MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: ba8070acc07ec7f448050fe3c5cd4278, type: 3}m_Name: FoldStepm_EditorClassIdentifier:Position: {x: 514, y: 386}Guid: 1f753776-c588-4623-be3a-2ecc8a6d28c7_in:Node: {fileID: -7959464409387560310}Operator:rid: 2346208790267035648references:version: 2RefIds:- rid: 2346208790267035648type: {class: Sum, ns: TagFighter.Effects.Operators, asm: Assembly-CSharp}--- !u!114 &-649113059712602876MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: ae5625888aa1b3849a0329320febbfa9, type: 3}m_Name: EffectEndNodem_EditorClassIdentifier:Position: {x: 873, y: 386}Guid: 99b827f7-16c4-49d1-8785-f184a8377804_in:Node: {fileID: -4619482893835212189}--- !u!114 &11400000MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: c4299eb7af6691f4a82ce6a25fd96981, type: 3}m_Name: TestRunem_EditorClassIdentifier:RuneSprite: {fileID: 0}Rune:DisplayName:Speed: 0ManaCost: 0Effects: []RuneEffects:- {fileID: 4043878867747308653}- {fileID: -3229689855982809186}references:version: 2RefIds: []--- !u!114 &3470929320567701890MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 9aba2983d5b304644a37facc1967f5de, type: 3}m_Name: PawnGetterStepm_EditorClassIdentifier:Position: {x: 163, y: 309}Guid: 81887a16-fba6-48b4-92f4-1df09b3dafb5Resource:typeId: aecc1739-a0df-4013-b430-22d2eb13f0ff--- !u!114 &4043878867747308653MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 4585b32f67d50794cad3c057a0f091a1, type: 3}m_Name: 339c67f6-1e2b-49ab-b35e-77b5f316c9fem_EditorClassIdentifier:Guid: 339c67f6-1e2b-49ab-b35e-77b5f316c9fe_nodes:- {fileID: 3470929320567701890}- {fileID: -649113059712602876}- {fileID: -1307332316521653590}- {fileID: -4619482893835212189}- {fileID: -7959464409387560310}- {fileID: 6806886774387728050}--- !u!114 &6806886774387728050MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 9aba2983d5b304644a37facc1967f5de, type: 3}m_Name: PawnGetterStepm_EditorClassIdentifier:Position: {x: 163, y: 473}Guid: ed761976-311d-462d-a7ba-9c67c864a6f7Resource:typeId: da13f1c1-4359-4eb9-b969-7db50afe6423--- !u!114 &8736044092964998325MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 0}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: bb9a9a2cce40a384084a18925a111186, type: 3}m_Name: RepeatStepm_EditorClassIdentifier:Position: {x: 509, y: 380}Guid: 69f99b8e-80a9-476c-ba96-3e7718738e0b_in:Node: {fileID: -5841318192641428412}
--- !u!114 &1194535749MonoBehaviour:m_ObjectHideFlags: 0m_CorrespondingSourceObject: {fileID: 0}m_PrefabInstance: {fileID: 0}m_PrefabAsset: {fileID: 0}m_GameObject: {fileID: 1194535746}m_Enabled: 1m_EditorHideFlags: 0m_Script: {fileID: 11500000, guid: 2218d79eb8bf91d44964631b5b2626a8, type: 3}m_Name:m_EditorClassIdentifier:Rune: {fileID: 11400000, guid: 9a3a6cebec0d9f94e982f833295e7fde, type: 2}Target: {fileID: 1683100414}Caster: {fileID: 1190570253}
fileFormatVersion: 2guid: e0b2d188683b3ac468d2fddc5a649d79folderAsset: yesDefaultImporter:externalObjects: {}userData:assetBundleName:assetBundleVariant:
fileFormatVersion: 2guid: 38f44ac00ba44604c9ab4f2960f8b418MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
namespace TagFighter.UI.Editor{using UnityEditor;using UnityEngine.UIElements;using UnityEditor.Experimental.GraphView;using System;using TagFighter.Effects;using System.Collections.Generic;using System.Linq;using UnityEngine;public class RuneEffectView : GraphView{RuneEffect _runeEffect;public Action<EffectStepNodeView> OnNodeSelected;public RuneEffectView() {Insert(0, new GridBackground());this.AddManipulator(new ContentZoomer());this.AddManipulator(new ContentDragger());this.AddManipulator(new SelectionDragger());this.AddManipulator(new RectangleSelector());var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Editor/Rune/RuneEditor.uss");styleSheets.Add(styleSheet);}internal void PopulateView(RuneEffect runeEffect) {graphViewChanged -= OnGraphViewChanged;DeleteElements(graphElements);_runeEffect = runeEffect;if (_runeEffect == null) {return;}graphViewChanged += OnGraphViewChanged;CreateNodeViews();CreateEdges();}public override List<Port> GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter) {return ports.Where(endPort => endPort.direction != startPort.direction&& endPort.node != startPort.node&& endPort.portType == startPort.portType).ToList();}void CreateNodeViews() {foreach (var node in _runeEffect.Nodes) {CreateNodeView(node);}}void CreateEdges() {foreach (var inputNode in _runeEffect.Nodes) {var inputView = GetNodeByGuid(inputNode.Guid) as EffectStepNodeView;if (inputNode.Input != null) {foreach (var outputNode in inputNode.Input.Connections()) {var outputView = GetNodeByGuid(outputNode.Guid) as EffectStepNodeView;var edge = outputView.Output.ConnectTo(inputView.Input);AddElement(edge);}}}}GraphViewChange OnGraphViewChanged(GraphViewChange graphViewChange) {if (graphViewChange.elementsToRemove != null) {foreach (var elementToRemove in graphViewChange.elementsToRemove) {switch (elementToRemove) {case EffectStepNodeView effectStepNodeView:_runeEffect.DeleteNode(effectStepNodeView.Node);AssetDatabase.RemoveObjectFromAsset(effectStepNodeView.Node);break;case Edge edge:var outputNodeView = edge.output.node as EffectStepNodeView;var inputNodeView = edge.input.node as EffectStepNodeView;inputNodeView.Node.Input.TryDisconnect(outputNodeView.Node);break;}}}if (graphViewChange.edgesToCreate != null) {foreach (var edge in graphViewChange.edgesToCreate) {var outputNodeView = edge.output.node as EffectStepNodeView;var inputNodeView = edge.input.node as EffectStepNodeView;inputNodeView.Node.Input.TryConnect(outputNodeView.Node);}}return graphViewChange;}public override void BuildContextualMenu(ContextualMenuPopulateEvent e) {// base.BuildContextualMenu(e);{foreach (var type in TypeCache.GetTypesDerivedFrom(typeof(SingleGetterStep))) {e.menu.AppendAction($"Create [{type.Name}]", action => AddNode(type, action.eventInfo.mousePosition));}foreach (var type in TypeCache.GetTypesDerivedFrom(typeof(SequenceGetterStep))) {e.menu.AppendAction($"Create [{type.Name}]", action => AddNode(type, action.eventInfo.mousePosition));}foreach (var type in TypeCache.GetTypesDerivedFrom(typeof(SingleSetterStep))) {e.menu.AppendAction($"Create [{type.Name}]", action => AddNode(type, action.eventInfo.mousePosition));}foreach (var type in TypeCache.GetTypesDerivedFrom(typeof(SequenceSetterStep))) {e.menu.AppendAction($"Create [{type.Name}]", action => AddNode(type, action.eventInfo.mousePosition));}e.menu.AppendAction("Create Root Node", action => AddNode(typeof(EffectEndNode), action.eventInfo.mousePosition));}}UnityEngine.Vector2 CalculatePositionOnGraph(UnityEngine.Vector2 position) {return viewTransform.matrix.inverse.MultiplyPoint(this.WorldToLocal(position));}void AddNode(System.Type type, UnityEngine.Vector2 position) {if (_runeEffect == null) {return;}var node = CreateNode(type, position);_runeEffect.AddNode(node);AssetDatabase.AddObjectToAsset(node, _runeEffect);CreateNodeView(node);}EffectStepNode CreateNode(System.Type type, UnityEngine.Vector2 position) {if (_runeEffect == null) {return null;}var node = ScriptableObject.CreateInstance(type) as EffectStepNode;node.name = type.Name;node.Guid = Guid.NewGuid().ToString();node.Position = CalculatePositionOnGraph(position);return node;}void CreateNodeView(EffectStepNode node) {EffectStepNodeView nodeView = new(node) {OnNodeSelected = OnNodeSelected,};AddElement(nodeView);}}}
fileFormatVersion: 2guid: 1ff11162f2a5b9e4ba93115320a8b93aScriptedImporter:internalIDToNameTable: []externalObjects: {}serializedVersion: 2userData:assetBundleName:assetBundleVariant:script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}disableValidation: 0
GridBackground {--grid-background-color: rgb(40, 40, 40);--line-color: rgba(193, 196, 192, 0.1);--thick-line-color: rgba(193, 196, 192, 0.1);--spacing: 15;}RuneEffectView {flex-grow: 1}ScrollView {flex-grow: 1}#runeEffectsControl {flex-direction: row;align-items: flex-start;}#addRuneEffect {flex-grow: 1}#removeRuneEffect {flex-grow: 1}
fileFormatVersion: 2guid: 55b82a8989daafb4b98912a52af38aeaMonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
// using TagFighter.Dialogue;using System.Collections.Generic;using System.Linq;using TagFighter.Effects;using UnityEditor;using UnityEditor.Callbacks;using UnityEngine;using UnityEngine.UIElements;namespace TagFighter.UI.Editor{public class RuneEditor : EditorWindow{RuneEffectView _runeView;ListView _runeEffects;[SerializeField]RuneRef _selectedRuneRef;[SerializeField]RuneEffect _selectedRuneEffect;[MenuItem("TagFighter/RuneEditor")]public static void ShowEditorWindow() {var window = GetWindow<RuneEditor>();window.titleContent = new GUIContent("RuneEditor");window.UpdateEditorView();}[OnOpenAsset(1)]public static bool OnOpenAsset(int instanceID, int line) {var dialogue = EditorUtility.InstanceIDToObject(instanceID) as RuneRef;if (dialogue != null) {ShowEditorWindow();return true;}return false;}public void CreateGUI() {var root = rootVisualElement;var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/Editor/Rune/RuneEditor.uss");root.styleSheets.Add(styleSheet);var splitView = new TwoPaneSplitView(0, 250, TwoPaneSplitViewOrientation.Horizontal);var leftPane = new VisualElement();splitView.Add(leftPane);var rightPane = new VisualElement();splitView.Add(rightPane);var runeEffectsControl = new VisualElement() {name = "runeEffectsControl"};leftPane.Add(runeEffectsControl);var addRuneEffect = new Button() {name = "addRuneEffect",text = "+",};addRuneEffect.clicked += OnAddRuneEffect;runeEffectsControl.Add(addRuneEffect);var removeRuneEffect = new Button() {name = "removeRuneEffect",text = "-",};removeRuneEffect.clicked += OnRemoveRuneEffect;runeEffectsControl.Add(removeRuneEffect);_runeEffects = new ListView() {itemsSource = null,makeItem = () => new Label(),bindItem = (e, i) => (e as Label).text = _selectedRuneRef.RuneEffects[i].Guid,};_runeEffects.onSelectionChange += OnRuneEffectSelectionChanged;_runeEffects.reorderable = true;leftPane.Add(_runeEffects);_runeView = new RuneEffectView();rightPane.Add(_runeView);var scrollView = new ScrollView(ScrollViewMode.VerticalAndHorizontal);scrollView.Add(splitView);root.Add(scrollView);_runeView.OnNodeSelected = OnNodeSelectionChanged;UpdateEditorView();}void OnRuneEffectSelectionChanged(IEnumerable<object> enumerable) {Selection.activeObject = enumerable.First() as RuneEffect;}void OnRemoveRuneEffect() {var runeEffect = _runeEffects.selectedItem as RuneEffect;if (runeEffect == null) {return;}if (_selectedRuneRef.RuneEffects.Remove(runeEffect)) {foreach (var step in runeEffect.Nodes) {AssetDatabase.RemoveObjectFromAsset(step);}AssetDatabase.RemoveObjectFromAsset(runeEffect);UpdateEditorView();// _runeEffects.RefreshItems();}}void OnAddRuneEffect() {var runeEffect = ScriptableObject.CreateInstance<RuneEffect>();runeEffect.Guid = System.Guid.NewGuid().ToString();runeEffect.name = runeEffect.Guid;_selectedRuneRef.RuneEffects.Add(runeEffect);AssetDatabase.AddObjectToAsset(runeEffect, _selectedRuneRef);_runeEffects.RefreshItems();}void UpdateEditorView() {_runeEffects.itemsSource = _selectedRuneRef.RuneEffects;_runeEffects.RefreshItems();_selectedRuneEffect = _runeEffects.selectedItem as RuneEffect;_runeView.PopulateView(_selectedRuneEffect);}void OnSelectionChanged() {// AssetDatabase.CanOpenAssetInEditor(dialogueCandidate.GetInstanceID())switch (Selection.activeObject) {case RuneRef rune:_selectedRuneRef = rune;UpdateEditorView();break;case EffectStepNode node: {var runeRefCandidate = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GetAssetPath(node)) as RuneRef;if (_selectedRuneRef != runeRefCandidate) {_selectedRuneRef = runeRefCandidate;UpdateEditorView();}}break;case RuneEffect runeEffect: {var runeRefCandidate = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GetAssetPath(runeEffect)) as RuneRef;if (_selectedRuneRef != runeRefCandidate) {_selectedRuneRef = runeRefCandidate;}_selectedRuneEffect = runeEffect;UpdateEditorView();}break;default:if (_selectedRuneRef == null) {UpdateEditorView();}break;}}void OnNodeSelectionChanged(EffectStepNodeView nodeView) {Selection.activeObject = nodeView.Node;}void OnUndoRedo() {_runeView.PopulateView(_runeEffects.selectedItem as RuneEffect);}void OnEnable() {Undo.undoRedoPerformed += OnUndoRedo;Selection.selectionChanged += OnSelectionChanged;}void OnDisable() {Undo.undoRedoPerformed -= OnUndoRedo;Selection.selectionChanged -= OnSelectionChanged;}}}
fileFormatVersion: 2guid: a5ee6eb1cc1779a4aa526526123a4836MonoImporter:externalObjects: {}serializedVersion: 2defaultReferences: []executionOrder: 0icon: {instanceID: 0}userData:assetBundleName:assetBundleVariant:
using System;using TagFighter.Effects;using UnityEditor.Experimental.GraphView;using UnityEngine;namespace TagFighter.UI.Editor{public class EffectStepNodeView : UnityEditor.Experimental.GraphView.Node{public Action<EffectStepNodeView> OnNodeSelected;public EffectStepNode Node;public Port Input;public Port Output;public EffectStepNodeView(EffectStepNode node) {Node = node;title = Node.ShortName;viewDataKey = Node.Guid;style.left = Node.Position.x;style.top = Node.Position.y;CreateInputPorts();CreateOutputPorts();}string GetPortDisplayName(System.Type portType) {if (portType == typeof(SequenceGetterStep)) {return ">>>";}else if (portType == typeof(SingleGetterStep)) {return ">";}else if (portType == typeof(SetterNode)) {return "Setter";}return null;}void CreateInputPorts() {var direction = Direction.Input;var port = Node.Input;if (port != null) {Input = port.Capacity switch {PortCapacity.Single => InstantiatePort(Orientation.Horizontal, direction, Port.Capacity.Single, port.InnerType),_ => InstantiatePort(Orientation.Horizontal, direction, Port.Capacity.Multi, port.InnerType)};Input.portName = GetPortDisplayName(Input.portType);inputContainer.Add(Input);}}void CreateOutputPorts() {var direction = Direction.Output;var orientation = Orientation.Horizontal;Output = Node switch {SequenceGetterStep => InstantiatePort(orientation, direction, Port.Capacity.Single, typeof(SequenceGetterStep)),SingleGetterStep => InstantiatePort(orientation, direction, Port.Capacity.Single, typeof(SingleGetterStep)),SetterNode => InstantiatePort(orientation, direction, Port.Capacity.Single, typeof(SetterNode)),_ => null,};if (Output != null) {Output.portName = GetPortDisplayName(Output.portType);outputContainer.Add(Output);}}public override void SetPosition(Rect newPos) {base.SetPosition(newPos);Node.Position.x = newPos.xMin;Node.Position.y = newPos.yMin;}public override void OnSelected() {base.OnSelected();OnNodeSelected?.Invoke(this);}}}