mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Improve integration with Live2D assets
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
namespace AssetStudio
|
||||
{
|
||||
public abstract class Behaviour : Component
|
||||
{
|
||||
public byte m_Enabled;
|
||||
|
||||
public Behaviour() { }
|
||||
|
||||
protected Behaviour(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_Enabled = reader.ReadByte();
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
namespace AssetStudio
|
||||
{
|
||||
public abstract class Component : EditorExtension
|
||||
{
|
||||
public PPtr<GameObject> m_GameObject;
|
||||
|
||||
public Component() { }
|
||||
|
||||
protected Component(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_GameObject = new PPtr<GameObject>(reader);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
@@ -16,6 +13,8 @@ namespace AssetStudio
|
||||
public SkinnedMeshRenderer m_SkinnedMeshRenderer;
|
||||
public Animator m_Animator;
|
||||
public Animation m_Animation;
|
||||
[JsonIgnore]
|
||||
public CubismModel CubismModel;
|
||||
|
||||
public GameObject(ObjectReader reader) : base(reader)
|
||||
{
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace AssetStudio
|
||||
namespace AssetStudio
|
||||
{
|
||||
public sealed class MonoBehaviour : Behaviour
|
||||
public class MonoBehaviour : Behaviour
|
||||
{
|
||||
public PPtr<MonoScript> m_Script;
|
||||
public string m_Name;
|
||||
|
||||
public MonoBehaviour() { }
|
||||
|
||||
public MonoBehaviour(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_Script = new PPtr<MonoScript>(reader);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
@@ -6,10 +7,16 @@ namespace AssetStudio
|
||||
{
|
||||
public int m_FileID;
|
||||
public long m_PathID;
|
||||
public string Name => TryGet(out var result) ? result.Name : string.Empty;
|
||||
public string Name => _assetsFile != null && TryGet(out var result) ? result.Name : string.Empty;
|
||||
|
||||
private SerializedFile _assetsFile;
|
||||
private int _index = -2; //-2 - Prepare, -1 - Missing
|
||||
private SerializedFile _assetsFile;
|
||||
[JsonIgnore]
|
||||
public SerializedFile AssetsFile
|
||||
{
|
||||
get => _assetsFile;
|
||||
set => _assetsFile = value;
|
||||
}
|
||||
|
||||
public PPtr(ObjectReader reader)
|
||||
{
|
||||
@@ -20,11 +27,6 @@ namespace AssetStudio
|
||||
|
||||
public PPtr() { }
|
||||
|
||||
public void SetAssetsFile(SerializedFile assetsFile)
|
||||
{
|
||||
_assetsFile = assetsFile;
|
||||
}
|
||||
|
||||
private bool TryGetAssetsFile(out SerializedFile result)
|
||||
{
|
||||
result = null;
|
||||
|
||||
Reference in New Issue
Block a user