public Bundle() { Minify = true; Assets = new AssetCollection(); BrowserTtl = 525949; //1 year default Host = ""; }
static void Prefix(ref AssetCollection assetCollection) { SessionManagerStatic.CustomAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.dataPath, "../CustomAssets/mytestbundle")); for (int i = 0; i < assetCollection.Models.Assets.Count; i++) { if (assetCollection.Models.Assets[i].AssetID == "workplaces/tables/bld_tinker_tier01") { SceneDumper.Dump(assetCollection.Models.Assets[i].Data, @"E:\GC_Test.txt"); assetCollection.Models.Assets[i].Data = SessionManagerStatic.CustomAssetBundle.LoadAsset <GameObject>("Lathe-2"); // Transform old = assetCollection.Models.Assets[i].Data.transform.Find("tinker_table3x1").transform; // Vector3 position = old.position; // Quaternion rotation = old.rotation; // Vector3 scale = old.localScale; // // GameObject.Destroy(old.gameObject); // // GameObject lathe = // UnityEngine.GameObject.Instantiate<GameObject>( // SessionManagerStatic.CustomAssetBundle.LoadAsset<GameObject>("Lathe")); // // lathe.transform.position = position; // lathe.transform.rotation = rotation; // lathe.transform.localScale = scale; // // lathe.transform.parent = assetCollection.Models.Assets[i].Data; break; } } }
public void LoadGraph() { List <PropertyCollector.TextureInfo> lti; var assetCollection = new AssetCollection(); ShaderGraphImporter.GetShaderText(kGraphName, out lti, assetCollection, out m_Graph); Assert.NotNull(m_Graph, $"Invalid graph data found for {kGraphName}"); m_Graph.ValidateGraph(); m_Collector = new PropertyCollector(); m_Graph.CollectShaderProperties(m_Collector, GenerationMode.ForReals); // Open up the window if (!ShaderGraphImporterEditor.ShowGraphEditWindow(kGraphName)) { Assert.Fail("ShaderGraphImporterEditor.ShowGraphEditWindow could not open " + kGraphName); } m_Window = EditorWindow.GetWindow <MaterialGraphEditWindow>(); if (m_Window == null) { Assert.Fail("Could not open window"); } // EditorWindow.GetWindow will return a new window if one is not found. A new window will have graphObject == null. if (m_Window.graphObject == null) { Assert.Fail("Existing Shader Graph window of " + kGraphName + " not found."); } m_GraphEditorView = m_Window.graphEditorView; }
public UnityScene(AssetCollection assetCollection) { this.assetCollection = assetCollection; rootNode = new UnityNode("Scene"); nodes = new List <VisualizerNode>(); camera = new UnityCamera(); }
// void Awake() { #if UNITY_EDITOR if (!UnityEditor.EditorApplication.isPlaying) return; #endif mInstance = this; int width = Screen.width > Screen.height ? Screen.width : Screen.height; bool hd = width > MaxWidth; CurrentAssetSuffix = hd ? AssetSuffix : ""; // Load the asset collection prefab string assetName = hd ? Asset2xName : DefaultAssetName; GameObject go = Resources.Load<GameObject>(assetName); if (go != null) { mActiveAsset = go.GetComponent<AssetCollection>(); mActiveAsset.Initialize(); } else { Debug.LogError("Multires: Load asset failed: " + assetName); } DebugPrint(); #if !UNITY_EDITOR DontDestroyOnLoad(this); #endif }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); // Set the appropriate toolbarItems based on the mediaType of the asset. if (Asset.MediaType == PHAssetMediaType.Video) { ShowPlaybackToolbar(); } else { ShowStaticToolbar(); } // Enable the edit button if the asset can be edited. bool isEditable = Asset.CanPerformEditOperation(PHAssetEditOperation.Properties) || Asset.CanPerformEditOperation(PHAssetEditOperation.Content); EditButton.Enabled = isEditable; // Enable the trash button if the asset can be deleted. bool isTrashable = AssetCollection != null? AssetCollection.CanPerformEditOperation(PHCollectionEditOperation.RemoveContent) : Asset.CanPerformEditOperation(PHAssetEditOperation.Delete); TrashButton.Enabled = isTrashable; UpdateImage(); View.LayoutIfNeeded(); }
public void SetRange(int index, AssetCollection values) { EfficioRuntimePINVOKE.AssetCollection_SetRange(swigCPtr, index, AssetCollection.getCPtr(values)); if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } }
public void GetSourceAssetDependencies(AssetCollection assetCollection) { if ((diffusionProfile != null) && AssetDatabase.TryGetGUIDAndLocalFileIdentifier(diffusionProfile, out string guid, out long localId)) { // diffusion profile is a ScriptableObject, so this is an artifact dependency assetCollection.AddAssetDependency(new GUID(guid), AssetCollection.Flags.ArtifactDependency); } }
public void LoadGraph() { List <PropertyCollector.TextureInfo> lti; var assetCollection = new AssetCollection(); ShaderGraphImporter.GetShaderText(kGraphName, out lti, assetCollection, out m_Graph); Assert.NotNull(m_Graph, $"Invalid graph data found for {kGraphName}"); }
private static StringBuilder TryBuildFromShaderGraph(VFXShaderGraphParticleOutput context, VFXContextCompiledData contextData) { var stringBuilder = new StringBuilder(); // Reconstruct the ShaderGraph. var path = AssetDatabase.GetAssetPath(context.GetOrRefreshShaderGraphObject()); List <PropertyCollector.TextureInfo> configuredTextures; AssetCollection assetCollection = new AssetCollection(); MinimalGraphData.GatherMinimalDependenciesFromFile(path, assetCollection); var textGraph = File.ReadAllText(path, Encoding.UTF8); var graph = new GraphData { messageManager = new MessageManager(), assetGuid = AssetDatabase.AssetPathToGUID(path) }; MultiJson.Deserialize(graph, textGraph); graph.OnEnable(); graph.ValidateGraph(); // Check the validity of the shader graph (unsupported keywords or shader property usage). if (VFXLibrary.currentSRPBinder == null || !VFXLibrary.currentSRPBinder.IsGraphDataValid(graph)) { return(null); } var target = graph.activeTargets.Where(o => { if (o.SupportsVFX()) { //We are assuming the target has been implemented in the same package than srp binder. var srpBinderAssembly = VFXLibrary.currentSRPBinder.GetType().Assembly; var targetAssembly = o.GetType().Assembly; if (srpBinderAssembly == targetAssembly) { return(true); } } return(false); }).FirstOrDefault(); if (target == null || !target.TryConfigureContextData(context, contextData)) { return(null); } // Use ShaderGraph to generate the VFX shader. var text = ShaderGraphImporter.GetShaderText(path, out configuredTextures, assetCollection, graph, GenerationMode.VFX, new[] { target }); // Append the shader + strip the name header (VFX stamps one in later on). stringBuilder.Append(text); stringBuilder.Remove(0, text.IndexOf("{", StringComparison.Ordinal)); return(stringBuilder); }
/// <summary> /// 批量装载 /// </summary> internal static void LoadFromDALPatch(List <AssetInfo> pList, AssetCollection pCollection) { foreach (Asset asset in pCollection) { AssetInfo assetInfo = new AssetInfo(); LoadFromDAL(assetInfo, asset); pList.Add(assetInfo); } }
static void Main(string[] args) { List <Tuple <string, int> > files = new List <Tuple <string, int> >(); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-RMH O&M-2017-07-06-00-27-01-551\RHM Asset List.xlsx", 2)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List - 100 Waymouth Signarama.xlsx", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List 100 Waymouth Street Adelaide.xlsx", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List -Tiles.xls", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List -Titan Interiors.xls", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List- Waymouth St. from Estilo.xls", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Asset List-HN.xls", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Contract Carpets - Asset Register.xlsx",2)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Copy of Asset List 2-METRO JOINERY (2).xls",2)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Koreana Tiles - Asset List.xls", 1)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Otis Lifts - Asset List - GB.xls", 2)); //files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\RIS Roof Safe - Asset List.xls", 1)); // files.Add(new Tuple<string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\SA Commercial Blinds_Asset List_100 Waymouth_Nov 2012.xls", 1)); files.Add(new Tuple <string, int>(@"C:\OraDocDrive\Oracle Content\Cabinet\HelperFiles\Handover2\Customer examples\Asset lists examples\AU1\Aconex Handover-100 Waymouth Street-2017-07-06-00-23-36-226\Tyrone Electrical - Asset List.xls", 1)); DataTable dt = null; foreach (var file in files) { Console.WriteLine("Loading file " + file.Item1); string filetype = file.Item1.Substring(file.Item1.LastIndexOf(".", StringComparison.CurrentCulture) + 1); switch (filetype) { case "xls": case "xlsx": { dt = ImportFromExcel(file.Item1, file.Item2); break; } } if (dt != null) { AssetCollection ar = CreateAssetRegister(dt); var xmlSerializer = new XmlSerializer(ar.GetType()); var stringBuilder = new StringBuilder(); var xmlTextWriter = XmlWriter.Create(stringBuilder, new XmlWriterSettings { NewLineChars = "\r\n", Indent = true }); xmlSerializer.Serialize(xmlTextWriter, ar); var finalXml = stringBuilder.ToString(); Console.WriteLine("Creating xml"); File.WriteAllText(file.Item1 + ".xml", finalXml); Console.WriteLine("Xml Created"); dt = null; } } }
public static AssetCollection Load(string path) { AssetCollection assetCollection = AssetDatabase.LoadAssetAtPath(path + ".asset", typeof(AssetCollection)) as AssetCollection; if (assetCollection == null) { Debug.LogError("Unable to load package export collection: " + path); } return(assetCollection); }
public UnityMesh(AssetCollection assetCollection, VisualizerMesh visualizerMesh, UnityNode parent, string label) : base(parent, label) { var renderer = gameObject.AddComponent <MeshRenderer>(); var color = visualizerMesh.Color.ToUnityColor(); renderer.material = assetCollection.CreateMaterial(color); var filter = gameObject.AddComponent <MeshFilter>(); filter.mesh = visualizerMesh.ToUnityMesh(); }
internal GraphData LoadGraph(string graphPath) { List <PropertyCollector.TextureInfo> lti; var assetCollection = new AssetCollection(); ShaderGraphImporter.GetShaderText(graphPath, out lti, assetCollection, out var graph); Assert.NotNull(graph, $"Invalid graph data found for {graphPath}"); graph.OnEnable(); graph.ValidateGraph(); return(graph); }
public AssetCollection GetRange(int index, int count) { global::System.IntPtr cPtr = EfficioRuntimePINVOKE.AssetCollection_GetRange(swigCPtr, index, count); AssetCollection ret = (cPtr == global::System.IntPtr.Zero) ? null : new AssetCollection(cPtr, true); if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// get asset collection by query /// </summary> /// <param name="query"></param> /// <param name="page"></param> /// <param name="limit"></param> /// <returns></returns> public AssetCollection GetAssetCollection(string query, int page = 1, int limit = 10) { // modify/explode query to override pagination query += $"&page={page}&limit={limit}&total=1"; var apiResult = Get($"{_customerBynderUrl}/api/v4/media/?" + query); AssetCollection collection = JsonConvert.DeserializeObject <AssetCollection>(apiResult); collection.Page = page; collection.Limit = limit; return(collection); }
public static AssetCollection Repeat(Asset value, int count) { global::System.IntPtr cPtr = EfficioRuntimePINVOKE.AssetCollection_Repeat(Asset.getCPtr(value), count); AssetCollection ret = (cPtr == global::System.IntPtr.Zero) ? null : new AssetCollection(cPtr, true); if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// /// </summary> public ContentBuilder(string contentProject, string targetDirectory, DevConForm devcon, Game game) { Modified = false; this.developerConsole = devcon; this.game = game; this.contentProject = Path.GetFullPath(contentProject); this.sourceDirectory = Path.GetFullPath(Path.GetDirectoryName(contentProject)); this.targetDirectory = targetDirectory; assets = new AssetCollection(); }
private void OnContextSceneChanged() { if (textureAssets != null) { textureAssets.OnAssetAdded -= OnTextureAssetsAdded; } TextureAssets = Context.Scene?.AssetPool.GetCollection <TextureAsset>(); if (textureAssets != null) { textureAssets.OnAssetAdded += OnTextureAssetsAdded; } }
XElement FromAssetCollection(AssetCollection assets) { return(new XElement("Assets", GetContents())); IEnumerable <XObject> GetContents() { foreach (var asset in assets) { yield return(FromAsset(asset)); } } }
/// <summary> /// /// </summary> public ContentBuilder( string contentProject, string targetDirectory, DevConForm devcon, Game game ) { Modified = false; this.developerConsole = devcon; this.game = game; this.contentProject = Path.GetFullPath( contentProject ); this.sourceDirectory = Path.GetFullPath( Path.GetDirectoryName( contentProject ) ); this.targetDirectory = targetDirectory; assets = new AssetCollection(); }
private static void ValidateCollection(AssetCollection collection) { Version[] versions = collection.Files.Select(t => t.Version).Distinct().ToArray(); if (versions.Count() > 1) { Logger.Instance.Log(LogType.Warning, LogCategory.Import, $"Asset collection has (possibly) incompatible with each assets file versions. Here they are:"); foreach (Version version in versions) { Logger.Instance.Log(LogType.Warning, LogCategory.Import, version.ToString()); } } }
public void LoadGraph() { List <PropertyCollector.TextureInfo> lti; var assetCollection = new AssetCollection(); ShaderGraphImporter.GetShaderText(kGraphName, out lti, assetCollection, out m_Graph); Assert.NotNull(m_Graph, $"Invalid graph data found for {kGraphName}"); m_Graph.ValidateGraph(); m_Collector = new KeywordCollector(); m_Graph.CollectShaderKeywords(m_Collector, GenerationMode.ForReals); }
public void Should_Set_Content() { var assets = new AssetCollection() { new AssetBaseImpl("function(){}"), new AssetBaseImpl("function(){}") }; var asset = new MergedAsset(assets, ";"); Assert.AreEqual("function(){};function(){};", asset.OpenStream().ReadToEnd()); }
public PhysicsWorldBuilder(ILogger logger) { this.logger = logger; this.assetCollection = new(); this.actions = new(); this.imgs = new(); this.dffMeshes = new(); this.colMeshes = new(); this.namedColCombos = new(); this.loadMode = PhysicsModelLoadMode.Col; }
private static void LoadDependency(AssetCollection collection, IReadOnlyCollection <string> directories, string fileName) { foreach (string loadName in FetchNameVariants(fileName)) { bool found = TryLoadDependency(collection, directories, fileName, loadName); if (found) { return; } } Logger.Instance.Log(LogType.Warning, LogCategory.Import, $"Dependency '{fileName}' wasn't found"); }
/// <summary> /// Base constructor. /// </summary> /// <param name="identity"></param> /// <param name="guid"></param> private CCPCharacter(CharacterIdentity identity, Guid guid) : base(identity, guid) { QueryMonitors = new QueryMonitorCollection(); SkillQueue = new SkillQueue(this); Standings = new StandingCollection(this); Assets = new AssetCollection(this); WalletJournal = new WalletJournalCollection(this); WalletTransactions = new WalletTransactionsCollection(this); CharacterMarketOrders = new MarketOrderCollection(this); CorporationMarketOrders = new MarketOrderCollection(this); CharacterContracts = new ContractCollection(this); CorporationContracts = new ContractCollection(this); CharacterIndustryJobs = new IndustryJobCollection(this); CorporationIndustryJobs = new IndustryJobCollection(this); ResearchPoints = new ResearchPointCollection(this); EVEMailMessages = new EveMailMessageCollection(this); EVEMailingLists = new EveMailingListCollection(this); EVENotifications = new EveNotificationCollection(this); Contacts = new ContactCollection(this); CharacterMedals = new MedalCollection(this); CorporationMedals = new MedalCollection(this); UpcomingCalendarEvents = new UpcomingCalendarEventCollection(this); KillLog = new KillLogCollection(this); PlanetaryColonies = new PlanetaryColonyCollection(this); LoyaltyPoints = new LoyaltyCollection(this); m_endedOrdersForCharacter = new List <MarketOrder>(); m_endedOrdersForCorporation = new List <MarketOrder>(); m_endedContractsForCharacter = new List <Contract>(); m_endedContractsForCorporation = new List <Contract>(); m_jobsCompletedForCharacter = new List <IndustryJob>(); m_allianceName = EveIDToName.GetIDToName(AllianceID); m_corporationName = EveIDToName.GetIDToName(CorporationID); EveMonClient.CharacterAssetsUpdated += EveMonClient_CharacterAssetsUpdated; EveMonClient.CharacterMarketOrdersUpdated += EveMonClient_CharacterMarketOrdersUpdated; EveMonClient.CorporationMarketOrdersUpdated += EveMonClient_CorporationMarketOrdersUpdated; EveMonClient.CharacterContractsUpdated += EveMonClient_CharacterContractsUpdated; EveMonClient.CorporationContractsUpdated += EveMonClient_CorporationContractsUpdated; EveMonClient.CharacterIndustryJobsUpdated += EveMonClient_CharacterIndustryJobsUpdated; EveMonClient.CorporationIndustryJobsUpdated += EveMonClient_CorporationIndustryJobsUpdated; EveMonClient.CharacterIndustryJobsCompleted += EveMonClient_CharacterIndustryJobsCompleted; EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted; EveMonClient.CharacterPlaneteryPinsCompleted += EveMonClient_CharacterPlaneteryPinsCompleted; EveMonClient.ESIKeyInfoUpdated += EveMonClient_ESIKeyInfoUpdated; EveMonClient.EveIDToNameUpdated += EveMonClient_EveIDToNameUpdated; EveMonClient.TimerTick += EveMonClient_TimerTick; }
public static void Main(string[] args) { Logger.Instance = ConsoleLogger.Instance; Config.IsAdvancedLog = true; Config.IsGenerateGUIDByContent = false; Config.IsExportDependencies = false; if (args.Length == 0) { Console.WriteLine("No arguments"); Console.ReadKey(); return; } foreach (string arg in args) { if (!FileMultiStream.Exists(arg)) { Console.WriteLine(FileMultiStream.IsMultiFile(arg) ? $"File {arg} doen't has all parts for combining" : $"File {arg} doesn't exist", arg); Console.ReadKey(); return; } } try { AssetCollection collection = new AssetCollection(); collection.Exporter.OverrideExporter(ClassIDType.AudioClip, new AudioAssetExporter()); LoadFiles(collection, args); LoadDependencies(collection, args); ValidateCollection(collection); string name = Path.GetFileNameWithoutExtension(args.First()); string exportPath = ".\\Ripped\\" + name; if (Directory.Exists(exportPath)) { Directory.Delete(exportPath, true); } collection.Exporter.Export(exportPath, FetchExportObjects(collection)); Logger.Instance.Log(LogType.Info, LogCategory.General, "Finished"); } catch (Exception ex) { Logger.Instance.Log(LogType.Error, LogCategory.General, ex.ToString()); } Console.ReadKey(); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); // Set the appropriate toolbarItems based on the mediaType of the asset. if (Asset.MediaType == PHAssetMediaType.Video) { #if __IOS__ && !__TVOS__ ToolbarItems = new UIBarButtonItem [] { FavoriteButton, Space, PlayButton, Space, TrashButton }; if (NavigationController != null) { NavigationController.ToolbarHidden = false; } #elif __TVOS__ NavigationItem.LeftBarButtonItems = new UIBarButtonItem [] { PlayButton, FavoriteButton, TrashButton }; #endif } else { // Live Photos have their own playback UI, so present them like regular photos, just like Photos app #if __IOS__ && !__TVOS__ ToolbarItems = new UIBarButtonItem [] { FavoriteButton, Space, TrashButton }; if (NavigationController != null) { NavigationController.ToolbarHidden = false; } #elif __TVOS__ NavigationItem.LeftBarButtonItems = new UIBarButtonItem [] { FavoriteButton, TrashButton }; #endif } // Enable editing buttons if the asset can be edited. EditButton.Enabled = Asset.CanPerformEditOperation(PHAssetEditOperation.Content); FavoriteButton.Enabled = Asset.CanPerformEditOperation(PHAssetEditOperation.Properties); FavoriteButton.Title = Asset.Favorite ? "♥︎" : "♡"; // Enable the trash button if the asset can be deleted. if (AssetCollection != null) { TrashButton.Enabled = AssetCollection.CanPerformEditOperation(PHCollectionEditOperation.RemoveContent); } else { TrashButton.Enabled = Asset.CanPerformEditOperation(PHAssetEditOperation.Delete); } // Make sure the view layout happens before requesting an image sized to fit the view. View.LayoutIfNeeded(); UpdateImage(); }
/// <summary> /// Saves all domains /// </summary> public void Save() { Log.Message("Saving content project..."); try { AssetCollection.Save(assets, contentProject); } catch (Exception e) { Log.Error("Failed to save content:"); Log.Error("{0}", e.Message); return; } Log.Message("Content project successfully saved."); Modified = false; }
/// <summary> /// Loads all possible domains. /// </summary> public void Load() { Log.Message("Loading content project..."); try { assets = AssetCollection.Load(contentProject); } catch (Exception e) { Log.Error("Failed to load content:"); Log.Error("{0}", e.Message); return; } Modified = false; Log.Message("Content project successfully loaded."); }
public void ValidateDefaultStorageAccountTryingToCreateAssetAsync() { var context = Helper.GetMockContextWithNullDefaultStorage(); AssetCollection collection = new AssetCollection(context); try { var task = collection.CreateAsync("NullStorage", AssetCreationOptions.StorageEncrypted, CancellationToken.None); } catch (InvalidOperationException ex) { Assert.AreEqual(StringTable.DefaultStorageAccountIsNull, ex.Message); throw; } }
public void LoadGraph() { List <PropertyCollector.TextureInfo> lti; var assetCollection = new AssetCollection(); ShaderGraphImporter.GetShaderText(kGraphName, out lti, assetCollection, out m_Graph); Assert.NotNull(m_Graph, $"Invalid graph data found for {kGraphName}"); m_Graph.ValidateGraph(); m_Collector = new PropertyCollector(); m_Graph.CollectShaderProperties(m_Collector, GenerationMode.ForReals); // Open up the window if (!ShaderGraphImporterEditor.ShowGraphEditWindow(kGraphName)) { Assert.Fail("ShaderGraphImporterEditor.ShowGraphEditWindow could not open " + kGraphName); } m_Window = EditorWindow.GetWindow <MaterialGraphEditWindow>(); if (m_Window == null) { Assert.Fail("Could not open window"); } // EditorWindow.GetWindow will return a new window if one is not found. A new window will have graphObject == null. if (m_Window.graphObject == null) { Assert.Fail("Existing Shader Graph window of " + kGraphName + " not found."); } m_GraphEditorView = m_Window.graphEditorView; // Create the blackboard test controller var blackboardViewModel = new BlackboardViewModel() { parentView = m_Window.graphEditorView.graphView, model = m_Window.graphObject.graph, title = m_Window.assetName }; m_BlackboardTestController = new BlackboardTestController(m_Window, m_Graph, blackboardViewModel, m_Window.graphObject.graphDataStore); // Remove the normal blackboard m_GraphEditorView.blackboardController.blackboard.RemoveFromHierarchy(); // And override reference to the blackboard controller to point at the test controller m_GraphEditorView.blackboardController = m_BlackboardTestController; }
public void Should_Return_New_Stream_And_Full_Content() { var assets = new AssetCollection() { new AssetBaseImpl("function(){}"), new AssetBaseImpl("function(){}") }; var asset = new MergedAsset(assets, ";"); //will throw exception if we do not return new stream var content = asset.OpenStream().ReadToEnd(); var content2 = asset.OpenStream().ReadToEnd(); Assert.AreEqual(content2, content); }
/// <summary> /// 获得数据列表 /// </summary> /// <returns></returns> public static List<AssetInfo> GetList() { string cacheKey = GetCacheKey(); //本实体已经注册成缓存实体,并且缓存存在的时候,直接从缓存取 if (CachedEntityCommander.IsTypeRegistered(typeof(AssetInfo)) && CachedEntityCommander.GetCache(cacheKey) != null) { return CachedEntityCommander.GetCache(cacheKey) as List< AssetInfo>; } else { List< AssetInfo> list =new List< AssetInfo>(); AssetCollection collection=new AssetCollection(); Query qry = new Query(Asset.Schema); collection.LoadAndCloseReader(qry.ExecuteReader()); foreach(Asset asset in collection) { AssetInfo assetInfo= new AssetInfo(); LoadFromDAL(assetInfo,asset); list.Add(assetInfo); } //生成缓存 if (CachedEntityCommander.IsTypeRegistered(typeof(AssetInfo))) { CachedEntityCommander.SetCache(cacheKey, list); } return list; } }
public AS3Project(string path) : base(path, new MxmlcOptions()) { movieOptions = new AS3MovieOptions(); SwcLibraries = new AssetCollection(this); }
/// <summary> /// Base constructor. /// </summary> /// <param name="identity"></param> /// <param name="guid"></param> private CCPCharacter(CharacterIdentity identity, Guid guid) : base(identity, guid) { QueryMonitors = new QueryMonitorCollection(); SkillQueue = new SkillQueue(this); Standings = new StandingCollection(this); Assets = new AssetCollection(this); WalletJournal = new WalletJournalCollection(this); WalletTransactions = new WalletTransactionsCollection(this); CharacterMarketOrders = new MarketOrderCollection(this); CorporationMarketOrders = new MarketOrderCollection(this); CharacterContracts = new ContractCollection(this); CorporationContracts = new ContractCollection(this); CharacterContractBids = new ContractBidCollection(this); CorporationContractBids = new ContractBidCollection(this); CharacterIndustryJobs = new IndustryJobCollection(this); CorporationIndustryJobs = new IndustryJobCollection(this); ResearchPoints = new ResearchPointCollection(this); EVEMailMessages = new EveMailMessageCollection(this); EVEMailingLists = new EveMailingListCollection(this); EVENotifications = new EveNotificationCollection(this); Contacts = new ContactCollection(this); CharacterMedals = new MedalCollection(this); CorporationMedals = new MedalCollection(this); UpcomingCalendarEvents = new UpcomingCalendarEventCollection(this); KillLog = new KillLogCollection(this); PlanetaryColonies = new PlanetaryColonyCollection(this); m_endedOrdersForCharacter = new List<MarketOrder>(); m_endedOrdersForCorporation = new List<MarketOrder>(); m_endedContractsForCharacter = new List<Contract>(); m_endedContractsForCorporation = new List<Contract>(); m_jobsCompletedForCharacter = new List<IndustryJob>(); EveMonClient.CharacterAssetsUpdated += EveMonClient_CharacterAssetsUpdated; EveMonClient.CharacterMarketOrdersUpdated += EveMonClient_CharacterMarketOrdersUpdated; EveMonClient.CorporationMarketOrdersUpdated += EveMonClient_CorporationMarketOrdersUpdated; EveMonClient.CharacterContractsUpdated += EveMonClient_CharacterContractsUpdated; EveMonClient.CorporationContractsUpdated += EveMonClient_CorporationContractsUpdated; EveMonClient.CharacterIndustryJobsUpdated += EveMonClient_CharacterIndustryJobsUpdated; EveMonClient.CorporationIndustryJobsUpdated += EveMonClient_CorporationIndustryJobsUpdated; EveMonClient.CharacterIndustryJobsCompleted += EveMonClient_CharacterIndustryJobsCompleted; EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted; EveMonClient.CharacterPlaneteryPinsCompleted += EveMonClient_CharacterPlaneteryPinsCompleted; EveMonClient.APIKeyInfoUpdated += EveMonClient_APIKeyInfoUpdated; EveMonClient.TimerTick += EveMonClient_TimerTick; }
/// <summary> /// Loads all possible domains. /// </summary> public void Load() { Log.Message("Loading content project..."); try { assets = AssetCollection.Load( contentProject ); } catch ( Exception e ) { Log.Error("Failed to load content:"); Log.Error("{0}", e.Message); return; } Modified = false; Log.Message("Content project successfully loaded."); }
public void ValidateDefaultStorageAccountTryingToCreateAssetAsync() { var context = Helper.GetMockContextWithNullDefaultStorage(); AssetCollection collection = new AssetCollection(context); try { var task = collection.CreateAsync("NullStorage", AssetCreationOptions.StorageEncrypted,CancellationToken.None); } catch (InvalidOperationException ex) { Assert.AreEqual(StringTable.DefaultStorageAccountIsNull, ex.Message); throw; } }
/// <summary> /// 获得分页列表,无论是否是缓存实体都从数据库直接拿取数据 /// </summary> /// <param name="pPageIndex">页数</param> /// <param name="pPageSize">每页列表</param> /// <param name="pOrderBy">排序</param> /// <param name="pSortExpression">排序字段</param> /// <param name="pRecordCount">列表行数</param> /// <returns>数据分页</returns> public static List<AssetInfo> GetPagedList(int pPageIndex,int pPageSize,SortDirection pOrderBy,string pSortExpression,out int pRecordCount) { if(pPageIndex<=1) pPageIndex=1; List< AssetInfo> list = new List< AssetInfo>(); Query q = Asset .CreateQuery(); q.PageIndex = pPageIndex; q.PageSize = pPageSize; q.ORDER_BY(pSortExpression,pOrderBy.ToString()); AssetCollection collection=new AssetCollection(); collection.LoadAndCloseReader(q.ExecuteReader()); foreach (Asset asset in collection) { AssetInfo assetInfo = new AssetInfo(); LoadFromDAL(assetInfo, asset); list.Add(assetInfo); } pRecordCount=q.GetRecordCount(); return list; }
/// <summary> /// 批量装载 /// </summary> internal static void LoadFromDALPatch(List< AssetInfo> pList, AssetCollection pCollection) { foreach (Asset asset in pCollection) { AssetInfo assetInfo = new AssetInfo(); LoadFromDAL(assetInfo, asset ); pList.Add(assetInfo); } }