void DeleteBlock(LinkedListNode <IBackgroundBlock> node) { // first is the oldest IBackgroundBlock first = node.Value; // return to pool first.CurrentObject.SetActive(false); blocks.Remove(node); }
public static IBackgroundBlock Shift(this IBackgroundBlock fileBlock, int lineShift) { if (fileBlock == null) { throw new ArgumentNullException("fileBlock"); } UnWrapShiftdFileBlock(ref fileBlock, ref lineShift); return(new ShiftedBackgroundBlock(fileBlock, lineShift)); }
//public void Reinit(bool ignoreCutsceneBlocks) //{ // if (ignoreCutsceneBlocks) // { // DeleteAllNotCutscene(); // } // else // { // Reinit(); // } //} #region creating blocks /// <summary> /// Create block at undefined position. /// Note: this method only creates block, but doesn't add to list /// </summary> IBackgroundBlock CreateBlock(ref string blockName) { GameObject newBlockObj = ObjectPool.Instance.GetObject(blockName); IBackgroundBlock newBlock = newBlockObj.GetComponent <IBackgroundBlock>(); Debug.Assert(newBlock != null, "Block must contain 'IBackgroundBlock' component", newBlockObj); return(newBlock); }