begin replacing naughtyattributes

This commit is contained in:
Rowan 2025-07-18 03:43:12 -04:00
parent ab73f3b9b9
commit 816a779678
52 changed files with 7208 additions and 103 deletions

View file

@ -9,8 +9,8 @@ AnimatorController:
m_Name: Door m_Name: Door
serializedVersion: 5 serializedVersion: 5
m_AnimatorParameters: m_AnimatorParameters:
- m_Name: Slide - m_Name: SlideOpen
m_Type: 9 m_Type: 4
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
@ -90,8 +90,8 @@ AnimatorStateTransition:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: m_Name:
m_Conditions: m_Conditions:
- m_ConditionMode: 1 - m_ConditionMode: 2
m_ConditionEvent: Slide m_ConditionEvent: SlideOpen
m_EventTreshold: 0 m_EventTreshold: 0
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 6558265478478358952} m_DstState: {fileID: 6558265478478358952}
@ -144,7 +144,7 @@ AnimatorStateTransition:
m_Name: m_Name:
m_Conditions: m_Conditions:
- m_ConditionMode: 1 - m_ConditionMode: 1
m_ConditionEvent: Slide m_ConditionEvent: SlideOpen
m_EventTreshold: 0 m_EventTreshold: 0
m_DstStateMachine: {fileID: 0} m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 671522036267396356} m_DstState: {fileID: 671522036267396356}

View file

@ -26,7 +26,9 @@ MonoBehaviour:
probeVolumeBlendStatesCS: {fileID: 0} probeVolumeBlendStatesCS: {fileID: 0}
m_RendererFeatures: m_RendererFeatures:
- {fileID: 601012607912154617} - {fileID: 601012607912154617}
m_RendererFeatureMap: f9952258c8395708 - {fileID: 2009467652837663262}
- {fileID: 5739553122425761206}
m_RendererFeatureMap: f9952258c83957081ee206032f10e31bb6edabc727fda64f
m_UseNativeRenderPass: 0 m_UseNativeRenderPass: 0
xrSystemData: {fileID: 0} xrSystemData: {fileID: 0}
postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2}
@ -45,9 +47,9 @@ MonoBehaviour:
failOperation: 0 failOperation: 0
zFailOperation: 0 zFailOperation: 0
m_ShadowTransparentReceive: 1 m_ShadowTransparentReceive: 1
m_RenderingMode: 2 m_RenderingMode: 0
m_DepthPrimingMode: 0 m_DepthPrimingMode: 0
m_CopyDepthMode: 1 m_CopyDepthMode: 0
m_DepthAttachmentFormat: 0 m_DepthAttachmentFormat: 0
m_DepthTextureFormat: 0 m_DepthTextureFormat: 0
m_AccurateGbufferNormals: 0 m_AccurateGbufferNormals: 0
@ -78,3 +80,87 @@ MonoBehaviour:
BlurQuality: 0 BlurQuality: 0
Falloff: 100 Falloff: 100
SampleCount: -1 SampleCount: -1
--- !u!114 &2009467652837663262
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b3d386ba5cd94485973aee1479b272e, type: 3}
m_Name: Occluded
m_EditorClassIdentifier:
m_Active: 1
settings:
passTag: Occluded
Event: 300
filterSettings:
RenderQueueType: 0
LayerMask:
serializedVersion: 2
m_Bits: 64
PassNames: []
overrideMaterial: {fileID: 2100000, guid: da1349e47d5d84cbd921f72293a96c87, type: 2}
overrideMaterialPassIndex: 0
overrideShader: {fileID: 0}
overrideShaderPassIndex: 0
overrideMode: 1
overrideDepthState: 1
depthCompareFunction: 5
enableWrite: 0
stencilSettings:
overrideStencilState: 0
stencilReference: 0
stencilCompareFunction: 8
passOperation: 0
failOperation: 0
zFailOperation: 0
cameraSettings:
overrideCamera: 0
restoreCamera: 1
offset: {x: 0, y: 0, z: 0, w: 0}
cameraFieldOfView: 60
--- !u!114 &5739553122425761206
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b3d386ba5cd94485973aee1479b272e, type: 3}
m_Name: NotOccluded
m_EditorClassIdentifier:
m_Active: 1
settings:
passTag: NotOccluded
Event: 300
filterSettings:
RenderQueueType: 0
LayerMask:
serializedVersion: 2
m_Bits: 64
PassNames: []
overrideMaterial: {fileID: 0}
overrideMaterialPassIndex: 0
overrideShader: {fileID: 0}
overrideShaderPassIndex: 0
overrideMode: 1
overrideDepthState: 1
depthCompareFunction: 4
enableWrite: 1
stencilSettings:
overrideStencilState: 0
stencilReference: 0
stencilCompareFunction: 8
passOperation: 0
failOperation: 0
zFailOperation: 0
cameraSettings:
overrideCamera: 0
restoreCamera: 1
offset: {x: 0, y: 0, z: 0, w: 0}
cameraFieldOfView: 60

