Ejemplo n.º 1
0
        public void AddRoom(IntVector3 roomPos)
        {
            MinimapImage img = null;

            switch (roomPos.y)
            {
            case -1:
                img = minimapImgBasement;
                break;

            case 0:
                img = minimapImgGround;
                break;

            case 1:
                img = minimapImgUpstairs;
                break;
            }
            if (img == null)
            {
                return;
            }

            //minimap.ClearQuad();
            Rect    r      = img.GetPixelAdjustedRect();
            Vector2 center = r.center;

            center.x += roomPos.x * 20;
            center.y += roomPos.z * 20;
            center   -= new Vector2(10, 10);
            Rect pos = new Rect(center, new Vector2(19, 19));

            img.AddQuad(pos, new Rect(0, 0, 1, 1));
            img.SetMeshDirty();
        }
Ejemplo n.º 2
0
        void SetLayer(LAYER layer)
        {
            if (layer == curLayer)
            {
                return;
            }
            curLayer = layer;
            switch (curLayer)
            {
            case LAYER.BASEMENT:
                minimapImgBasement.enabled = true;
                minimapImgBasement.SetMeshDirty();
                minimapImgGround.enabled   = false;
                minimapImgUpstairs.enabled = false;
                break;

            case LAYER.GROUND:
                minimapImgBasement.enabled = false;
                minimapImgGround.enabled   = true;
                minimapImgGround.SetMeshDirty();
                minimapImgUpstairs.enabled = false;
                break;

            case LAYER.UPSTAIRS:
                minimapImgBasement.enabled = false;
                minimapImgGround.enabled   = false;
                minimapImgUpstairs.enabled = true;
                minimapImgUpstairs.SetMeshDirty();
                break;
            }
        }