Beispiel #1
0
        //Public function
        //------------------------------------------------------------------------------------------
        public void SetLocation(SectionInWorld sectionInWorld)
        {
            m_Chunk = GetComponentInParent <Chunk>();

            //Init Location
            m_SecInWorld            = sectionInWorld;
            transform.localPosition = new Vector3(0, m_SecInWorld.Value.y * m_World.Chunk_Height, 0);

            //set name
            transform.name = "Section" + '[' + m_SecInWorld.Value.y + ']';
        }
        static public Section GetSection(SectionInWorld Slot, IWorld _World)
        {
            //Try get chunk
            Chunk _chunk = GetChunk(Slot.ToChunkInWorld(_World), _World);

            if (_chunk == null)
            {
                return(null);
            }

            //get Section
            return(_chunk.GetSection(Slot.ToSectionInChunk()));
        }