public IBuffer GetBuffer(BufferID id) { for (int i = 0; i < bufferList.Count; i++) { if ((bufferList[i] as Buffer).id == id) { return(bufferList[i]); } } return(null); }
public bool RemoveBuffer(BufferID id) { for (int i = 0; i < bufferList.Count; i++) { if ((bufferList[i] as Buffer).id == id) { bufferList[i].OnStop(); this.bufferList.RemoveAt(i); return(true); } } return(false); }
public IBuffer AddBuffer(BufferID id) { if (this.GetBuffer(id) != null) { Debug.LogError("exist same buffer:" + id.ToString()); return(null); } var buffer = BufferMachine.Instance.Spwan(id); this.bufferList.Add(buffer); buffer.OnRelease(this); return(buffer); }
public IBuffer Spwan(BufferID id) { switch (id) { //////case BufferID.TemporaryStop: ////// return new TemporaryStop(id); //////case BufferID.ADSpeedUp: ////// return new ADSpeedUp(id); //////case BufferID.MouseClickSpeedUp: ////// return new MouseClickSpeedUp(id); //////case BufferID.SpeedLevelChange: ////// return new SpeedLevelChange(id); //////case BufferID.CarDash: ////// return new CarDash(id); } return(null); }
public static int GetBufferPropertyID(BufferID id) { return(_bufferIDs[(int)id]); }
public static void SetGlobalBuffer(BufferID id, ComputeBuffer value) { Shader.SetGlobalBuffer(_bufferIDs[(int)id], value); }
public Buffer(BufferID id) { this.id = id; }