public override void OnInspectorGUI() { DrawDefaultInspector(); PlatformData script = (PlatformData)target; GUILayout.Space(5); GUILayout.Space(5); EditorGUILayout.LabelField("Set current platform", EditorStyles.boldLabel); GUIStyle selectedButtonStyle = new GUIStyle(GUI.skin.button); selectedButtonStyle.normal.textColor = Color.grey; PlatformData.Platform[] platforms = (PlatformData.Platform[])Enum.GetValues(typeof(PlatformData.Platform)); foreach (var platform in platforms) { if (platform == script.platform) { GUILayout.Button(platform.ToString(), selectedButtonStyle); } else if (GUILayout.Button(platform.ToString())) { SetPlatform(script, platform); } } }
public IAsset Load(string name, IRawAsset data) { if (data.IsCompiled) { return(new FontAsset(this.m_AssetContentManager, name, null, 0, false, 0, data.GetProperty <PlatformData>("PlatformData"))); } PlatformData platformData = null; if (data.GetProperty <PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty <PlatformData>("PlatformData").Platform, Data = ByteReader.ReadAsByteArray(data.GetProperty <PlatformData>("PlatformData").Data) }; } var effect = new FontAsset( this.m_AssetContentManager, name, data.GetProperty <string>("FontName"), data.GetProperty <int>("FontSize"), data.GetProperty <bool>("UseKerning"), data.GetProperty <int>("Spacing"), platformData); return(effect); }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return(new EffectAsset(this.m_AssetContentManager, name, null, data.GetProperty <PlatformData>("PlatformData"), false)); } PlatformData platformData = null; if (data.GetProperty <PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty <PlatformData>("PlatformData").Platform, Data = data.GetProperty <PlatformData>("PlatformData").Data }; } var effect = new EffectAsset( this.m_AssetContentManager, name, data.GetProperty <string>("Code"), platformData, data.GetProperty <bool>("SourcedFromRaw")); return(effect); }
void SetPlatform(PlatformData data, PlatformData.Platform platform) { if (EditorUtility.DisplayDialog("Confirmation", "Switch target platform to " + platform.ToString() + "?", "Yes", "Cancel")) { data.SetPlatform(platform); } }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return(new TextureAsset(this.m_AssetContentManager, name, null, data.GetProperty <PlatformData>("PlatformData"), false)); } PlatformData platformData = null; if (data.GetProperty <PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty <PlatformData>("PlatformData").Platform, Data = data.GetProperty <PlatformData>("PlatformData").Data }; } var texture = new TextureAsset( this.m_AssetContentManager, name, ByteReader.ReadAsByteArray(data.GetProperty <object>("RawData")), platformData, data.GetProperty <bool>("SourcedFromRaw")); return(texture); }
public static PlatformData CreatePlatform( string dockerfile, string digest = null, string architecture = "amd64", string osType = "Linux", string osVersion = "focal", List <string> simpleTags = null, string baseImageDigest = null, DateTime?created = null) { PlatformData platform = new PlatformData { Dockerfile = dockerfile, Digest = digest, Architecture = architecture, OsType = osType, OsVersion = osVersion, SimpleTags = simpleTags, BaseImageDigest = baseImageDigest, }; if (created.HasValue) { platform.Created = created.Value; } return(platform); }
private unsafe static void ApiThread <T>(string name, CommonWindow window) where T : App, new() { var app = new T(); app.window = window; app.name = name; app.queue = window.queue; PlatformData platform = default; Init ini = default; init_ctor(&ini); ini.vendorId = 0; ini.resolution.width = 1280; ini.resolution.height = 720; platform.nwh = window.nwh; ini.platformData = platform; ini.type = Bgfx.bgfx.RendererType.Direct3D11; ini.resolution.reset = (uint)Bgfx.bgfx.ResetFlags.Vsync; app.Initialize(&ini); app._previousGameTime = DateTime.UtcNow; bool exit = false; while (!exit) { exit = app.OnUpdate(); } window.exit = exit; }
//////////////////////////////////////////////////////////////// public void AddPlatform(PlatformData platformData) { AssetDataPlayer assetDataPlayer = AssetManager.GetAssetData <AssetDataPlayer>(); GameObject gameObject = new GameObject("~ Platform"); gameObject.layer = (int)GameLayer.Platform; gameObject.transform.parent = m_PlatformCoreObject.transform; (Mesh mesh, Vector2[] collisionVerts) = platformData.Create(); MeshFilter filter = gameObject.AddComponent <MeshFilter>(); filter.sharedMesh = mesh; MeshRenderer renderer = gameObject.AddComponent <MeshRenderer>(); renderer.sharedMaterial = assetDataPlayer.PlatformMaterial; PolygonCollider2D collider = gameObject.AddComponent <PolygonCollider2D>(); collider.points = collisionVerts; m_Platforms.Add(new Platform { _Data = platformData, _GameObject = gameObject }); }
private void RemoveUnchangedPlatforms(ImageArtifactDetails imageArtifactDetails) { for (int repoIndex = imageArtifactDetails.Repos.Count - 1; repoIndex >= 0; repoIndex--) { RepoData repo = imageArtifactDetails.Repos[repoIndex]; for (int imageIndex = repo.Images.Count - 1; imageIndex >= 0; imageIndex--) { ImageData image = repo.Images[imageIndex]; for (int i = image.Platforms.Count - 1; i >= 0; i--) { PlatformData platform = image.Platforms[i]; if (platform.IsUnchanged) { // Exclude the ProductVersion from the identifier because it requires the ImageInfo to be set on the platform. // But it's not set because we haven't used ImageInfoHelper to load it, we've just deserialized it directly. // Using ImageInfoHelper requires having the manifest but that seems unnecessary since it's not needed for the logic // of this command other than this simple logging statement. _loggerService.WriteMessage($"Removing unchanged platform '{platform.GetIdentifier(excludeProductVersion: true)}'"); image.Platforms.Remove(platform); } } if (!image.Platforms.Any()) { repo.Images.Remove(image); } } if (!repo.Images.Any()) { imageArtifactDetails.Repos.Remove(repo); } } }
private void RemovePlatformBase(PlatformData platform) { List <ListViewItem> toremove = new List <ListViewItem>(); foreach (ListViewItem songitem in SongList.Items) { SongListItem songtag = songitem.Tag as SongListItem; List <FormatData> ftoremove = new List <FormatData>(); foreach (FormatData data in songtag.Data) { if (data.PlatformData == platform) { ftoremove.Add(data); } } if (ftoremove.Count > 0) { toremove.Add(songitem); } foreach (FormatData data in ftoremove) { songtag.RemoveData(data); } } foreach (ListViewItem item in toremove) { SongList.Items.Remove(item); } }
private void OpenSdCard(string path) { SdPath = path; if (SD != null) { SD.Dispose(); } GetAsyncProgress().QueueTask(progress => { progress.NewTask("Loading SD content"); /* wtf is this doing here? * if (SD != null) { * SongUpdateMutex.WaitOne(); * Platforms.Add(SD); * SongUpdateMutex.ReleaseMutex(); * } */ SD = PlatformRB2WiiCustomDLC.Instance.Create(SdPath, Game.Unknown, progress); progress.Progress(); if (RiiFS != null) { RiiFS.Stop(); } StartRiiFS(); RefreshRiiFS(); UpdateSongList(); progress.EndTask(); }); }
/// <summary> /// Create a compatibility diagnostic for an incompatible parameter. /// </summary> /// <param name="parameterName">The name of the incompatible parameter.</param> /// <param name="commandName">The name of the command where the parameter is incompatible.</param> /// <param name="platform">The platform where the parameter is incompatible.</param> /// <param name="extent">The AST extent of the incompatible invocation.</param> /// <param name="analyzedFileName">The path of the script where the incompatibility has been found.</param> /// <param name="rule">The rule that found the incompatibility.</param> /// <param name="suggestedCorrections">Any suggested corrections, may be null.</param> /// <returns></returns> public static CommandCompatibilityDiagnostic CreateForParameter( string parameterName, string commandName, PlatformData platform, IScriptExtent extent, string analyzedFileName, IRule rule, IEnumerable <CorrectionExtent> suggestedCorrections = null) { string message = string.Format( CultureInfo.CurrentCulture, Strings.UseCompatibleCommandsParameterError, parameterName, commandName, platform.PowerShell.Version, platform.OperatingSystem.FriendlyName); return(new CommandCompatibilityDiagnostic( commandName, platform, message, extent, rule.GetName(), ruleId: null, analyzedFileName: analyzedFileName, parameterName: parameterName)); }
private void Awake() { _platformData = DataPipe.instance.PlatformData; if (_ren == null) { _ren = GetComponent <MeshRenderer>(); } if (_col == null) { _col = GetComponent <Collider>(); } if (_meshFilter == null) { _meshFilter = GetComponent <MeshFilter>(); } if (!Activated) { _ren.material = _platformData.HighlightMat; } _resourcesInRange = new List <ResourceObject>(); if (_walls == null) { _walls = GetComponentsInChildren <WallScript>(); } _activeWalls = new List <WallScript>(); _rnd = new System.Random(); }
//If the last platform end forward spawn a platform that start or end right. private void ForwardPlatform() { if (_previousPlatform.startDirection != StartDirection.Left) { _newPlatform = Instantiate(leftPlatforms[_randomizePlatform], _previousPlatform.connectionPoint.transform.position, _previousPlatform.connectionPoint.transform.rotation); previousStage[_platformIndex] = currentStage[_platformIndex]; currentStage[_platformIndex] = _newPlatform; lastPlatform = _newPlatform; } else if (_previousPlatform.startDirection != StartDirection.Right) { _newPlatform = Instantiate(rightPlatforms[_randomizePlatform], _previousPlatform.connectionPoint.transform.position, _previousPlatform.connectionPoint.transform.rotation); previousStage[_platformIndex] = currentStage[_platformIndex]; currentStage[_platformIndex] = _newPlatform; lastPlatform = _newPlatform; } PlatformData newPlatformData = _newPlatform.GetComponent <PlatformData>(); ObstacleGeneration(newPlatformData); }
private static void QueueExportFoF(string path, FormatData data) { Program.Form.Progress.QueueTask(progress => { progress.NewTask("Installing \"" + data.Song.Name + "\" to Frets on Fire", 1); FormatData source = data; Program.Form.TaskMutex.WaitOne(); bool local = data.PlatformData.Platform == PlatformLocalStorage.Instance; bool ownformat = false; if (!local && Configuration.MaxConcurrentTasks > 1) { source = new TemporaryFormatData(data.Song, data.PlatformData); data.SaveTo(source); ownformat = true; } Program.Form.TaskMutex.ReleaseMutex(); PlatformData platformdata = new PlatformData(PlatformFretsOnFire.Instance, Game.Unknown); platformdata.Session["path"] = path; PlatformFretsOnFire.Instance.SaveSong(platformdata, data, progress); progress.Progress(); if (ownformat) { source.Dispose(); } progress.EndTask(); }); }
private static void GetRiseSectionData(RiseSectionData riseSectionData, XDocument document) { XElement riseSectionElement = document.Element("risesection"); double height = riseSectionElement.GetDouble("height"); int difficulty = riseSectionElement.GetInt("difficulty"); XElement platformsElement = riseSectionElement.Element("platforms"); IEnumerable <XElement> platformElements = platformsElement.Elements("platform"); List <PlatformData> platforms = new List <PlatformData>(); foreach (XElement platformElement in platformElements) { PlatformData platform = GetPlatformData(platformElement); platforms.Add(platform); } XElement enemiesElement = riseSectionElement.Element("enemies"); string enemiesXml = enemiesElement != null?enemiesElement.ToString() : ""; XElement itemsElement = riseSectionElement.Element("items"); string itemsXml = itemsElement != null?itemsElement.ToString() : ""; riseSectionData.Height = height; riseSectionData.Difficulty = difficulty; riseSectionData.Platforms = platforms; riseSectionData.EnemiesXml = enemiesXml; riseSectionData.ItemsXml = itemsXml; }
public virtual PlatformData LoadObjData() { string path = Application.persistentDataPath + "/" + uniqueId; if (!Toolbox.Instance.allIds.Contains(this)) { Toolbox.Instance.allIds.Add(this); } if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); PlatformData data = formatter.Deserialize(stream) as PlatformData; stream.Close(); return(data); } else { Debug.LogError("Platform file not found in " + path); return(null); } }
public void SetPlatform(PlatformData platformData) { SetPlatformBaseColor(platformData.platformColor); SetPool(platformData); CreateBooster(platformData.boosterPrefab); CreateObjectsToCollect(platformData.objectsToCollectPrefab); }
public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return new UberEffectAsset(_kernel, _assetContentManager, _rawLaunchArguments, name, null, data.GetProperty<PlatformData>("PlatformData"), false); } PlatformData platformData = null; if (data.GetProperty<PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty<PlatformData>("PlatformData").Platform, Data = data.GetProperty<PlatformData>("PlatformData").Data }; } var effect = new UberEffectAsset( _kernel, _assetContentManager, _rawLaunchArguments, name, data.GetProperty<string>("Code"), platformData, data.GetProperty<bool>("SourcedFromRaw")); return effect; }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return(new ModelAsset(_modelSerializer, name, null, null, data.GetProperty <PlatformData>("PlatformData"), false, string.Empty, null)); } PlatformData platformData = null; if (data.GetProperty <PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty <PlatformData>("PlatformData").Platform, Data = data.GetProperty <PlatformData>("PlatformData").Data }; } var model = new ModelAsset( _modelSerializer, name, ByteReader.ReadAsByteArray(data.GetProperty <object>("RawData")), data.GetProperty <System.Collections.Generic.Dictionary <string, byte[]> >("RawAdditionalAnimations"), platformData, data.GetProperty <bool>("SourcedFromRaw"), data.GetProperty <string>("Extension"), data.GetProperty <string[]>("ImportOptions")); return(model); }
// Use this for initialization void Start() { _img = GetComponent <Image>(); _builder = DataPipe.instance.BuildingInteraction; ActionGroup.transform.DOScale(0, 0); Action_1.Trigger = () => { Action_2.ResetVisualFuntionality(); _currentSelectedAction = Action_1; SelectAction(); }; Action_2.Trigger = () => { Action_1.ResetVisualFuntionality(); _currentSelectedAction = Action_2; SelectAction(); }; _resourceMan = DataPipe.instance.ResourceManager; _platformData = DataPipe.instance.PlatformData; BA_InputReceiverUI.Instance.ActionKey += BuildMenu; BA_InputReceiverUI.Instance.ActionKey2 += ReceiveBuildCommand; BA_InputReceiverUI.Instance.ActionDirectional += ReceiveDirectionalInput; InputMapper.MoveInputVector3 += ReceivePlatformCommand; _builder.RessourceCheck = () => RessourceCheck(); _arrowHandler = FindObjectOfType <DirectionalArrowHandler>(); }
public IAsset Load(string name, IRawAsset data) { if (data.IsCompiled) { return(new AudioAsset(name, null, data.GetProperty <PlatformData>("PlatformData"), false)); } PlatformData platformData = null; if (data.GetProperty <PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty <PlatformData>("PlatformData").Platform, Data = data.GetProperty <PlatformData>("PlatformData").Data }; } var audio = new AudioAsset( name, ByteReader.ReadAsByteArray(data.GetProperty <object>("RawData")), platformData, data.GetProperty <bool>("SourcedFromRaw")); return(audio); }
//[MenuItem("GAME/CreateScriptObj")] static public void CreateScriptObject() { string p = "Assets/Editor/JSJ/PlatformData.asset"; PlatformData sd = ScriptableObject.CreateInstance <PlatformData>(); AssetDatabase.CreateAsset(sd, p); }
static void BuildClassPath(HaXeContext.Context context) { var platformsFile = Path.Combine("Settings", "Platforms"); PlatformData.Load(Path.Combine(PathHelper.AppDir, platformsFile)); PluginBase.CurrentProject = new HaxeProject("haxe") { CurrentSDK = Environment.GetEnvironmentVariable("HAXEPATH") }; context.BuildClassPath(); foreach (var it in context.Classpath) { var path = it.Path; foreach (var searchPattern in context.GetExplorerMask()) { foreach (var fileName in Directory.GetFiles(path, searchPattern, SearchOption.AllDirectories)) { it.AddFile(ASFileParser.ParseFile(new FileModel(fileName) { Context = context, haXe = true, Version = 4 })); } } context.RefreshContextCache(path); } }
private static XElement GetPlatformDataXml(PlatformData platformData) { XElement platformElement = new XElement("platform"); if (platformData.Id >= 0) { platformElement.Add(new XAttribute("id", platformData.Id)); } platformElement.Add(new XAttribute("x", platformData.X)); platformElement.Add(new XAttribute("y", platformData.Y)); platformElement.Add(new XAttribute("type", platformData.Type)); if (platformData.MovementData != null) { XElement movementElement = GetPlatformMovementDataXml(platformData.MovementData); platformElement.Add(movementElement); } if (platformData.FeaturesData != null) { XElement featuresElement = GetPlatformFeaturesDataXml(platformData.FeaturesData); platformElement.Add(featuresElement); } return(platformElement); }
private void ValidatePlatformData(string platformId, PlatformData platformData) { if (string.IsNullOrEmpty(platformId)) { _errAcc.AddError("Platform ID is null or empty"); } if (platformData.PowerShell.Version == null) { _errAcc.AddError("PowerShell version is null"); } else if (platformData.PowerShell.Version.Major >= 5 && string.IsNullOrEmpty(platformData.PowerShell.Edition)) { _errAcc.AddError("PowerShell edition is null or empty on version 5.1 or above"); } if (platformData.Dotnet.ClrVersion == null) { _errAcc.AddError(".NET CLR version is null"); } if (string.IsNullOrEmpty(platformData.OperatingSystem.Name)) { _errAcc.AddError("OS name is null or empty"); } if (string.IsNullOrEmpty(platformData.OperatingSystem.Version)) { _errAcc.AddError("OS version is null or empty"); } }
private IEnumerable <(string SourceTag, string DestinationTag)> GetTagInfos(RepoInfo repo, PlatformInfo platform) { List <(string SourceTag, string DestinationTag)> tags = new List <(string SourceTag, string DestinationTag)>(); // If an image info file was provided, use the tags defined there rather than the manifest. This is intended // to handle scenarios where the tag's value is dynamic, such as a timestamp, and we need to know the value // of the tag for the image that was actually built rather than just generating new tag values when parsing // the manifest. if (_imageArtifactDetails.Value != null) { RepoData repoData = _imageArtifactDetails.Value.Repos.FirstOrDefault(repoData => repoData.Repo == repo.Name); if (repoData != null) { PlatformData platformData = repoData.Images .SelectMany(image => image.Platforms) .FirstOrDefault(platformData => platformData.PlatformInfo == platform); if (platformData != null) { foreach (string tag in platformData.SimpleTags) { string destinationTag = TagInfo.GetFullyQualifiedName(repo.QualifiedName, tag); string sourceTag = GetSourceTag(destinationTag); tags.Add((sourceTag, destinationTag)); TagInfo tagInfo = platformData.PlatformInfo.Tags.FirstOrDefault(tagInfo => tagInfo.Name == tag); // There may not be a matching tag due to dynamic tag names. For now, we'll say that // syndication is not supported for dynamically named tags. // See https://github.com/dotnet/docker-tools/issues/686 if (tagInfo?.SyndicatedRepo != null) { foreach (string syndicatedDestinationTagName in tagInfo.SyndicatedDestinationTags) { destinationTag = TagInfo.GetFullyQualifiedName( $"{Manifest.Registry}/{Options.RepoPrefix}{tagInfo.SyndicatedRepo}", syndicatedDestinationTagName); tags.Add((sourceTag, destinationTag)); } } } } else { LoggerService.WriteMessage($"Unable to find image info data for path '{platform.DockerfilePath}'."); } } else { LoggerService.WriteMessage($"Unable to find image info data for repo '{repo.Name}'."); } } else { tags.AddRange(platform.Tags .Select(tag => (GetSourceTag(tag.FullyQualifiedName), tag.FullyQualifiedName))); } return(tags); }
static public PlatformData c(string apkName, params PerPlatform[] list) { PlatformData d = new PlatformData(); d.APK名称 = apkName; d.平台列表 = list; return(d); }
private bool IsFullyQualifiedDigest(PlatformData srcPlatformData) { bool isFullyQualifiedSourceDigest = !srcPlatformData.Digest.StartsWith("sha256:"); _loggerService.WriteMessage(); _loggerService.WriteMessage($"Is source digest '{srcPlatformData.Digest}' fully qualified: {isFullyQualifiedSourceDigest}"); return(isFullyQualifiedSourceDigest); }
/// <summary> /// add a platform configuration to the List /// </summary> /// <param name="platformData"></param> public void addPlatformConfiguration(PlatformData platformData) { //if(!platformDatas.Contains(platformData)) platformDatas.Add(platformData); if (!PlatformDataList.platformDatas.Contains(platformData)) { PlatformDataList.platformDatas.Add(platformData); } }
/// <summary> /// /// </summary> /// <param name="toDelete"></param> public void DeleteSelectedPlatformDataByData(PlatformData toDelete) { PlatformData dataTodelete; dataTodelete = PlatformDataList.platformDatas.Find(data => data.configurationName == toDelete.configurationName); PlatformDataList.platformDatas.Remove(dataTodelete); Debug.Log("Delete data Success"); }
/// <summary> /// The read. /// </summary> /// <param name="platformData"> /// The platform data. /// </param> /// <param name="protoReader"> /// The proto reader. /// </param> /// <returns> /// The <see cref="PlatformData"/>. /// </returns> private static PlatformData Read(PlatformData platformData, ProtoReader protoReader) { int num; while ((num = protoReader.ReadFieldHeader()) > 0) { if (num != 1) { if (num != 2) { if (platformData == null) { var expr_164 = new PlatformData(); ProtoReader.NoteObject(expr_164, protoReader); platformData = expr_164; } protoReader.SkipField(); } else { if (platformData == null) { var expr_134 = new PlatformData(); ProtoReader.NoteObject(expr_134, protoReader); platformData = expr_134; } byte[] array = ProtoReader.AppendBytes(platformData.Data, protoReader); if (array != null) { platformData.Data = array; } } } else { if (platformData == null) { var expr_19 = new PlatformData(); ProtoReader.NoteObject(expr_19, protoReader); platformData = expr_19; } int num2 = protoReader.ReadInt32(); var targetPlatform = TargetPlatform.Windows; if (num2 != 0) { if (num2 != 1) { if (num2 != 2) { if (num2 != 3) { if (num2 != 4) { if (num2 != 5) { if (num2 != 6) { if (num2 != 7) { if (num2 != 8) { if (num2 != 9) { if (num2 != 10) { if (num2 != 11) { if (num2 != 12) { protoReader.ThrowEnumException( typeof(TargetPlatform), num2); } else { targetPlatform = TargetPlatform.RaspberryPi; } } else { targetPlatform = TargetPlatform.WindowsPhone8; } } else { targetPlatform = TargetPlatform.PlayStationMobile; } } else { targetPlatform = TargetPlatform.Ouya; } } else { targetPlatform = TargetPlatform.NativeClient; } } else { targetPlatform = TargetPlatform.WindowsStoreApp; } } else { targetPlatform = TargetPlatform.MacOSX; } } else { targetPlatform = TargetPlatform.Linux; } } else { targetPlatform = TargetPlatform.Android; } } else { targetPlatform = TargetPlatform.iOS; } } else { targetPlatform = TargetPlatform.WindowsPhone; } } else { targetPlatform = TargetPlatform.Xbox360; } } else { targetPlatform = TargetPlatform.Windows; } platformData.Platform = targetPlatform; } } if (platformData == null) { var expr_18C = new PlatformData(); ProtoReader.NoteObject(expr_18C, protoReader); platformData = expr_18C; } return platformData; }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data.IsCompiled) { return new AudioAsset(name, null, data.GetProperty<PlatformData>("PlatformData"), false); } PlatformData platformData = null; if (data.GetProperty<PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty<PlatformData>("PlatformData").Platform, Data = data.GetProperty<PlatformData>("PlatformData").Data }; } var audio = new AudioAsset( name, ByteReader.ReadAsByteArray(data.GetProperty<object>("RawData")), platformData, data.GetProperty<bool>("SourcedFromRaw")); return audio; }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return new ModelAsset(name, null, null, data.GetProperty<PlatformData>("PlatformData"), false, string.Empty); } PlatformData platformData = null; if (data.GetProperty<PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty<PlatformData>("PlatformData").Platform, Data = data.GetProperty<PlatformData>("PlatformData").Data }; } var model = new ModelAsset( name, ByteReader.ReadAsByteArray(data.GetProperty<object>("RawData")), data.GetProperty<System.Collections.Generic.Dictionary<string, byte[]>>("RawAdditionalAnimations"), platformData, data.GetProperty<bool>("SourcedFromRaw"), data.GetProperty<string>("Extension")); return model; }
public PlatformData GeneratePlatformData(AgentData agentData) { var platformData = new PlatformData(agentData); ComponentData[] pendingComponentData = QueryHistory.Select(qh => ComponentDataRetriever.GetData(qh.Value.ToArray())) .Where(c => c != null).ToArray(); pendingComponentData.ForEach(platformData.AddComponent); return platformData; }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data is CompiledAsset) { return new TextureAsset(this.m_AssetContentManager, name, null, data.GetProperty<PlatformData>("PlatformData"), false); } PlatformData platformData = null; if (data.GetProperty<PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty<PlatformData>("PlatformData").Platform, Data = data.GetProperty<PlatformData>("PlatformData").Data }; } var texture = new TextureAsset( this.m_AssetContentManager, name, ByteReader.ReadAsByteArray(data.GetProperty<object>("RawData")), platformData, data.GetProperty<bool>("SourcedFromRaw")); return texture; }
/// <summary> /// The handle. /// </summary> /// <param name="assetManager"> /// The asset manager. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="data"> /// The data. /// </param> /// <returns> /// The <see cref="IAsset"/>. /// </returns> public IAsset Handle(IAssetManager assetManager, string name, IRawAsset data) { if (data.IsCompiled) { return new FontAsset(this.m_AssetContentManager, name, null, 0, false, 0, data.GetProperty<PlatformData>("PlatformData")); } PlatformData platformData = null; if (data.GetProperty<PlatformData>("PlatformData") != null) { platformData = new PlatformData { Platform = data.GetProperty<PlatformData>("PlatformData").Platform, Data = ByteReader.ReadAsByteArray(data.GetProperty<PlatformData>("PlatformData").Data) }; } var effect = new FontAsset( this.m_AssetContentManager, name, data.GetProperty<string>("FontName"), data.GetProperty<int>("FontSize"), data.GetProperty<bool>("UseKerning"), data.GetProperty<int>("Spacing"), platformData); return effect; }
/// <summary> /// The write. /// </summary> /// <param name="platformData"> /// The platform data. /// </param> /// <param name="writer"> /// The writer. /// </param> private static void Write(PlatformData platformData, ProtoWriter writer) { if (platformData.GetType() != typeof(PlatformData)) { ThrowUnexpectedSubtype(typeof(PlatformData), platformData.GetType()); } TargetPlatform expr_2D = platformData.Platform; if (expr_2D != TargetPlatform.Windows) { ProtoWriter.WriteFieldHeader(1, WireType.Variant, writer); TargetPlatform targetPlatform = expr_2D; if (targetPlatform != TargetPlatform.Windows) { if (targetPlatform != TargetPlatform.Xbox360) { if (targetPlatform != TargetPlatform.WindowsPhone) { if (targetPlatform != TargetPlatform.iOS) { if (targetPlatform != TargetPlatform.Android) { if (targetPlatform != TargetPlatform.Linux) { if (targetPlatform != TargetPlatform.MacOSX) { if (targetPlatform != TargetPlatform.WindowsStoreApp) { if (targetPlatform != TargetPlatform.NativeClient) { if (targetPlatform != TargetPlatform.Ouya) { if (targetPlatform != TargetPlatform.PlayStationMobile) { if (targetPlatform != TargetPlatform.WindowsPhone8) { if (targetPlatform != TargetPlatform.RaspberryPi) { ProtoWriter.ThrowEnumException( writer, targetPlatform); } else { ProtoWriter.WriteInt32(12, writer); } } else { ProtoWriter.WriteInt32(11, writer); } } else { ProtoWriter.WriteInt32(10, writer); } } else { ProtoWriter.WriteInt32(9, writer); } } else { ProtoWriter.WriteInt32(8, writer); } } else { ProtoWriter.WriteInt32(7, writer); } } else { ProtoWriter.WriteInt32(6, writer); } } else { ProtoWriter.WriteInt32(5, writer); } } else { ProtoWriter.WriteInt32(4, writer); } } else { ProtoWriter.WriteInt32(3, writer); } } else { ProtoWriter.WriteInt32(2, writer); } } else { ProtoWriter.WriteInt32(1, writer); } } else { ProtoWriter.WriteInt32(0, writer); } } byte[] expr_143 = platformData.Data; if (expr_143 != null) { ProtoWriter.WriteFieldHeader(2, WireType.String, writer); ProtoWriter.WriteBytes(expr_143, writer); } }