mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 00:08:53 -05:00
Change: naming of generated fields and functions.
This commit is contained in:
parent
cb32709324
commit
d9c9f4f809
@ -156,12 +156,14 @@ namespace Alchemy.SourceGenerator
|
||||
|
||||
var alchemySerializationDataName = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)
|
||||
.Replace("global::", "").Replace(".", "_");
|
||||
alchemySerializationDataName = ReplaceGenericsToCount(alchemySerializationDataName,genericsCount) + "_alchemySerializationData";
|
||||
alchemySerializationDataName ="__alchemySerializationData_"+ ReplaceGenericsToCount(alchemySerializationDataName,genericsCount) ;
|
||||
|
||||
var inheritedSerializationCallback = hasInheritedImplementation
|
||||
? "base.SerializationCallback_AlchemyImpl(isBeforeSerialize);"
|
||||
var inheritedOnBeforeSerialize = hasInheritedImplementation
|
||||
? "base.__AlchemyOnBeforeSerialize();"
|
||||
: string.Empty;
|
||||
var inheritedOnAfterDeserialize = hasInheritedImplementation
|
||||
? "base.__AlchemyOnAfterDeserialize();"
|
||||
: string.Empty;
|
||||
|
||||
var hasShowSerializationData = typeSymbol.GetAttributes().Any(x => x.AttributeClass.Name
|
||||
is "ShowAlchemySerializationData"
|
||||
or "ShowAlchemySerializationDataAttribute"
|
||||
@ -218,31 +220,30 @@ catch (global::System.Exception ex)
|
||||
{{
|
||||
void global::UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
|
||||
{{
|
||||
SerializationCallback_AlchemyImpl(false);
|
||||
__AlchemyOnAfterDeserialize();
|
||||
if (this is global::Alchemy.Serialization.IAlchemySerializationCallbackReceiver receiver) receiver.OnAfterDeserialize();
|
||||
}}
|
||||
|
||||
void global::UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize()
|
||||
{{
|
||||
if (this is global::Alchemy.Serialization.IAlchemySerializationCallbackReceiver receiver) receiver.OnBeforeSerialize();
|
||||
SerializationCallback_AlchemyImpl(true);
|
||||
__AlchemyOnBeforeSerialize();
|
||||
}}
|
||||
|
||||
protected {(hasInheritedImplementation ? "new" : "")} void SerializationCallback_AlchemyImpl(bool isBeforeSerialize = false)
|
||||
|
||||
protected {(hasInheritedImplementation ? "new" : "")} void __AlchemyOnAfterDeserialize()
|
||||
{{
|
||||
{inheritedSerializationCallback}
|
||||
if (isBeforeSerialize)
|
||||
{{
|
||||
{alchemySerializationDataName}.UnityObjectReferences.Clear();
|
||||
{onBeforeSerializeCodeBuilder}
|
||||
|
||||
}}
|
||||
else
|
||||
{{
|
||||
{onAfterDeserializeCodeBuilder}
|
||||
}}
|
||||
{inheritedOnAfterDeserialize}
|
||||
{onAfterDeserializeCodeBuilder}
|
||||
}}
|
||||
|
||||
protected {(hasInheritedImplementation ? "new" : "")} void __AlchemyOnBeforeSerialize()
|
||||
{{
|
||||
{inheritedOnBeforeSerialize}
|
||||
{alchemySerializationDataName}.UnityObjectReferences.Clear();
|
||||
{onBeforeSerializeCodeBuilder}
|
||||
}}
|
||||
|
||||
[global::System.Serializable]
|
||||
sealed class AlchemySerializationData
|
||||
{{
|
||||
|
@ -246,7 +246,7 @@ namespace Alchemy.Editor
|
||||
{
|
||||
declaredType = declaredType.GetGenericTypeDefinition();
|
||||
}
|
||||
var dataName = declaredType.FullName.Replace("`","").Replace(".", "_") + "_alchemySerializationData";
|
||||
var dataName ="__alchemySerializationData_"+ declaredType.FullName.Replace("`","").Replace(".", "_") ;
|
||||
|
||||
SerializedProperty GetProperty() => findPropertyFunc?.Invoke(dataName)
|
||||
.FindPropertyRelative(memberInfo.Name);
|
||||
|
Binary file not shown.
@ -18,21 +18,11 @@ PluginImporter:
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WebGL: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 1
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
AndroidSharedLibraryType: Executable
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
@ -76,15 +66,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
CPU: AnyCPU
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Loading…
Reference in New Issue
Block a user