Optimize import
This commit is contained in:
@@ -18,10 +18,13 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
public List<Shader> ShaderList = new List<Shader>();
|
public List<Shader> ShaderList = new List<Shader>();
|
||||||
public Material TransMaterialCharas;
|
public Material TransMaterialCharas;
|
||||||
public Material TransMaterialProps;
|
public Material TransMaterialProps;
|
||||||
public UmaContainer CurrentContainer;
|
public UmaContainer CurrentUMAContainer;
|
||||||
|
public UmaContainer CurrentLiveContainer;
|
||||||
|
public UmaContainer CurrentOtherContainer;
|
||||||
|
|
||||||
public AnimatorOverrideController OverrideController;
|
public AnimatorOverrideController OverrideController;
|
||||||
|
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
@@ -29,23 +32,18 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
public IEnumerator LoadUma(int id, string costumeId, bool mini)
|
public IEnumerator LoadUma(int id, string costumeId, bool mini)
|
||||||
{
|
{
|
||||||
if (CurrentContainer != null)
|
if (CurrentUMAContainer != null)
|
||||||
{
|
{
|
||||||
Destroy(CurrentContainer);
|
Destroy(CurrentUMAContainer);
|
||||||
}
|
}
|
||||||
CurrentContainer = new GameObject($"{id}_{costumeId}").AddComponent<UmaContainer>();
|
CurrentUMAContainer = new GameObject($"{id}_{costumeId}").AddComponent<UmaContainer>();
|
||||||
|
|
||||||
foreach (var bundle in Main.LoadedBundles)
|
UnloadAllBundle();
|
||||||
{
|
|
||||||
bundle.Value.Unload(true);
|
|
||||||
}
|
|
||||||
Main.LoadedBundles.Clear();
|
|
||||||
UI.LoadedAssetsClear();
|
|
||||||
|
|
||||||
yield return UmaViewerDownload.DownloadText($"https://www.tracenacademy.com/api/CharaData/{id}", txt =>
|
yield return UmaViewerDownload.DownloadText($"https://www.tracenacademy.com/api/CharaData/{id}", txt =>
|
||||||
{
|
{
|
||||||
Debug.Log(txt);
|
Debug.Log(txt);
|
||||||
CurrentContainer.CharaData = JObject.Parse(txt);
|
CurrentUMAContainer.CharaData = JObject.Parse(txt);
|
||||||
if (mini)
|
if (mini)
|
||||||
{
|
{
|
||||||
LoadMiniUma(id, costumeId);
|
LoadMiniUma(id, costumeId);
|
||||||
@@ -59,8 +57,8 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadNormalUma(int id, string costumeId)
|
private void LoadNormalUma(int id, string costumeId)
|
||||||
{
|
{
|
||||||
JObject charaData = CurrentContainer.CharaData;
|
JObject charaData = CurrentUMAContainer.CharaData;
|
||||||
bool genericCostume = CurrentContainer.IsGeneric = costumeId.Length >= 4;
|
bool genericCostume = CurrentUMAContainer.IsGeneric = costumeId.Length >= 4;
|
||||||
string skin = (string)charaData["skin"],
|
string skin = (string)charaData["skin"],
|
||||||
height = (string)charaData["height"],
|
height = (string)charaData["height"],
|
||||||
socks = (string)charaData["socks"],
|
socks = (string)charaData["socks"],
|
||||||
@@ -72,12 +70,12 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
if (genericCostume)
|
if (genericCostume)
|
||||||
{
|
{
|
||||||
costumeIdShort = costumeId.Remove(costumeId.LastIndexOf('_'));
|
costumeIdShort = costumeId.Remove(costumeId.LastIndexOf('_'));
|
||||||
CurrentContainer.VarCostumeIdShort = costumeIdShort;
|
CurrentUMAContainer.VarCostumeIdShort = costumeIdShort;
|
||||||
CurrentContainer.VarCostumeIdLong = costumeId;
|
CurrentUMAContainer.VarCostumeIdLong = costumeId;
|
||||||
CurrentContainer.VarBust = bust;
|
CurrentUMAContainer.VarBust = bust;
|
||||||
CurrentContainer.VarSkin = skin;
|
CurrentUMAContainer.VarSkin = skin;
|
||||||
CurrentContainer.VarSocks = socks;
|
CurrentUMAContainer.VarSocks = socks;
|
||||||
CurrentContainer.VarHeight = height;
|
CurrentUMAContainer.VarHeight = height;
|
||||||
//Not sure about the pattern, some models are missing
|
//Not sure about the pattern, some models are missing
|
||||||
string body = "";
|
string body = "";
|
||||||
if (costumeId.Split('_')[2] == "03")
|
if (costumeId.Split('_')[2] == "03")
|
||||||
@@ -221,11 +219,11 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Load FacialMorph
|
//Load FacialMorph
|
||||||
if (CurrentContainer.Heads.Count > 0)
|
if (CurrentUMAContainer.Heads.Count > 0)
|
||||||
{
|
{
|
||||||
var firsehead = CurrentContainer.Heads[0];
|
var firsehead = CurrentUMAContainer.Heads[0];
|
||||||
var FaceDriven = firsehead.GetComponent<AssetHolder>()._assetTable.list.Find(a => { return a.Key == "facial_target"; }).Value as FaceDrivenKeyTarget;
|
var FaceDriven = firsehead.GetComponent<AssetHolder>()._assetTable.list.Find(a => { return a.Key == "facial_target"; }).Value as FaceDrivenKeyTarget;
|
||||||
CurrentContainer.FaceDrivenKeyTargets = FaceDriven;
|
CurrentUMAContainer.FaceDrivenKeyTargets = FaceDriven;
|
||||||
FaceDriven.callBack = UmaViewerUI.Instance;
|
FaceDriven.callBack = UmaViewerUI.Instance;
|
||||||
FaceDriven.Initialize(firsehead.GetComponentsInChildren<Transform>().ToList());
|
FaceDriven.Initialize(firsehead.GetComponentsInChildren<Transform>().ToList());
|
||||||
}
|
}
|
||||||
@@ -235,9 +233,9 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadMiniUma(int id, string costumeId)
|
private void LoadMiniUma(int id, string costumeId)
|
||||||
{
|
{
|
||||||
JObject charaData = CurrentContainer.CharaData;
|
JObject charaData = CurrentUMAContainer.CharaData;
|
||||||
CurrentContainer.IsMini = true;
|
CurrentUMAContainer.IsMini = true;
|
||||||
bool isGeneric = CurrentContainer.IsGeneric = costumeId.Length >= 4;
|
bool isGeneric = CurrentUMAContainer.IsGeneric = costumeId.Length >= 4;
|
||||||
string skin = (string)charaData["skin"],
|
string skin = (string)charaData["skin"],
|
||||||
height = (string)charaData["height"],
|
height = (string)charaData["height"],
|
||||||
socks = (string)charaData["socks"],
|
socks = (string)charaData["socks"],
|
||||||
@@ -327,40 +325,25 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
public void LoadProp(UmaDatabaseEntry entry)
|
public void LoadProp(UmaDatabaseEntry entry)
|
||||||
{
|
{
|
||||||
if (CurrentContainer != null)
|
if (CurrentOtherContainer != null)
|
||||||
{
|
{
|
||||||
Destroy(CurrentContainer);
|
Destroy(CurrentOtherContainer);
|
||||||
}
|
}
|
||||||
|
UnloadAllBundle();
|
||||||
|
|
||||||
foreach (var bundle in Main.LoadedBundles)
|
CurrentOtherContainer = new GameObject(Path.GetFileName(entry.Name)).AddComponent<UmaContainer>();
|
||||||
{
|
|
||||||
bundle.Value.Unload(true);
|
|
||||||
}
|
|
||||||
Main.LoadedBundles.Clear();
|
|
||||||
UI.LoadedAssetsClear();
|
|
||||||
|
|
||||||
CurrentContainer = new GameObject(Path.GetFileName(entry.Name)).AddComponent<UmaContainer>();
|
|
||||||
RecursiveLoadAsset(entry);
|
RecursiveLoadAsset(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadLive(int id)
|
public void LoadLive(int id)
|
||||||
{
|
{
|
||||||
var asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.EndsWith("cutt_son"+id));
|
var asset = UmaViewerMain.Instance.AbList.FirstOrDefault(a => a.Name.EndsWith("cutt_son"+id));
|
||||||
//LoadAsset(asset);
|
if (CurrentLiveContainer != null)
|
||||||
|
|
||||||
if (CurrentContainer != null)
|
|
||||||
{
|
{
|
||||||
Destroy(CurrentContainer);
|
Destroy(CurrentLiveContainer);
|
||||||
}
|
}
|
||||||
|
UnloadAllBundle();
|
||||||
foreach (var bundle in Main.LoadedBundles)
|
CurrentLiveContainer = new GameObject(Path.GetFileName(asset.Name)).AddComponent<UmaContainer>();
|
||||||
{
|
|
||||||
bundle.Value.Unload(true);
|
|
||||||
}
|
|
||||||
Main.LoadedBundles.Clear();
|
|
||||||
UI.LoadedAssetsClear();
|
|
||||||
|
|
||||||
CurrentContainer = new GameObject(Path.GetFileName(asset.Name)).AddComponent<UmaContainer>();
|
|
||||||
RecursiveLoadAsset(asset);
|
RecursiveLoadAsset(asset);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -414,19 +397,17 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
Type aType = asset.GetType();
|
Type aType = asset.GetType();
|
||||||
if (aType == typeof(AnimationClip))
|
if (aType == typeof(AnimationClip))
|
||||||
{
|
{
|
||||||
if (CurrentContainer.Body)
|
if (CurrentUMAContainer&&CurrentUMAContainer.Body)
|
||||||
{
|
{
|
||||||
AnimationClip bbb = asset as AnimationClip;
|
AnimationClip bbb = asset as AnimationClip;
|
||||||
bbb.wrapMode = WrapMode.Loop;
|
bbb.wrapMode = WrapMode.Loop;
|
||||||
CurrentContainer.OverrideController["clip"] = bbb;
|
CurrentUMAContainer.OverrideController["clip"] = bbb;
|
||||||
|
CurrentUMAContainer.UmaAnimator.Play("clip", 0, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
CurrentContainer.UmaAnimator.Play("clip", 0, 0);
|
if(!CurrentLiveContainer)
|
||||||
UnloadBundle(bundle, false);
|
UnloadBundle(bundle, false);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UnloadBundle(bundle, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (aType == typeof(GameObject))
|
else if (aType == typeof(GameObject))
|
||||||
{
|
{
|
||||||
@@ -434,15 +415,15 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (bundle.name.Contains("chr"))
|
if (bundle.name.Contains("chr"))
|
||||||
{
|
{
|
||||||
GameObject head = Instantiate(asset as GameObject, CurrentContainer.Heads[0].transform);
|
GameObject head = Instantiate(asset as GameObject, CurrentUMAContainer.Heads[0].transform);
|
||||||
}
|
}
|
||||||
else if (bundle.name.Contains("bdy"))
|
else if (bundle.name.Contains("bdy"))
|
||||||
{
|
{
|
||||||
GameObject head = Instantiate(asset as GameObject, CurrentContainer.Body.transform);
|
GameObject head = Instantiate(asset as GameObject, CurrentUMAContainer.Body.transform);
|
||||||
}
|
}
|
||||||
else if (bundle.name.Contains("tail"))
|
else if (bundle.name.Contains("tail"))
|
||||||
{
|
{
|
||||||
GameObject head = Instantiate(asset as GameObject, CurrentContainer.Tail.transform);
|
GameObject head = Instantiate(asset as GameObject, CurrentUMAContainer.Tail.transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -478,15 +459,15 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (bundle.name.Contains("/mini/head"))
|
if (bundle.name.Contains("/mini/head"))
|
||||||
{
|
{
|
||||||
CurrentContainer.MiniHeadTextures.Add(asset as Texture2D);
|
CurrentUMAContainer.MiniHeadTextures.Add(asset as Texture2D);
|
||||||
}
|
}
|
||||||
else if (bundle.name.Contains("/tail/"))
|
else if (bundle.name.Contains("/tail/"))
|
||||||
{
|
{
|
||||||
CurrentContainer.TailTextures.Add(asset as Texture2D);
|
CurrentUMAContainer.TailTextures.Add(asset as Texture2D);
|
||||||
}
|
}
|
||||||
else if (bundle.name.Contains("bdy0"))
|
else if (bundle.name.Contains("bdy0"))
|
||||||
{
|
{
|
||||||
CurrentContainer.GenericBodyTextures.Add(asset as Texture2D);
|
CurrentUMAContainer.GenericBodyTextures.Add(asset as Texture2D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -494,26 +475,26 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadBody(GameObject go)
|
private void LoadBody(GameObject go)
|
||||||
{
|
{
|
||||||
CurrentContainer.Body = Instantiate(go, CurrentContainer.transform);
|
CurrentUMAContainer.Body = Instantiate(go, CurrentUMAContainer.transform);
|
||||||
CurrentContainer.UmaAnimator = CurrentContainer.Body.GetComponent<Animator>();
|
CurrentUMAContainer.UmaAnimator = CurrentUMAContainer.Body.GetComponent<Animator>();
|
||||||
CurrentContainer.UmaAnimator.runtimeAnimatorController = CurrentContainer.OverrideController = Instantiate(OverrideController);
|
CurrentUMAContainer.UmaAnimator.runtimeAnimatorController = CurrentUMAContainer.OverrideController = Instantiate(OverrideController);
|
||||||
|
|
||||||
if (CurrentContainer.IsGeneric)
|
if (CurrentUMAContainer.IsGeneric)
|
||||||
{
|
{
|
||||||
List<Texture2D> textures = CurrentContainer.GenericBodyTextures;
|
List<Texture2D> textures = CurrentUMAContainer.GenericBodyTextures;
|
||||||
string costumeIdShort = CurrentContainer.VarCostumeIdShort,
|
string costumeIdShort = CurrentUMAContainer.VarCostumeIdShort,
|
||||||
costumeIdLong = CurrentContainer.VarCostumeIdLong,
|
costumeIdLong = CurrentUMAContainer.VarCostumeIdLong,
|
||||||
height = CurrentContainer.VarHeight,
|
height = CurrentUMAContainer.VarHeight,
|
||||||
skin = CurrentContainer.VarSkin,
|
skin = CurrentUMAContainer.VarSkin,
|
||||||
socks = CurrentContainer.VarSocks,
|
socks = CurrentUMAContainer.VarSocks,
|
||||||
bust = CurrentContainer.VarBust;
|
bust = CurrentUMAContainer.VarBust;
|
||||||
|
|
||||||
foreach (Renderer r in CurrentContainer.Body.GetComponentsInChildren<Renderer>())
|
foreach (Renderer r in CurrentUMAContainer.Body.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
foreach (Material m in r.sharedMaterials)
|
foreach (Material m in r.sharedMaterials)
|
||||||
{
|
{
|
||||||
string mainTex = "", toonMap = "", tripleMap = "", optionMap = "";
|
string mainTex = "", toonMap = "", tripleMap = "", optionMap = "";
|
||||||
if (CurrentContainer.IsMini)
|
if (CurrentUMAContainer.IsMini)
|
||||||
{
|
{
|
||||||
|
|
||||||
m.SetTexture("_MainTex", textures[0]);
|
m.SetTexture("_MainTex", textures[0]);
|
||||||
@@ -585,7 +566,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (Renderer r in CurrentContainer.Body.GetComponentsInChildren<Renderer>())
|
foreach (Renderer r in CurrentUMAContainer.Body.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
foreach (Material m in r.sharedMaterials)
|
foreach (Material m in r.sharedMaterials)
|
||||||
{
|
{
|
||||||
@@ -600,10 +581,10 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadHead(GameObject go)
|
private void LoadHead(GameObject go)
|
||||||
{
|
{
|
||||||
GameObject head = Instantiate(go, CurrentContainer.transform);
|
GameObject head = Instantiate(go, CurrentUMAContainer.transform);
|
||||||
CurrentContainer.Heads.Add(head);
|
CurrentUMAContainer.Heads.Add(head);
|
||||||
CurrentContainer.HeadNeckBones.Add(UmaContainer.FindBoneInChildren(head.transform, "Neck"));
|
CurrentUMAContainer.HeadNeckBones.Add(UmaContainer.FindBoneInChildren(head.transform, "Neck"));
|
||||||
CurrentContainer.HeadHeadBones.Add(UmaContainer.FindBoneInChildren(head.transform, "Head"));
|
CurrentUMAContainer.HeadHeadBones.Add(UmaContainer.FindBoneInChildren(head.transform, "Head"));
|
||||||
|
|
||||||
foreach (Renderer r in head.GetComponentsInChildren<Renderer>())
|
foreach (Renderer r in head.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
@@ -613,24 +594,24 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (r.name == "M_Face")
|
if (r.name == "M_Face")
|
||||||
{
|
{
|
||||||
m.SetTexture("_MainTex", CurrentContainer.MiniHeadTextures.First(t => t.name.Contains("face") && t.name.Contains("diff")));
|
m.SetTexture("_MainTex", CurrentUMAContainer.MiniHeadTextures.First(t => t.name.Contains("face") && t.name.Contains("diff")));
|
||||||
}
|
}
|
||||||
if (r.name == "M_Cheek")
|
if (r.name == "M_Cheek")
|
||||||
{
|
{
|
||||||
m.CopyPropertiesFromMaterial(TransMaterialCharas);
|
m.CopyPropertiesFromMaterial(TransMaterialCharas);
|
||||||
m.SetTexture("_MainTex", CurrentContainer.MiniHeadTextures.First(t => t.name.Contains("cheek")));
|
m.SetTexture("_MainTex", CurrentUMAContainer.MiniHeadTextures.First(t => t.name.Contains("cheek")));
|
||||||
}
|
}
|
||||||
if (r.name == "M_Mouth")
|
if (r.name == "M_Mouth")
|
||||||
{
|
{
|
||||||
m.SetTexture("_MainTex", CurrentContainer.MiniHeadTextures.First(t => t.name.Contains("mouth")));
|
m.SetTexture("_MainTex", CurrentUMAContainer.MiniHeadTextures.First(t => t.name.Contains("mouth")));
|
||||||
}
|
}
|
||||||
if (r.name == "M_Eye")
|
if (r.name == "M_Eye")
|
||||||
{
|
{
|
||||||
m.SetTexture("_MainTex", CurrentContainer.MiniHeadTextures.First(t => t.name.Contains("eye")));
|
m.SetTexture("_MainTex", CurrentUMAContainer.MiniHeadTextures.First(t => t.name.Contains("eye")));
|
||||||
}
|
}
|
||||||
if (r.name.StartsWith("M_Mayu_"))
|
if (r.name.StartsWith("M_Mayu_"))
|
||||||
{
|
{
|
||||||
m.SetTexture("_MainTex", CurrentContainer.MiniHeadTextures.First(t => t.name.Contains("mayu")));
|
m.SetTexture("_MainTex", CurrentUMAContainer.MiniHeadTextures.First(t => t.name.Contains("mayu")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -678,11 +659,11 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadTail(GameObject gameObject)
|
private void LoadTail(GameObject gameObject)
|
||||||
{
|
{
|
||||||
Transform hHip = UmaContainer.FindBoneInChildren(CurrentContainer.Body.transform, "Hip");
|
Transform hHip = UmaContainer.FindBoneInChildren(CurrentUMAContainer.Body.transform, "Hip");
|
||||||
if (hHip == null) return;
|
if (hHip == null) return;
|
||||||
CurrentContainer.Tail = Instantiate(gameObject, hHip);
|
CurrentUMAContainer.Tail = Instantiate(gameObject, hHip);
|
||||||
var textures = CurrentContainer.TailTextures;
|
var textures = CurrentUMAContainer.TailTextures;
|
||||||
foreach (Renderer r in CurrentContainer.Tail.GetComponentsInChildren<Renderer>())
|
foreach (Renderer r in CurrentUMAContainer.Tail.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
foreach (Material m in r.sharedMaterials)
|
foreach (Material m in r.sharedMaterials)
|
||||||
{
|
{
|
||||||
@@ -697,7 +678,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
|
|
||||||
private void LoadProp(GameObject go)
|
private void LoadProp(GameObject go)
|
||||||
{
|
{
|
||||||
var prop = Instantiate(go, CurrentContainer.transform);
|
var prop = Instantiate(go, (go.name.Contains("Cutt_son")?CurrentLiveContainer:CurrentOtherContainer).transform);
|
||||||
foreach (Renderer r in prop.GetComponentsInChildren<Renderer>())
|
foreach (Renderer r in prop.GetComponentsInChildren<Renderer>())
|
||||||
{
|
{
|
||||||
foreach (Material m in r.sharedMaterials)
|
foreach (Material m in r.sharedMaterials)
|
||||||
@@ -718,4 +699,20 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
bundle.Unload(unloadAllObjects);
|
bundle.Unload(unloadAllObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UnloadAllBundle(bool unloadAllObjects = false)
|
||||||
|
{
|
||||||
|
foreach (var bundle in Main.LoadedBundles)
|
||||||
|
{
|
||||||
|
bundle.Value.Unload(unloadAllObjects);
|
||||||
|
}
|
||||||
|
if (unloadAllObjects)
|
||||||
|
{
|
||||||
|
if (CurrentUMAContainer) Destroy(CurrentUMAContainer);
|
||||||
|
if (CurrentLiveContainer) Destroy(CurrentLiveContainer);
|
||||||
|
if (CurrentOtherContainer) Destroy(CurrentOtherContainer);
|
||||||
|
}
|
||||||
|
Main.LoadedBundles.Clear();
|
||||||
|
UI.LoadedAssetsClear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,9 +378,9 @@ public class UmaViewerUI : MonoBehaviour,FaceLoadCallBack
|
|||||||
|
|
||||||
public void SetDynamicBoneEnable(bool isOn)
|
public void SetDynamicBoneEnable(bool isOn)
|
||||||
{
|
{
|
||||||
if (Builder.CurrentContainer)
|
if (Builder.CurrentUMAContainer)
|
||||||
{
|
{
|
||||||
foreach(CySpringDataContainer cySpring in Builder.CurrentContainer.GetComponentsInChildren<CySpringDataContainer>())
|
foreach(CySpringDataContainer cySpring in Builder.CurrentUMAContainer.GetComponentsInChildren<CySpringDataContainer>())
|
||||||
{
|
{
|
||||||
cySpring.EnablePhysics(isOn);
|
cySpring.EnablePhysics(isOn);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user