/// <summary> /// Registers a <see cref="Duality.Resources.Sound">Sounds</see> playing instance. /// </summary> /// <param name="snd">The Sound that is playing.</param> /// <param name="is3D">Whether the instance is 3d or not.</param> internal void RegisterPlaying(ContentRef <Sound> snd, bool is3D) { if (is3D) { this.numPlaying3D++; } else { this.numPlaying2D++; } if (snd.IsAvailable && !snd.IsRuntimeResource) { if (!this.resPlaying.ContainsKey(snd.Path)) { this.resPlaying.Add(snd.Path, 1); } else { this.resPlaying[snd.Path]++; } } }
public DebuggerTypeProxy(ContentRef <T> cr) { this.cr = cr; }
public bool Equals(ContentRef <T> other) { return(this == other); }
/// <summary> /// Performs a single render cycle. /// </summary> /// <param name="target"> /// The <see cref="RenderTarget"/> which will be used for all rendering output. /// "null" means rendering directly to the output buffer of the game window / screen. /// </param> /// <param name="viewportRect">The viewport to render to, in pixel coordinates.</param> /// <param name="imageSize">Target size of the rendered image before adjusting it to fit the specified viewport.</param> public static void Render(ContentRef <RenderTarget> target, Rect viewportRect, Vector2 imageSize) { Scene.Current.Render(target, viewportRect, imageSize); }
public ResourceEventArgs(ContentRef <Resource> resRef, bool isDirectory = false) { this.content = resRef; this.isResource = !isDirectory; this.isDirectory = isDirectory; }
public void AddVertices <T>(ContentRef <Material> material, VertexMode vertexMode, T[] vertexBuffer, int vertexCount) where T : struct, IVertexData { this.AddVertices <T>(material.IsAvailable ? material.Res.InfoDirect : Material.Checkerboard.Res.InfoDirect, vertexMode, vertexBuffer, vertexCount); }
internal SoundInstance(ContentRef <Sound> sound) { this.sound = sound; this.is3D = false; this.audioData = this.sound.IsAvailable ? this.sound.Res.FetchData() : null; }
public void AddVertices <T>(ContentRef <Material> material, VertexMode vertexMode, params T[] vertices) where T : struct, IVertexData { this.AddVertices <T>(material.IsAvailable ? material.Res.InfoDirect : Material.Checkerboard.Res.InfoDirect, vertexMode, vertices, vertices.Length); }
internal SoundInstance(ContentRef <Sound> snd) { this.snd = snd; this.is3D = false; }
internal SoundInstance(ContentRef <Sound> snd, Vector3 pos) { this.pos = pos; this.is3D = true; this.snd = snd; }
internal SoundInstance(ContentRef <Sound> snd, GameObject attachObj) { this.attachedTo = attachObj; this.is3D = true; this.snd = snd; }
public ResourceSaveEventArgs(ContentRef <Resource> resRef, string saveAsPath) : base(resRef) { this.saveAsPath = saveAsPath; }