예제 #1
0
            public void UpdateContent(GUIContent label)
            {
                string message;

                if (!_object)
                {
                    message = "No object specified";
                }
                else if (!Valid)
                {
                    message = "Not in Resources folder or Asset Bundle. Will not be saved.";
                }
                else if (Bundles.IsBundlePath(_path))
                {
                    var bundlePath = Bundles.SplitBundlePath(_path);
                    message = $"Asset Bundle: {bundlePath.Item1}\nPath:{bundlePath.Item2}";
                }
                else
                {
                    message = $"Path: {_path}";
                }

                if (string.IsNullOrEmpty(label.tooltip))
                {
                    Content.tooltip = message;
                }
                else
                {
                    Content.tooltip = $"{label.tooltip}\n{message}";
                }
            }
예제 #2
0
            public Data(SerializedProperty property, GUIContent content)
            {
                _path = property.stringValue;
                string path = Bundles.IsBundlePath(_path) ? Bundles.SplitBundlePath(_path).Item2 : _path;

                _object = AssetDatabase.LoadAssetAtPath <SceneAsset>(path);
                Content = new GUIContent(content);
                UpdateContent(content);
            }
예제 #3
0
 static IScene CreateScene(string location)
 {
     if (Bundles.IsBundlePath(location))
     {
         return(new AssetBundleScene(location));
     }
     else
     {
         return(new BuiltinScene(location));
     }
 }
예제 #4
0
파일: Asset.cs 프로젝트: kolombet/Loadables
 static IAsset <T> CreateAsset <T>(string location) where T : Object
 {
     if (Bundles.IsBundlePath(location))
     {
         return(new AssetBundleAsset <T>(location));
     }
     else
     {
         return(new ResourcesAsset <T>(location));
     }
 }
예제 #5
0
 public Data(SerializedProperty property, GUIContent content)
 {
     _path = property.stringValue;
     if (Bundles.IsBundlePath(_path))
     {
         var bundlePath = Bundles.SplitBundlePath(_path);
         _object = EditorAssetUtil.LoadBundledAsset <Object>(bundlePath.Item1, bundlePath.Item2);
     }
     else
     {
         _object = Resources.Load <Object>(_path);
     }
     Content = new GUIContent(content);
     UpdateContent(content);
 }
예제 #6
0
            public void UpdateContent(GUIContent label)
            {
                string message;

                if (!_object)
                {
                    message = "No object specified";
                }
                else if (!IsValid)
                {
                    message = "Not in Build Settings or Asset Bundle. Will not be saved.";
                }
                else if (Bundles.IsBundlePath(_path))
                {
                    var bundlePath = Bundles.SplitBundlePath(_path);
                    message = $"Asset Bundle: {bundlePath.Item1}\nPath:{bundlePath.Item2}";
                }
                else
                {
                    message = string.Format("Path: {0}", _path);
                }

                Content.tooltip = string.IsNullOrEmpty(label.tooltip) ? message : string.Format("{0}\n{1}", label.tooltip, message);
            }