mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 00:08:53 -05:00
Change: DisplayName of field with ShowAlchemySerializationData
This commit is contained in:
parent
d9c9f4f809
commit
af4832ea10
@ -153,9 +153,8 @@ namespace Alchemy.SourceGenerator
|
||||
var typeGenerics = typeSymbol.IsGenericType
|
||||
? "<" + string.Join(", ", typeSymbol.TypeParameters.Select(x => x.Name)) + ">"
|
||||
: "";
|
||||
|
||||
var alchemySerializationDataName = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)
|
||||
.Replace("global::", "").Replace(".", "_");
|
||||
var displayName = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat).Replace("global::", "");
|
||||
var alchemySerializationDataName = displayName.Replace(".", "_");
|
||||
alchemySerializationDataName ="__alchemySerializationData_"+ ReplaceGenericsToCount(alchemySerializationDataName,genericsCount) ;
|
||||
|
||||
var inheritedOnBeforeSerialize = hasInheritedImplementation
|
||||
@ -171,7 +170,7 @@ namespace Alchemy.SourceGenerator
|
||||
or "Alchemy.Serialization.ShowAlchemySerializationDataAttribute");
|
||||
|
||||
var serializationDataAttributesCode = hasShowSerializationData
|
||||
? "[global::Alchemy.Inspector.ReadOnly, global::UnityEngine.TextArea(3, 999), global::UnityEngine.SerializeField]"
|
||||
? $"[global::Alchemy.Inspector.LabelText(\"Alchemy Serialization Data ({displayName})\"),global::Alchemy.Inspector.ReadOnly, global::UnityEngine.TextArea(3, 999), global::UnityEngine.SerializeField]"
|
||||
: "[global::UnityEngine.HideInInspector, global::UnityEngine.SerializeField]";
|
||||
|
||||
// target class namespace
|
||||
|
Binary file not shown.
@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Alchemy.Serialization;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
[AlchemySerialize]
|
||||
public partial class InheritedSerializeTest : InheritedSerializeTestBase<string>
|
||||
namespace Test
|
||||
{
|
||||
[AlchemySerializeField, NonSerialized] int? nullableInt;
|
||||
[ShowAlchemySerializationData]
|
||||
[AlchemySerialize]
|
||||
public partial class InheritedSerializeTest : InheritedSerializeTestBase<string>
|
||||
{
|
||||
[AlchemySerializeField, NonSerialized] int? nullableInt;
|
||||
}
|
||||
}
|
@ -3,11 +3,10 @@ using System.Collections.Generic;
|
||||
using Alchemy.Serialization;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
[ShowAlchemySerializationData]
|
||||
[AlchemySerialize]
|
||||
public partial class InheritedSerializeTestBase<T> : MonoBehaviour
|
||||
{
|
||||
[AlchemySerializeField, NonSerialized] HashSet<T> set;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user