Ejemplo n.º 1
0
        void DeleteBlock(LinkedListNode <IBackgroundBlock> node)
        {
            // first is the oldest
            IBackgroundBlock first = node.Value;

            // return to pool
            first.CurrentObject.SetActive(false);

            blocks.Remove(node);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        //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);
        }