added: camera framework for camera settings, camera settings change for grapple button #2

Merged
tealtxgr merged 8 commits from player/grapple-feature-add into main 2025-07-15 15:55:59 +00:00
2 changed files with 46 additions and 0 deletions
Showing only changes of commit c8f83603fd - Show all commits

View File

@@ -0,0 +1,35 @@
#if ODIN_INSPECTOR
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using SingularityGroup.HotReload.EditorDependencies;
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
namespace SingularityGroup.HotReload.Editor {
public class HotReloadAttributeProcessor : OdinAttributeProcessor {
public override bool CanProcessChildMemberAttributes(InspectorProperty parentProperty, MemberInfo member) {
return member is FieldInfo;
}
static object nullObject = new object();
public override void ProcessChildMemberAttributes(InspectorProperty property, MemberInfo member, List<Attribute> attributes) {
var field = member as FieldInfo;
if (field?.DeclaringType == null) {
return;
}
if (UnityFieldHelper.TryGetFieldAttributes(field, out var fieldAttributes)) {
attributes.Clear();
attributes.AddRange(fieldAttributes);
}
if (UnityFieldHelper.IsFieldHidden(field.DeclaringType, field.Name)) {
attributes.Add(new HideIfAttribute("@true"));
}
// we assume this is always not null. Most of the times it will not be. If it is the side effect is some memory footprint which hopefully gets cleared when enough objects
var key = property.ParentValues.FirstOrDefault() ?? nullObject;
UnityFieldHelper.CacheFieldInvalidation(key, field, property.RefreshSetup);
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c63452dd912fe4c46909c1c5ce844e69
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: