31 changed files with 315 additions and 59 deletions
@ -0,0 +1,31 @@ |
|||||||
|
using System; |
||||||
|
using OfficeOpenXml; |
||||||
|
|
||||||
|
namespace Tools.ExcelResolver.Editor |
||||||
|
{ |
||||||
|
internal class TExcel : TType |
||||||
|
{ |
||||||
|
public TExcel() { } |
||||||
|
public TExcel(string typeText, Type classType) : base(typeText) |
||||||
|
{ |
||||||
|
RealType = classType; |
||||||
|
FieldWriteFormat = RealType.Name; |
||||||
|
} |
||||||
|
internal override Type RealType { get; } |
||||||
|
internal override string FieldWriteFormat { get; } |
||||||
|
internal override object DefaultValue => null; |
||||||
|
|
||||||
|
internal override bool String2TType(string typeText, out TType result) |
||||||
|
{ |
||||||
|
result = null; |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
internal override object TryParseFrom(string cellText) |
||||||
|
{ |
||||||
|
var path = $"{ExcelResolverEditorWindow.Instance.excelResolverConfig.SOPathRoot}/{FieldWriteFormat}/{FieldWriteFormat}_{cellText}.asset"; |
||||||
|
var so = UnityEditor.AssetDatabase.LoadAssetAtPath(path, RealType); |
||||||
|
return so; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 7adf27c928ee4207b5e71ef2fafe6788 |
||||||
|
timeCreated: 1739374254 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: d158d305a64ac74428b71f7a8f6ae16c |
guid: c34cba1a45d61ab4ebe6c0dffbd44be3 |
||||||
DefaultImporter: |
DefaultImporter: |
||||||
externalObjects: {} |
externalObjects: {} |
||||||
userData: |
userData: |
@ -1,5 +1,5 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: e5c0e3f65d74bde49a58ac6713bd2d2c |
guid: 1efddd263be56e042862c0687b477f7d |
||||||
folderAsset: yes |
folderAsset: yes |
||||||
DefaultImporter: |
DefaultImporter: |
||||||
externalObjects: {} |
externalObjects: {} |
@ -1,5 +1,5 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: 7eaf28151ff5fcd4a87ffbd6994825a0 |
guid: 95d14bae9d1fbb0498fbe9baf74a1d09 |
||||||
NativeFormatImporter: |
NativeFormatImporter: |
||||||
externalObjects: {} |
externalObjects: {} |
||||||
mainObjectFileID: 11400000 |
mainObjectFileID: 11400000 |
@ -0,0 +1,56 @@ |
|||||||
|
%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: 62b3c489e7d803047a1ecff490b69951, type: 3} |
||||||
|
m_Name: _HeroUtil |
||||||
|
m_EditorClassIdentifier: |
||||||
|
serializationData: |
||||||
|
SerializedFormat: 2 |
||||||
|
SerializedBytes: |
||||||
|
ReferencedUnityObjects: |
||||||
|
- {fileID: 11400000, guid: 95d14bae9d1fbb0498fbe9baf74a1d09, type: 2} |
||||||
|
SerializedBytesString: |
||||||
|
Prefab: {fileID: 0} |
||||||
|
PrefabModificationsReferencedUnityObjects: [] |
||||||
|
PrefabModifications: [] |
||||||
|
SerializationNodes: |
||||||
|
- Name: Data |
||||||
|
Entry: 7 |
||||||
|
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[Tools.ExcelResolver.Hero, |
||||||
|
Assembly-CSharp]], mscorlib |
||||||
|
- Name: comparer |
||||||
|
Entry: 7 |
||||||
|
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32, |
||||||
|
mscorlib]], mscorlib |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 12 |
||||||
|
Data: 1 |
||||||
|
- Name: |
||||||
|
Entry: 7 |
||||||
|
Data: |
||||||
|
- Name: $k |
||||||
|
Entry: 3 |
||||||
|
Data: 1 |
||||||
|
- Name: $v |
||||||
|
Entry: 10 |
||||||
|
Data: 0 |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 13 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
@ -1,5 +1,5 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: 3bbf9021da858e346ad465fac30a4fcf |
guid: f690e8a9ed7a6ba4b820723f62dd9dca |
||||||
NativeFormatImporter: |
NativeFormatImporter: |
||||||
externalObjects: {} |
externalObjects: {} |
||||||
mainObjectFileID: 11400000 |
mainObjectFileID: 11400000 |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 9d73100d55f4eea4caa64830a497134f |
||||||
|
folderAsset: yes |
||||||
|
DefaultImporter: |
||||||
|
externalObjects: {} |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: e467b358cf9ecf54f9b2590d0e514d84 |
||||||
|
NativeFormatImporter: |
||||||
|
externalObjects: {} |
||||||
|
mainObjectFileID: 11400000 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
@ -0,0 +1,56 @@ |
|||||||
|
%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: dd0ef693880177f45a9004e73924b60a, type: 3} |
||||||
|
m_Name: _PetUtil |
||||||
|
m_EditorClassIdentifier: |
||||||
|
serializationData: |
||||||
|
SerializedFormat: 2 |
||||||
|
SerializedBytes: |
||||||
|
ReferencedUnityObjects: |
||||||
|
- {fileID: 11400000, guid: e467b358cf9ecf54f9b2590d0e514d84, type: 2} |
||||||
|
SerializedBytesString: |
||||||
|
Prefab: {fileID: 0} |
||||||
|
PrefabModificationsReferencedUnityObjects: [] |
||||||
|
PrefabModifications: [] |
||||||
|
SerializationNodes: |
||||||
|
- Name: Data |
||||||
|
Entry: 7 |
||||||
|
Data: 0|System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[Tools.ExcelResolver.Pet, |
||||||
|
Assembly-CSharp]], mscorlib |
||||||
|
- Name: comparer |
||||||
|
Entry: 7 |
||||||
|
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.Int32, |
||||||
|
mscorlib]], mscorlib |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 12 |
||||||
|
Data: 1 |
||||||
|
- Name: |
||||||
|
Entry: 7 |
||||||
|
Data: |
||||||
|
- Name: $k |
||||||
|
Entry: 3 |
||||||
|
Data: 1 |
||||||
|
- Name: $v |
||||||
|
Entry: 10 |
||||||
|
Data: 0 |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 13 |
||||||
|
Data: |
||||||
|
- Name: |
||||||
|
Entry: 8 |
||||||
|
Data: |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: e3a29f1b76728d64aaefb7c9c4e69390 |
||||||
|
NativeFormatImporter: |
||||||
|
externalObjects: {} |
||||||
|
mainObjectFileID: 11400000 |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
@ -0,0 +1,2 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 923ab6070481382408c6cae6284e8863 |
@ -0,0 +1,25 @@ |
|||||||
|
//------------------------------------------------------------------------------ |
||||||
|
// <auto-generated> |
||||||
|
// This code was generated by a tool. |
||||||
|
// Runtime Version:4.0.30319.42000 |
||||||
|
// |
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if |
||||||
|
// the code is regenerated. |
||||||
|
// </auto-generated> |
||||||
|
//------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
namespace Tools.ExcelResolver |
||||||
|
{ |
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
using System.Collections.Generic; |
||||||
|
using UnityEngine; |
||||||
|
using Sirenix.OdinInspector; |
||||||
|
|
||||||
|
|
||||||
|
public class HeroUtil : SerializedScriptableObject, IExcelSOUtil |
||||||
|
{ |
||||||
|
|
||||||
|
public Dictionary<System.Int32, Hero> Data; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,2 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 62b3c489e7d803047a1ecff490b69951 |
@ -0,0 +1,28 @@ |
|||||||
|
//------------------------------------------------------------------------------ |
||||||
|
// <auto-generated> |
||||||
|
// This code was generated by a tool. |
||||||
|
// Runtime Version:4.0.30319.42000 |
||||||
|
// |
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if |
||||||
|
// the code is regenerated. |
||||||
|
// </auto-generated> |
||||||
|
//------------------------------------------------------------------------------ |
||||||
|
|
||||||
|
namespace Tools.ExcelResolver |
||||||
|
{ |
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
using System.Collections.Generic; |
||||||
|
using UnityEngine; |
||||||
|
using Sirenix.OdinInspector; |
||||||
|
|
||||||
|
|
||||||
|
public class Pet : SerializedScriptableObject, IExcelSOData |
||||||
|
{ |
||||||
|
|
||||||
|
/// <summary> |
||||||
|
/// 宠物id |
||||||
|
/// </summary> |
||||||
|
public int id; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,2 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 9022e9d3e95cff54faa7f22f0c316aee |
@ -0,0 +1,2 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: dd0ef693880177f45a9004e73924b60a |
@ -1,2 +0,0 @@ |
|||||||
fileFormatVersion: 2 |
|
||||||
guid: 83f98c6ff7089dc4ba08b80c69d1c01f |
|
Loading…
Reference in new issue