View file

@ -1,30 +0,0 @@
using UnityEngine;
using UnityEditor;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
[CustomEditor(typeof(Object), true, isFallback = true)]
public class DefaultEditor : Editor
{
public override VisualElement CreateInspectorGUI()
{
var container = new VisualElement();
var iterator = serializedObject.GetIterator();
if (iterator.NextVisible(true))
{
do
{
var propertyField = new PropertyField(iterator.Copy()) { name = "PropertyField:" + iterator.propertyPath };
if (iterator.propertyPath == "m_Script" && serializedObject.targetObject != null)
propertyField.SetEnabled(value: false);
container.Add(propertyField);
}
while (iterator.NextVisible(false));
}
return container;
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: b9af3c2b0b924c5a6a45c4788726c0be

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4483885d85d0673eca50fecb06d2d533
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 29a87b083e81e5e68a366844325516e8
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View file

@ -0,0 +1,197 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Occluded Silhouette
m_Shader: {fileID: -6465566751694194690, guid: 29a87b083e81e5e68a366844325516e8, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHATEST_ON
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2450
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Base_Map:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Normal_Map:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Ambient_Occlusion_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseTexture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Base_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Heightmap_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Metallic_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Smoothness_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- Normal_Blend: 0.5
- _AddPrecomputedVelocity: 0
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BlendOp: 0
- _BumpScale: 1
- _CastShadows: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _Dither_Size: 1
- _DrawOrder: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _Emission: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossinessSource: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Metallic_Intensity: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _Shininess: 0
- _Smoothness: 0
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 0
- _XRMotionVectorsPass: 1
- _ZTest: 4
- _ZWrite: 1
- _ZWriteControl: 0
m_Colors:
- _BaseColor: {r: 0.3095483, g: 0, b: 1, a: 1}
- _Base_Color: {r: 0.22167921, g: 0, b: 1, a: 0.47058824}
- _Color: {r: 1, g: 0, b: 0.26456663, a: 0.49803922}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _Emissive_Color: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8429744241512883205
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: da1349e47d5d84cbd921f72293a96c87
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -903,7 +903,7 @@ Transform:
m_GameObject: {fileID: 983805437} m_GameObject: {fileID: 983805437}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.5, y: 1, z: -3} m_LocalPosition: {x: 2, y: 1.5, z: -2}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -985,7 +985,19 @@ MonoBehaviour:
m_Calls: m_Calls:
- m_Target: {fileID: 1190731372} - m_Target: {fileID: 1190731372}
m_TargetAssemblyTypeName: KitsuneCafe.Animation.TriggerAnimation, Assembly-CSharp m_TargetAssemblyTypeName: KitsuneCafe.Animation.TriggerAnimation, Assembly-CSharp
m_MethodName: Trigger m_MethodName: SetValue
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
- m_Target: {fileID: 1190731373}
m_TargetAssemblyTypeName: KitsuneCafe.Timer, Assembly-CSharp
m_MethodName: StartTimer
m_Mode: 1 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
@ -995,10 +1007,13 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
- m_Target: {fileID: 1190731373} closed:
m_TargetAssemblyTypeName: KitsuneCafe.Timer, Assembly-CSharp m_PersistentCalls:
m_MethodName: StartTimer m_Calls:
m_Mode: 1 - m_Target: {fileID: 1190731372}
m_TargetAssemblyTypeName: KitsuneCafe.Animation.TriggerAnimation, Assembly-CSharp
m_MethodName: SetValue
m_Mode: 6
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@ -1116,7 +1131,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
animator: {fileID: 1190731371} animator: {fileID: 1190731371}
parameter: -1288781466 parameter: -754085080
--- !u!114 &1190731373 --- !u!114 &1190731373
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1138,9 +1153,9 @@ MonoBehaviour:
onComplete: onComplete:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 1190731372} - m_Target: {fileID: 1190731367}
m_TargetAssemblyTypeName: KitsuneCafe.Animation.TriggerAnimation, Assembly-CSharp m_TargetAssemblyTypeName: KitsuneCafe.Interaction.Gate, Assembly-CSharp
m_MethodName: Trigger m_MethodName: ForceClosedAndForget
m_Mode: 1 m_Mode: 1
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
@ -1231,7 +1246,7 @@ GameObject:
- component: {fileID: 1363718004} - component: {fileID: 1363718004}
- component: {fileID: 1363718007} - component: {fileID: 1363718007}
- component: {fileID: 1363718006} - component: {fileID: 1363718006}
m_Layer: 0 m_Layer: 6
m_Name: Player m_Name: Player
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -1725,6 +1740,10 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1363717997} m_TransformParent: {fileID: 1363717997}
m_Modifications: m_Modifications:
- target: {fileID: -9070493210130169274, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3} - target: {fileID: -8679921383154817045, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -1765,10 +1784,278 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8183481454299698827, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -8006009767450596044, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -7657966619581158213, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -7360747449169001873, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -7121769801107515815, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -6621945745981909287, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -6370085079684087283, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -6234591296559379751, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -6170625038081293824, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -6056541330796499132, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -5857696854640597626, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -5561550452697079657, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -5195048882033904264, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -4999088201633142198, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -4728426434207774260, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -4501530691011011137, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -4332706925441422008, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -4278032810995721380, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -3799395697873186154, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -3542885339558904099, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -3478013746326755454, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -3214267034143217929, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -3086436065929644917, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -2656431786303760210, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -2084811680363313996, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -1781356600409242780, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -1703473491307067327, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -1425791611860619382, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -1268151995469589007, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -1200856079203341021, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -751476226918971245, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -552831747908440785, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -290750445479886849, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -203856693384778745, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: -76546954072915012, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 9171100556185337, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 414117464747255840, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3} - target: {fileID: 919132149155446097, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: X Bot value: X Bot
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1082271958561512970, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1339101018200438765, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1711505207429034123, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2158975759703390516, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2586065998465600510, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2715566404302941441, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2898355158428612036, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3047284246813455858, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3135921509060577837, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3588849560313704984, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3614653200513675785, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3882815353823017779, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3948933247560734027, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 3974016661214395164, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4114030615378554161, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4237274458221626025, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4441848305933595309, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4549111882529890269, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 5120724536234783804, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 6240733294840144465, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 6514210125699187276, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7363479242261063072, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7542137907003004905, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7732535366517880319, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7776229726456038893, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 7882376022164389543, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8817898888258712963, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8953972740105248388, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
- target: {fileID: 9037727976738196030, guid: 39499efe4f068c9f1aa32d2ea7e17fa9, type: 3}
propertyPath: m_Layer
value: 6
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
@ -1870,7 +2157,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 1915136995} - component: {fileID: 1915136995}
- component: {fileID: 1915136996} - component: {fileID: 1915136996}
m_Layer: 0 m_Layer: 6
m_Name: Interaction Collider m_Name: Interaction Collider
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: -5397416234189338067, guid: 0000000000000000d000000000000000, type: 0} m_Icon: {fileID: -5397416234189338067, guid: 0000000000000000d000000000000000, type: 0}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e4cfce59d8f25c75e9c3179814ad0c0c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ef2efd2562ded9f0b6bf44aa323cd2c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using KitsuneCafe.Extension;
using KitsuneCafe.System.Attributes;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
namespace KitsuneCafe.Editor
{
[CustomPropertyDrawer(typeof(AnimatorParamAttribute))]
public class AnimatorParamPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var attribute = base.attribute as AnimatorParamAttribute;
return property.type switch
{
"int" => new AnimatorIntParameterElement(property, attribute.AnimatorProperty),
"string" => new AnimatorStringParameterElement(property, attribute.AnimatorProperty),
_ => throw new ArgumentException("AnimatorParam must be bound to an int or string.")
};
}
public abstract class AnimatorParameterElement : PopupField<string>, IDisposable
{
public readonly SerializedProperty Property;
public string Label => ObjectNames.NicifyVariableName(Property.name);
public readonly SerializedProperty AnimatorProperty;
public AnimatorParameterElement(SerializedProperty property, string animatorPropertyName) : base(ObjectNames.NicifyVariableName(property.name))
{
Property = property;
AnimatorProperty = property.serializedObject.FindProperty(animatorPropertyName);
this.RegisterValueChangedCallback(OnValueChanged);
OnAnimatorChanged(AnimatorProperty);
this.TrackPropertyValue(AnimatorProperty, OnAnimatorChanged);
AddToClassList(BaseField<int>.ussClassName);
AddToClassList(BaseField<int>.alignedFieldUssClassName);
}
private void OnAnimatorChanged(SerializedProperty property)
{
if (property.TryGetValue(out Animator animator))
{
choices = new List<string>(GetParameterNames(animator));
}
OnAnimatorChanged(animator);
}
protected virtual void OnAnimatorChanged(Animator animator) { }
protected abstract void OnValueChanged(ChangeEvent<string> evt);
private static string[] GetParameterNames(Animator animator)
{
var parameters = animator.parameters;
var len = parameters.Length;
var names = new string[len];
for (int i = 0; i < len; i++)
{
names[i] = parameters[i].name;
}
return names;
}
public void Dispose()
{
this.UnregisterValueChangedCallback(OnValueChanged);
}
}
public class AnimatorIntParameterElement : AnimatorParameterElement
{
public AnimatorIntParameterElement(SerializedProperty property, string animatorName) : base(property, animatorName)
{
}
protected override void OnAnimatorChanged(Animator animator)
{
for (int i = 0; i < animator.parameterCount; i++)
{
if (animator.GetParameter(i).nameHash == Property.intValue)
{
index = i;
return;
}
}
index = 0;
}
protected override void OnValueChanged(ChangeEvent<string> evt)
{
Property.intValue = Animator.StringToHash(evt.newValue);
Property.serializedObject.ApplyModifiedProperties();
Property.serializedObject.Update();
}
}
public class AnimatorStringParameterElement : AnimatorParameterElement
{
public AnimatorStringParameterElement(SerializedProperty property, string animatorName) : base(property, animatorName)
{
}
protected override void OnAnimatorChanged(Animator animator)
{
for (int i = 0; i < animator.parameterCount; i++)
{
if (animator.GetParameter(i).name == Property.stringValue)
{
index = i;
return;
}
}
index = 0;
}
protected override void OnValueChanged(ChangeEvent<string> evt)
{
Property.stringValue = evt.newValue;
Property.serializedObject.ApplyModifiedProperties();
}
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 072cd698d386accecb4294e85277c897

View file

@ -0,0 +1,98 @@
using System;
using KitsuneCafe.System.Attributes;
using Unity.Properties;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
[CustomPropertyDrawer(typeof(ConditionalDisplayAttribute), true)]
public class ConditionalDisplayPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var attribute = this.attribute as ConditionalDisplayAttribute;
var serializedObject = property.serializedObject;
var names = attribute.Properties;
var length = names.Length;
var properties = new SerializedProperty[length];
for (int i = 0; i < length; i++)
{
properties[i] = serializedObject.FindProperty(names[i]);
}
return new BoolConditionPropertyField(properties, attribute, property);
}
public abstract class ConditionalPropertyField : PropertyField
{
protected readonly SerializedProperty[] properties;
protected readonly ConditionalDisplayAttribute attribute;
public ConditionalPropertyField(SerializedProperty[] properties, ConditionalDisplayAttribute attribute, SerializedProperty property) : base(property)
{
this.properties = properties;
this.attribute = attribute;
TrackProperties(properties);
}
public ConditionalPropertyField(SerializedProperty[] properties, ConditionalDisplayAttribute attribute, SerializedProperty property, string label) : base(property, label)
{
this.properties = properties;
this.attribute = attribute;
TrackProperties(properties);
}
private void TrackProperties(SerializedProperty[] properties)
{
var len = properties.Length;
for (int i = 0; i < len; i++)
{
var property = properties[i];
OnTrackedValueChanged(property);
this.TrackPropertyValue(property, OnTrackedValueChanged);
}
}
protected abstract void OnTrackedValueChanged(SerializedProperty property);
}
public class BoolConditionPropertyField : ConditionalPropertyField
{
public BoolConditionPropertyField(SerializedProperty[] properties, ConditionalDisplayAttribute attribute, SerializedProperty property) : base(properties, attribute, property)
{
}
public BoolConditionPropertyField(SerializedProperty[] properties, ConditionalDisplayAttribute attribute, SerializedProperty property, string label) : base(properties, attribute, property, label)
{
}
protected override void OnTrackedValueChanged(SerializedProperty property)
{
var value = (attribute.LogicalOperator, attribute.ComparisonOperator) switch
{
(LogicalOperator.Or, ComparisonOperator.Equal) => true,
(LogicalOperator.And, ComparisonOperator.NotEqual) => true,
_ => false
};
for (int i = 0; i < properties.Length; i++)
{
if (properties[i].boolValue == value)
{
DisplayElement(value);
return;
}
}
DisplayElement(!value);
}
private void DisplayElement(bool displayed)
{
style.display = displayed ? DisplayStyle.Flex : DisplayStyle.None;
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 25e298a4ed198a6b9aca430128221549

View file

@ -0,0 +1,34 @@
using KitsuneCafe.System;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
[CustomPropertyDrawer(typeof(SerializableDuration))]
public class DurationPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var container = new VisualElement();
container.style.flexDirection = FlexDirection.Row;
var duration = new PropertyField(
property.FindPropertyRelative("duration"),
ObjectNames.NicifyVariableName(property.name)
);
duration.style.flexGrow = 1;
var unit = new EnumField
{
bindingPath = "unit"
};
unit.style.flexGrow = 0;
container.Add(duration);
container.Add(unit);
return container;
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6af0b15e8903b4378a35b853b310b2b4

View file

@ -1,8 +1,8 @@
using R3; using R3;
using NaughtyAttributes;
using UnityEngine; using UnityEngine;
using KitsuneCafe.System; using KitsuneCafe.System;
using KitsuneCafe.Extension; using KitsuneCafe.Extension;
using KitsuneCafe.System.Attributes;
namespace KitsuneCafe.Entity namespace KitsuneCafe.Entity
{ {

View file

@ -1,4 +1,4 @@
using NaughtyAttributes; using KitsuneCafe.System.Attributes;
using UnityEngine; using UnityEngine;
namespace KitsuneCafe.Animation namespace KitsuneCafe.Animation
@ -16,19 +16,73 @@ namespace KitsuneCafe.Animation
animator = GetComponent<Animator>(); animator = GetComponent<Animator>();
} }
public void SetValue(int parameter, bool value)
{
animator.SetBool(parameter, value);
}
public void SetValue(string parameter, bool value)
{
SetValue(Animator.StringToHash(parameter), value);
}
public void SetValue(bool value)
{
SetValue(parameter, value);
}
public void SetValue(int parameter, int value)
{
animator.SetInteger(parameter, value);
}
public void SetValue(string parameter, int value)
{
SetValue(Animator.StringToHash(parameter), value);
}
public void SetValue(int value)
{
SetValue(parameter, value);
}
public void SetValue(int parameter, float value)
{
animator.SetFloat(parameter, value);
}
public void SetValue(string parameter, float value)
{
SetValue(Animator.StringToHash(parameter), value);
}
public void SetValue(float value)
{
SetValue(parameter, value);
}
public void Trigger(string parameter) public void Trigger(string parameter)
{ {
animator.SetTrigger(parameter); Trigger(Animator.StringToHash(parameter));
} }
public void Trigger(int parameter) public void Trigger(int parameter)
{ {
animator.SetTrigger(parameter); switch (animator.GetParameter(parameter).type)
{
case AnimatorControllerParameterType.Trigger:
animator.SetTrigger(parameter);
break;
case AnimatorControllerParameterType.Bool:
var value = animator.GetBool(parameter);
animator.SetBool(parameter, !value);
break;
}
} }
public void Trigger() public void Trigger()
{ {
animator.SetTrigger(parameter); Trigger(parameter);
} }
} }
} }

