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}"; } }
public AssetBundleScene(string location) { var bundlePath = Bundles.SplitBundlePath(location); BundleName = bundlePath.Item1; SceneName = bundlePath.Item2; }
public AssetBundleAsset(string path) { var bundlePath = Bundles.SplitBundlePath(path); BundleName = bundlePath.Item1; AssetName = bundlePath.Item2; }
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); }
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); }
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); }