123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- using System.Collections.Generic;
- using System.Runtime.CompilerServices;
- using UnityEngine;
- [assembly: InternalsVisibleTo("Unity.Formats.Fbx.Editor")]
- [assembly: InternalsVisibleTo("Unity.Formats.Fbx.Editor.Tests")]
- [assembly: InternalsVisibleTo("Unity.ProBuilder.AddOns.Editor")]
- namespace UnityEngine.Formats.Fbx.Exporter
- {
- [System.Serializable]
- internal struct StringPair {
- private string m_fbxObjectName;
- public string FBXObjectName
- {
- get { return m_fbxObjectName; }
- set { m_fbxObjectName = value; }
- }
- private string m_unityObjectName;
- public string UnityObjectName
- {
- get { return m_unityObjectName; }
- set { m_unityObjectName = value; }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- internal delegate void HandleUpdate(FbxPrefab updatedInstance, IEnumerable<GameObject> updatedObjects);
-
-
-
-
-
-
-
-
- internal class FbxPrefab : MonoBehaviour
- {
-
-
-
-
-
-
-
- [SerializeField]
- string m_fbxHistory;
- [SerializeField]
- List<StringPair> m_nameMapping = new List<StringPair>();
-
-
-
- [SerializeField]
- [Tooltip("Which FBX file does this refer to?")]
- GameObject m_fbxModel;
-
-
-
- [Tooltip("Should we auto-update this prefab when the FBX file is updated?")]
- [SerializeField]
- bool m_autoUpdate = true;
- public string FbxHistory {
- get{
- return m_fbxHistory;
- }
- set{
- m_fbxHistory = value;
- }
- }
- public List<StringPair> NameMapping
- {
- get
- {
- return m_nameMapping;
- }
- }
- public GameObject FbxModel {
- get{
- return m_fbxModel;
- }
- set{
- m_fbxModel = value;
- }
- }
- public bool AutoUpdate {
- get{
- return m_autoUpdate;
- }
- set{
- m_autoUpdate = value;
- }
- }
-
-
-
-
-
-
- public static event HandleUpdate OnUpdate;
-
-
-
-
-
-
- public static void CallOnUpdate(FbxPrefab instance, IEnumerable<GameObject> updatedObjects){
- if (OnUpdate != null) {
- OnUpdate (instance, updatedObjects);
- }
- }
- }
- }
|