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BlueTag : Resource<BlueTagUnit> { }
}
fileFormatVersion: 2
guid: a805c007a08e37b4d86153c5426ae728
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class GreenTag : Resource<GreenTagUnit> { }
}
fileFormatVersion: 2
guid: 748244e87f3d420469b7e5bd23f876cc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class RedTag : Resource<RedTagUnit> { }
}
fileFormatVersion: 2
guid: 75c933b4f95911047ad31a06d80bbfd4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b24f5f4c556b5c2439398a7d59da24b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class Pain : Resource<PainUnit> { }
}
fileFormatVersion: 2
guid: f3afa09e4365bf74aa8ea874ddc7e2de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class Fatigue : Resource<FatigueUnit> { }
}
fileFormatVersion: 2
guid: 796cd3d97a59c1c40af54ef3c643d2de
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 75c933b4f95911047ad31a06d80bbfd4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class RedTag : Resource<RedTagUnit> { }
}
fileFormatVersion: 2
guid: b24f5f4c556b5c2439398a7d59da24b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class Pain : Resource<PainUnit> { }
}
fileFormatVersion: 2
guid: 748244e87f3d420469b7e5bd23f876cc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class GreenTag : Resource<GreenTagUnit> { }
}
fileFormatVersion: 2
guid: f3afa09e4365bf74aa8ea874ddc7e2de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class Fatigue : Resource<FatigueUnit> { }
}
fileFormatVersion: 2
guid: a805c007a08e37b4d86153c5426ae728
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
namespace TagFighter.Resources
{
[Serializable]
public sealed class BlueTag : Resource<BlueTagUnit> { }
}
fileFormatVersion: 2
guid: e78dfb08f97e9fa43bd46d6327e243ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using CareBoo.Serially;
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects.Triggers
{
public interface ITrigger
{
public ITrigger ShallowCopy();
public void Register(PawnCondition condition);
public void UnRegister();
}
[Serializable]
public abstract class OnResourceChange : ITrigger
{
[SerializeReference, ShowSerializeReference]
public IWatchableResourceGetter Resource;
protected PawnCondition _condition;
private IWatchableResource _resource;
[SerializeField]
private int _threshold;
private int _beforeValue;
public void Register(PawnCondition condition) {
if (_condition != null) {
UnRegister();
}
_condition = condition;
_resource = Resource.GetWatchableResource(condition.transform);
_beforeValue = _resource.Status.Current;
_resource.OnChanged += OnChanged;
}
public ITrigger ShallowCopy() {
return (ITrigger)MemberwiseClone();
}
public void UnRegister() {
_resource.OnChanged -= OnChanged;
_resource = null;
_condition = null;
_beforeValue = 0;
}
protected void OnChanged(object sender, OnChangeArgs e) {
Trigger(e.Current, _beforeValue, _threshold);
_beforeValue = e.Current;
}
protected abstract void Trigger(int current, int before, int threshold);
}
[Serializable]
public class OnResourceIncrease : OnResourceChange
{
protected override void Trigger(int current, int before, int threshold) {
if (current >= before + threshold) {
_condition.OnTrigger();
}
}
}
[Serializable]
public class OnResourceDecrease : OnResourceChange
{
protected override void Trigger(int current, int before, int threshold) {
if (current <= before - threshold) {
_condition.OnTrigger();
}
}
}
[Serializable]
public class OnTimePass : ITrigger
{
private PawnCondition _condition;
[SerializeField]
private float _frequency;
// public ResourceInfoGet<IResourceTypeAccessor, ResourceLocationAccessors.Get.Context> Frequency;
public void Register(PawnCondition condition) {
if (_condition != null) {
UnRegister();
}
_condition = condition;
_condition.StartCoroutine(Tick());
}
public ITrigger ShallowCopy() {
return (ITrigger)MemberwiseClone();
}
public void UnRegister() {
_condition.StopCoroutine(Tick());
}
private IEnumerator Tick() {
while (true) {
yield return new WaitForSeconds(_frequency);
_condition.OnTrigger();
Debug.Log("Tick");
}
}
}
}
while (_remainingDuration > 0) {
yield return new WaitForSeconds(Frequency);
Debug.Log("Tick");
foreach (var effect in Context.EffectsToTrigger) {
effect.DelayedAction(data);
}
_remainingDuration -= Frequency;
// print($"Regenerated {typeof(T).Name}, value = {Current}");
foreach (var effect in Context.EffectsToTrigger) {
effect.DelayedAction(data);
public ResourceInfoGet<IResourceTypeAccessor, ResourceLocationAccessors.Get.Context> Frequency;
// public ResourceInfoGet<IResourceTypeAccessor, ResourceLocationAccessors.Get.Context> Frequency;
[SerializeReference, ShowSerializeReference]
public Triggers.ITrigger Trigger;
Frequency:
Resource:
rid: -2
Location:
rid: -2
Multiplier: 1
Addend: 1
Trigger:
rid: 4320157327971844096
- rid: 4320157327971844097
type: {class: PeriodicWeave, ns: TagFighter.Effects, asm: Assembly-CSharp}
data:
AreaOfEffect:
rid: 4320157327971844098
Duration:
Resource:
rid: -2
Location:
rid: -2
Multiplier: 1
Addend: 30
Trigger:
rid: 4320157327971844106
- rid: 4320157327971844098
type: {class: Single, ns: TagFighter.Effects.AoeShapes, asm: Assembly-CSharp}
- rid: 4320157327971844106
type: {class: OnResourceIncrease, ns: TagFighter.Effects.Triggers, asm: Assembly-CSharp}
data:
Resource:
rid: 4320157327971844107
_threshold: 11
- rid: 4320157327971844107
type: {class: Pain, ns: TagFighter.Effects.ResourceTypeAccessors, asm: Assembly-CSharp}
- rid: 7043444593006739633
type: {class: TransientWeave, ns: TagFighter.Effects, asm: Assembly-CSharp}
data:
Duration:
Resource:
rid: -2
Location:
rid: -2
Multiplier: 1
Addend: 5
--- !u!114 &-5079747134705416876
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2775200704764093955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a805c007a08e37b4d86153c5426ae728, type: 3}
m_Name:
m_EditorClassIdentifier:
_current:
_base:
_value: 0
_capacity:
_base:
_value: 10
--- !u!114 &-2384431249593873901
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2775200704764093955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 748244e87f3d420469b7e5bd23f876cc, type: 3}
m_Name:
m_EditorClassIdentifier:
_current:
_base:
_value: 0
_capacity:
_base:
_value: 10
--- !u!114 &6624014535947515258
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2775200704764093955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 75c933b4f95911047ad31a06d80bbfd4, type: 3}
m_Name:
m_EditorClassIdentifier:
_current:
_base:
_value: 0
_capacity:
_base:
_value: 10
--- !u!114 &-3477051471225209728
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2775200704764093955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b24f5f4c556b5c2439398a7d59da24b1, type: 3}
m_Name:
m_EditorClassIdentifier:
_current:
_base:
_value: 0
_capacity:
_base:
_value: 100
--- !u!114 &-6862634721499991204
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2775200704764093955}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f3afa09e4365bf74aa8ea874ddc7e2de, type: 3}
m_Name:
m_EditorClassIdentifier:
_current:
_base:
_value: 0
_capacity:
_base:
_value: 100