public override int GetHashCode() { int hashCode = 0; hashCode = (hashCode * 397) ^ Name.GetHashCode(); hashCode = (hashCode * 397) ^ TexturePath.GetHashCode(); hashCode = (hashCode * 397) ^ Tag.GetHashCode(); return(hashCode); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { var hashCode = (TextureName != null ? TextureName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TexturePath != null ? TexturePath.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Size.GetHashCode(); return(hashCode); } }
public override string GetTexturePathAt(double time) { var dotIndex = TexturePath.LastIndexOf('.'); if (dotIndex < 0) { return(TexturePath + GetFrameAt(time)); } return(TexturePath.Substring(0, dotIndex) + GetFrameAt(time) + TexturePath.Substring(dotIndex, TexturePath.Length - dotIndex)); }
public Texture2D GetTexture(string texturePath, bool common) { TexturePath tex = _textures.FirstOrDefault(x => x.path == texturePath && (common || x.langCode == TextManager.instance.currentLang.code)); if (tex == null) { Debug.LogError(string.Format("No texture for {0} path \"{1}\"", common ? "common" : "", texturePath)); return(null); } return(tex.texture); }
protected virtual void WriteHeader(TextWriter writer, ExportSettings exportSettings, OsbLayer layer) { writer.Write($"Sprite,{layer},{Origin.ToString()},\"{TexturePath.Trim()}\""); if (!moveTimeline.HasCommands && !moveXTimeline.HasCommands) { writer.Write($",{InitialPosition.X.ToString(exportSettings.NumberFormat)}"); } else { writer.Write($",0"); } if (!moveTimeline.HasCommands && !moveYTimeline.HasCommands) { writer.WriteLine($",{InitialPosition.Y.ToString(exportSettings.NumberFormat)}"); } else { writer.WriteLine($",0"); } }
public override TreeProfileContent Process(XmlDocument input, ContentProcessorContext context) { // Build a tree generator just to validate the XML format try { TreeGenerator.CreateFromXml(input); } catch (ArgumentException ex) { ErrorInvalidFormat(ex.Message); } TreeProfileContent content = new TreeProfileContent(); string path = ""; if (TexturePath != null && TexturePath != "" && !(TexturePath.EndsWith("/") || TexturePath.EndsWith(@"\"))) { path = TexturePath + "/"; } else if (TexturePath == null) { path = ""; } else { path = TexturePath; } XmlNode treeNode = input.SelectSingleNode("Tree"); content.GeneratorXML = input; content.TrunkTexture = path + GetChildContent(treeNode, "TrunkTexture"); content.LeafTexture = path + GetChildContent(treeNode, "LeafTexture"); content.TrunkEffect = TrunkEffect; content.LeafEffect = LeafEffect; return(content); }
protected override void WriteHeader(TextWriter writer, ExportSettings exportSettings, OsbLayer layer) => writer.WriteLine($"Animation,{layer},{Origin.ToString()},\"{TexturePath.Trim()}\",{InitialPosition.X.ToString(exportSettings.NumberFormat)},{InitialPosition.Y.ToString(exportSettings.NumberFormat)},{FrameCount},{FrameDelay},{LoopType}");