Пример #1
0
 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);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 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);
 }
Пример #5
0
 public static int GetBufferPropertyID(BufferID id)
 {
     return(_bufferIDs[(int)id]);
 }
Пример #6
0
 public static void SetGlobalBuffer(BufferID id, ComputeBuffer value)
 {
     Shader.SetGlobalBuffer(_bufferIDs[(int)id], value);
 }
Пример #7
0
 public Buffer(BufferID id)
 {
     this.id = id;
 }