예제 #1
0
        private void RespawnFrame()
        {
            transform.DestroyAllChildren();
            var prefab = frameDBEntry.LoadPrefab <UIFrame>();

            if (prefab == null)
            {
                Debug.LogError($"Prefab for UIFrameDBEntry {frameDBEntry} is null. This is {name}.", this);
                return;
            }
            _currentFrame = frameDBEntry.LoadPrefab <UIFrame>().Clone(transform);
#if UNITY_EDITOR
            if (EditorApplication.isPlaying)
            {
                ShowCurrent();
            }
#else
            ShowCurrent();
#endif

            if (stretch)
            {
                _currentFrame.rectTransform.Stretch();
            }

#if UNITY_EDITOR
            _currentFrame.gameObject.hideFlags = HideFlags.DontSave | HideFlags.DontSaveInEditor;
#endif
        }
 public static UIFrame LoadFrame(this UIFrameDBEntry frameDBEntry)
 {
     return(frameDBEntry.LoadPrefab <UIFrame>());
 }