View file

@ -0,0 +1,26 @@
using System.Reflection;
using UnityEditor;
namespace KitsuneCafe.Extension
{
public static class EditorExtension
{
public static bool TryGetValue<T>(this SerializedProperty property, out T value)
{
var target = property.serializedObject.targetObject;
var type = target.GetType();
var field = type.GetField(property.propertyPath, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field != null)
{
value = (T)field.GetValue(target);
return true;
}
else
{
value = default;
return false;
}
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e3df130a0d7071ad3aa39588576cd273

View file

@ -1,6 +1,7 @@
using System;
using KitsuneCafe.ItemSystem; using KitsuneCafe.ItemSystem;
using KitsuneCafe.System; using KitsuneCafe.System;
using NaughtyAttributes; using KitsuneCafe.System.Attributes;
using UnityEngine; using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
@ -35,50 +36,57 @@ namespace KitsuneCafe.Interaction
[SerializeField] [SerializeField]
private UnityEvent opened = default; private UnityEvent opened = default;
[SerializeField]
private UnityEvent closed = default;
public bool IsInteractable => true; public bool IsInteractable => true;
public bool IsOpen => isOpen; public bool IsOpen => isOpen;
public bool IsLocked => isLocked; public bool IsLocked => isLocked;
public IResult<Unit, InteractionError> Interact(IInteractor interactor) public IResult<Unit, InteractionError> Interact(IInteractor interactor)
{ {
return TryOpen(interactor); return isOpen switch
{
true => TryClose(interactor),
false => TryOpen(interactor),
};
}
private IResult<Unit, InteractionError> TryClose(IInteractor interactor)
{
if (!isOpen)
{
return Result.Ok();
}
return ForceClosed();
} }
private IResult<Unit, InteractionError> TryOpen(IInteractor interactor) private IResult<Unit, InteractionError> TryOpen(IInteractor interactor)
{ {
if (isOpen) return requirement switch
{ {
return Result.Ok(); _ when isOpen => Result.Ok(),
} _ when !isLocked => ForceOpen(),
else if (!isLocked) Requirement.None => Result.Err(InteractionErrorCode.Locked),
{ Requirement.Key => TryOpenWithKey(interactor),
opened.Invoke(); Requirement.Switch => Result.Err(InteractionErrorCode.RequiresSwitch),
return Result.Ok(); var x => throw new ArgumentException($"{gameObject.name} requested invalid requirement type {x}")
} };
else if (requirement == Requirement.None) }
{
return Result.Err(InteractionErrorCode.Locked);
}
else if (requirement == Requirement.Switch)
{
return Result.Err(InteractionErrorCode.RequiresSwitch);
}
else if (requirement == Requirement.Key && interactor.TryGetComponent<IInventory<InventoryItem>>(out var inventory))
{
if (inventory.Has(key))
{
if (consumeKey)
{
inventory.Remove(key);
}
ForceOpen(); private IResult<Unit, InteractionError> TryOpenWithKey(IInteractor interactor)
return Result.Ok(); {
} if (interactor.TryGetComponent<IInventory<InventoryItem>>(out var inventory) && inventory.Has(key))
else {
if (consumeKey)
{ {
return Result.Err(InteractionErrorCode.MissingItem); inventory.Remove(key);
} }
isLocked = false;
ForceOpen();
return Result.Ok();
} }
else else
{ {
@ -86,10 +94,28 @@ namespace KitsuneCafe.Interaction
} }
} }
private void ForceOpen() public void ForceClosedAndForget()
{
isOpen = false;
closed.Invoke();
}
public IResult<Unit, InteractionError> ForceClosed()
{
ForceClosedAndForget();
return Result.Ok();
}
public void ForceOpenAndForget()
{ {
isOpen = true; isOpen = true;
opened.Invoke(); opened.Invoke();
} }
public IResult<Unit, InteractionError> ForceOpen()
{
ForceOpenAndForget();
return Result.Ok();
}
} }
} }

