示例#1
0
        //----- property -----

        //----- method -----

        private static string[] OnWillSaveAssets(string[] paths)
        {
            if (!onApplyPrefab.HasObservers)
            {
                return(paths);
            }

            foreach (var path in paths)
            {
                var prefab = AssetDatabase.LoadMainAssetAtPath(path) as GameObject;

                if (prefab == null)
                {
                    continue;
                }

                var isPrefab = UnityEditorUtility.IsPrefab(prefab);

                if (!isPrefab)
                {
                    continue;
                }

                onApplyPrefab.OnNext(prefab);
            }

            return(paths);
        }
示例#2
0
        private static bool CheckExecute(GameObject target)
        {
            var isPrefab = UnityEditorUtility.IsPrefab(target);

            // Prefabは処理しない.
            if (isPrefab)
            {
                return(false);
            }

            return(true);
        }