public override GameObject Create() { bool active = original.activeSelf; original.SetActive(true); GameObject l_instance = base.Create(); original.SetActive(active); if (l_instance) { EditorExtra.InitInstantiatedPreviewRecursive(l_instance); } return(l_instance); }
void CreatePreview() { DestroyPreview(); if (!AnimationMode.InAnimationMode()) { return; } if (m_SelectedRenderer) { List <Renderer> l_renderers = new List <Renderer>(); AnimationWindowExtra.rootGameObject.GetComponentsInChildren <Renderer>(l_renderers); foreach (Renderer renderer in l_renderers) { renderer.enabled = renderer == m_SelectedRenderer; } m_InstanceRoot = EditorExtra.InstantiateForAnimatorPreview(AnimationWindowExtra.rootGameObject) as GameObject; foreach (Renderer renderer in l_renderers) { renderer.enabled = true; } } else { m_InstanceRoot = EditorExtra.InstantiateForAnimatorPreview(AnimationWindowExtra.rootGameObject) as GameObject; } EditorExtra.InitInstantiatedPreviewRecursive(m_InstanceRoot); List <Ik2D> ik2Ds = new List <Ik2D>(); m_InstanceRoot.GetComponentsInChildren <Ik2D>(ik2Ds); IkUtils.UpdateAttachedIKs(ik2Ds); m_OnionLayerManager.source = m_InstanceRoot; m_InstanceRoot.SetActive(false); }
void CreatePreview() { DestroyPreview(); if (!AnimationMode.InAnimationMode()) { return; } m_InstanceRoot = EditorExtra.InstantiateForAnimatorPreview(AnimationWindowExtra.rootGameObject) as GameObject; EditorExtra.InitInstantiatedPreviewRecursive(m_InstanceRoot); List <Ik2D> ik2Ds = new List <Ik2D>(); m_InstanceRoot.GetComponentsInChildren <Ik2D>(ik2Ds); IkUtils.UpdateAttachedIKs(ik2Ds); m_OnionLayerManager.source = m_InstanceRoot; m_InstanceRoot.SetActive(false); }