View file

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using KitsuneCafe.SOAP; using KitsuneCafe.SOAP;
using KitsuneCafe.System; using KitsuneCafe.System;
using NaughtyAttributes; using KitsuneCafe.System.Attributes;
using UnityEngine; using UnityEngine;
namespace KitsuneCafe.ItemSystem namespace KitsuneCafe.ItemSystem

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 92deb4c7848acfa62891cc4281e73470
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,23 @@
using System;
using UnityEngine;
using AnimatorControllerParameterType = UnityEngine.AnimatorControllerParameterType;
namespace KitsuneCafe.System.Attributes
{
[AttributeUsage(AttributeTargets.Field)]
public class AnimatorParamAttribute : PropertyAttribute
{
public readonly string AnimatorProperty;
public readonly AnimatorControllerParameterType? Type;
public AnimatorParamAttribute(string animatorProperty)
{
AnimatorProperty = animatorProperty;
}
public AnimatorParamAttribute(string animatorProperty, AnimatorControllerParameterType type) : this(animatorProperty)
{
Type = type;
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c79f244245ba37ba1b7b73fe1f7a893f

View file

@ -0,0 +1,16 @@
using System;
using UnityEngine;
namespace KitsuneCafe.System.Attributes
{
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed class ButtonAttribute : PropertyAttribute
{
public readonly string Label;
public ButtonAttribute(string label)
{
Label = label;
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a03d0b93702032990be1b4f7e721669c

View file

@ -0,0 +1,40 @@
using UnityEngine;
namespace KitsuneCafe.System.Attributes
{
public enum LogicalOperator
{
And,
Or
}
public enum ComparisonOperator
{
Less,
Equal,
LessEqual,
Greater,
NotEqual,
GreaterEqual,
}
public abstract class ConditionalDisplayAttribute : PropertyAttribute
{
public readonly string[] Properties;
public readonly LogicalOperator LogicalOperator;
public readonly ComparisonOperator ComparisonOperator;
public readonly object Value;
public ConditionalDisplayAttribute(LogicalOperator logicalOp, ComparisonOperator compareOp, object value, params string[] properties)
{
LogicalOperator = logicalOp;
ComparisonOperator = compareOp;
Properties = properties;
Value = value;
}
public ConditionalDisplayAttribute(LogicalOperator op, object value, string property) : this(op, ComparisonOperator.Equal, value, property) { }
public ConditionalDisplayAttribute(ComparisonOperator op, object value, string property) : this(LogicalOperator.And, op, value, property) { }
public ConditionalDisplayAttribute(string property, object value) : this(LogicalOperator.And, ComparisonOperator.Equal, value, property) { }
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8f81fabe472df26f688e0f84c32173ca

View file

@ -0,0 +1,19 @@
using System;
namespace KitsuneCafe.System.Attributes
{
public class ShowIfAttribute : ConditionalDisplayAttribute
{
public ShowIfAttribute(string property) : this(property, true)
{
}
public ShowIfAttribute(string property, object value) : base(ComparisonOperator.Equal, value, property)
{
}
public ShowIfAttribute(LogicalOperator logicalOp, params string[] properties) : base(logicalOp, ComparisonOperator.Equal, true, properties)
{
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 31abd55fdce4fc5f2a7e5f5a97545d00

View file

@ -17,5 +17,6 @@ namespace KitsuneCafe.System
public const string Ui = Base + "UI/"; public const string Ui = Base + "UI/";
public const string UiElement = Ui + "Element/"; public const string UiElement = Ui + "Element/";
public const string UiEffect = Ui + "Effect/";
} }
} }

View file

@ -0,0 +1,24 @@
using System;
using UnityEngine;
using UnityEngine.UIElements;
namespace KitsuneCafe.System
{
[Serializable]
public class SerializableDuration
{
[SerializeField]
private float duration;
[SerializeField]
private TimeUnit unit = TimeUnit.Seconds;
public static implicit operator Duration(SerializableDuration d) => Duration.From(d.duration, d.unit);
public static implicit operator TimeValue(SerializableDuration d)
{
Duration duration = d;
return new TimeValue(duration.Into(TimeUnit.Seconds));
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 490bd35fe5e91e4489990185d89762ec

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c7294f6df791f4a09fe571a06b508a9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,49 @@
using KitsuneCafe.System;
using R3;
using UnityEngine;
using UnityEngine.UIElements;
namespace KitsuneCafe.UI
{
[CreateAssetMenu(menuName = KitsuneCafeMenu.UiEffect + "Fade")]
public class TransitionEffect : BaseUIEffect
{
[SerializeField]
private string propertyName;
[SerializeField]
private SerializableDuration duration;
[SerializeField]
private EasingMode easing;
[SerializeField]
private SerializableDuration delay;
public override IUIEffect Instantiate()
{
return new TransitionEffectInstance(propertyName, duration, easing, delay);
}
}
public readonly struct TransitionEffectInstance : IUIEffect
{
public readonly StylePropertyName PropertyName;
public readonly TimeValue Duration;
public readonly EasingFunction Easing;
public readonly TimeValue Delay;
public TransitionEffectInstance(StylePropertyName name, TimeValue duration, EasingFunction easing, TimeValue delay)
{
PropertyName = name;
Duration = duration;
Easing = easing;
Delay = delay;
}
public Observable<R3.Unit> Execute(VisualElement target)
{
return Observable.Empty<R3.Unit>();
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 94cc50e7b5f20a817aef3384d0889279

View file

@ -0,0 +1,16 @@
using R3;
using UnityEngine;
using UnityEngine.UIElements;
namespace KitsuneCafe.UI
{
public interface IUIEffect
{
Observable<Unit> Execute(VisualElement target);
}
public abstract class BaseUIEffect : ScriptableObject
{
public abstract IUIEffect Instantiate();
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b90c500c681632620a8ce89a8f3aef3f

View file

@ -0,0 +1,19 @@
using UnityEngine;
namespace KitsuneCafe.UI
{
public class Notification : MonoBehaviour
{
[SerializeField]
private UIOrchestrator orchestrator;
[SerializeField]
private ModalElement modal;
[SerializeField]
private string title;
[SerializeField]
private string message;
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 024d27dc807efe80e9810adeb225357b

View file

@ -1,9 +1,10 @@
<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False"> <ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<ui:VisualElement style="flex-grow: 1; background-color: rgba(0, 0, 0, 0);"> <Style src="project://database/Assets/UI/global.uss?fileID=7433441132597879392&amp;guid=79b8bca9bb0db511c919138e0469c94a&amp;type=3#global" />
<ui:VisualElement> <ui:VisualElement name="container" style="background-color: rgba(26, 26, 26, 0.63); border-left-color: rgb(252, 252, 252); border-right-color: rgb(252, 252, 252); border-top-color: rgb(252, 252, 252); border-bottom-color: rgb(252, 252, 252); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; flex-shrink: 1; margin-right: auto; margin-bottom: auto; transition-property: opacity; transition-duration: 1s; transition-timing-function: ease-in-out;">
<ui:Label text="Title" name="title" /> <ui:VisualElement name="title-bar" style="border-bottom-color: rgb(252, 252, 252); border-left-color: rgb(252, 252, 252); border-right-color: rgb(252, 252, 252); border-top-color: rgb(252, 252, 252); border-bottom-width: 1px; padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px;">
<ui:Label text="Title" name="title" enabled="true" class="header" style="color: rgb(252, 252, 252);" />
</ui:VisualElement> </ui:VisualElement>
<ui:VisualElement style="flex-grow: 1;"> <ui:VisualElement style="padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px;">
<ui:Label text="Content" name="content" /> <ui:Label text="Content" name="content" />
</ui:VisualElement> </ui:VisualElement>
</ui:VisualElement> </ui:VisualElement>

View file

@ -0,0 +1,22 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 94cc50e7b5f20a817aef3384d0889279, type: 3}
m_Name: New Transition Effect
m_EditorClassIdentifier:
propertyName:
duration:
duration: 0
unit: 0
easing: 0
delay:
duration: 0
unit: 0

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 630c186ef2ab4b37495b5001d208878f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

12
Assets/UI/global.uss Normal file
View file

@ -0,0 +1,12 @@
:root {
font-size: 24px;
}
Label {
color: rgb(252, 252, 252);
}
Label.header {
color: rgb(252, 252, 252);
-unity-font-style: bold;
}

11
Assets/UI/global.uss.meta Normal file
View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79b8bca9bb0db511c919138e0469c94a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0

View file

@ -1,7 +1,6 @@
{ {
"dependencies": { "dependencies": {
"com.cysharp.r3": "https://github.com/Cysharp/R3.git?path=src/R3.Unity/Assets/R3.Unity", "com.cysharp.r3": "https://github.com/Cysharp/R3.git?path=src/R3.Unity/Assets/R3.Unity",
"com.dbrizov.naughtyattributes": "https://github.com/dbrizov/NaughtyAttributes.git#upm",
"com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity", "com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"com.kelnishi.wacs": "https://github.com/kelnishi/WACS-Unity.git", "com.kelnishi.wacs": "https://github.com/kelnishi/WACS-Unity.git",
"com.unity.2d.sprite": "1.0.0", "com.unity.2d.sprite": "1.0.0",

View file

@ -9,13 +9,6 @@
}, },
"hash": "fbc12b2c0b6a1ee5ce7d534f9db936bc59069219" "hash": "fbc12b2c0b6a1ee5ce7d534f9db936bc59069219"
}, },
"com.dbrizov.naughtyattributes": {
"version": "https://github.com/dbrizov/NaughtyAttributes.git#upm",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "8a8fa5a9659a6d63f196391c71e06c4286c8acd7"
},
"com.github-glitchenzo.nugetforunity": { "com.github-glitchenzo.nugetforunity": {
"version": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity", "version": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"depth": 0, "depth": 0,

View file

@ -11,7 +11,7 @@ TagManager:
- Post Processing - Post Processing
- Water - Water
- UI - UI
- - Player
- -
- -
- -