public void RemoveInstance(ImpostorInstanceData data)
 {
     this.Positions[data.BatchIndex] = new Vector4(0f, 0f, 0f, -1f);
     this.recycle.Enqueue(data.BatchIndex);
     data.BatchIndex = 0;
     data.Batch      = null;
 }
Пример #2
0
    public override bool Equals(object obj)
    {
        ImpostorInstanceData impostorInstanceData = obj as ImpostorInstanceData;

        if (impostorInstanceData.Material == Material)
        {
            return(impostorInstanceData.Mesh == Mesh);
        }
        return(false);
    }
Пример #3
0
    public override bool Equals(object obj)
    {
        ImpostorInstanceData impostorInstanceData = obj as ImpostorInstanceData;

        if (Object.op_Equality((Object)impostorInstanceData.Material, (Object)this.Material))
        {
            return(Object.op_Equality((Object)impostorInstanceData.Mesh, (Object)this.Mesh));
        }
        return(false);
    }
 public void AddInstance(ImpostorInstanceData data)
 {
     data.Batch = this;
     if (this.recycle.Count <= 0)
     {
         data.BatchIndex = this.Positions.Count;
         this.Positions.Add(data.PositionAndScale());
         return;
     }
     data.BatchIndex = this.recycle.Dequeue();
     this.Positions[data.BatchIndex] = data.PositionAndScale();
 }
Пример #5
0
 public void AddInstance(ImpostorInstanceData data)
 {
     data.Batch = this;
     if (recycle.Count > 0)
     {
         data.BatchIndex            = recycle.Dequeue();
         Positions[data.BatchIndex] = data.PositionAndScale();
     }
     else
     {
         data.BatchIndex = Positions.Count;
         Positions.Add(data.PositionAndScale());
     }
 }