public static UIDockObserver InitializeDockObserverScript()
    {
        UIDockObserver udo = Instantiate(Resources.Load <GameObject>("UIPrefs/dockObserver"), UIController.current.rightPanel.transform).GetComponent <UIDockObserver>();

        Dock.dockObserver = udo;
        return(udo);
    }
Example #2
0
    public static UIDockObserver InitializeDockObserverScript()
    {
        UIDockObserver udo = Instantiate(Resources.Load <GameObject>("UIPrefs/dockObserver"), mycanvas.rightPanel.transform).GetComponent <UIDockObserver>();

        udo.LocalizeTitles();
        udo.gameObject.SetActive(false);
        return(udo);
    }
Example #3
0
 public static UIDockObserver GetDockObserver()
 {
     if (dockObserver == null)
     {
         dockObserver = UIDockObserver.InitializeDockObserverScript();
     }
     return(dockObserver);
 }
Example #4
0
    public override UIObserver ShowOnGUI()
    {
        if (dockObserver == null)
        {
            dockObserver = UIDockObserver.InitializeDockObserverScript();
        }
        else
        {
            dockObserver.gameObject.SetActive(true);
        }
        dockObserver.SetObservingDock(this);
        showOnGUI = true;
        if (!correctLocation)
        {   //#incorrectLocationDisplaying
            switch (modelRotation)
            {
            case 0:
                PoolMaster.current.DrawZone(
                    new Vector3(Chunk.CHUNK_SIZE / 2f * Block.QUAD_SIZE, basement.transform.position.y, basement.transform.position.z + (0.5f + SMALL_SHIPS_PATH_WIDTH / 2f) * Block.QUAD_SIZE),
                    new Vector3(Chunk.CHUNK_SIZE, SMALL_SHIPS_PATH_WIDTH, SMALL_SHIPS_PATH_WIDTH),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 2:
                PoolMaster.current.DrawZone(
                    new Vector3(basement.transform.position.x + (0.5f + SMALL_SHIPS_PATH_WIDTH / 2f), basement.transform.position.y, Chunk.CHUNK_SIZE / 2f * Block.QUAD_SIZE),
                    new Vector3(SMALL_SHIPS_PATH_WIDTH, SMALL_SHIPS_PATH_WIDTH, Chunk.CHUNK_SIZE),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 4:
                PoolMaster.current.DrawZone(
                    new Vector3(Chunk.CHUNK_SIZE / 2f * Block.QUAD_SIZE, basement.transform.position.y, basement.transform.position.z - (0.5f + SMALL_SHIPS_PATH_WIDTH / 2f) * Block.QUAD_SIZE),
                    new Vector3(Chunk.CHUNK_SIZE, SMALL_SHIPS_PATH_WIDTH, SMALL_SHIPS_PATH_WIDTH),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 6:
                PoolMaster.current.DrawZone(
                    new Vector3(basement.transform.position.x -
                                (0.5f + SMALL_SHIPS_PATH_WIDTH / 2f), basement.transform.position.y, Chunk.CHUNK_SIZE / 2f * Block.QUAD_SIZE),
                    new Vector3(SMALL_SHIPS_PATH_WIDTH, SMALL_SHIPS_PATH_WIDTH, Chunk.CHUNK_SIZE),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;
            }
            //end
        }
        return(dockObserver);
    }
Example #5
0
    public override UIObserver ShowOnGUI()
    {
        if (dockObserver == null)
        {
            dockObserver = UIDockObserver.InitializeDockObserverScript();
        }
        else
        {
            dockObserver.gameObject.SetActive(true);
        }
        dockObserver.SetObservingDock(this);
        showOnGUI = true;
        if (!correctLocation)
        {   //#incorrectLocationDisplaying
            int corridorWidth = SMALL_SHIPS_PATH_WIDTH;
            if (level > 1)
            {
                if (level == 2)
                {
                    corridorWidth = MEDIUM_SHIPS_PATH_WIDTH;
                }
                else
                {
                    corridorWidth = HEAVY_SHIPS_PATH_WIDTH;
                }
            }
            switch (modelRotation)
            {
            case 0:
                PoolMaster.current.DrawZone(
                    new Vector3(Chunk.chunkSize / 2f * Block.QUAD_SIZE, transform.position.y, basement.pos.ToWorldSpace().z + (0.5f + corridorWidth / 2f) * Block.QUAD_SIZE),
                    new Vector3(Chunk.chunkSize, corridorWidth, corridorWidth),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 2:
                PoolMaster.current.DrawZone(
                    new Vector3(basement.pos.ToWorldSpace().x + (0.5f + corridorWidth / 2f), transform.position.y, Chunk.chunkSize / 2f * Block.QUAD_SIZE),
                    new Vector3(corridorWidth, corridorWidth, Chunk.chunkSize),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 4:
                PoolMaster.current.DrawZone(
                    new Vector3(Chunk.chunkSize / 2f * Block.QUAD_SIZE, transform.position.y, basement.pos.ToWorldSpace().z - (0.5f + corridorWidth / 2f) * Block.QUAD_SIZE),
                    new Vector3(Chunk.chunkSize, corridorWidth, corridorWidth),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 6:
                PoolMaster.current.DrawZone(
                    new Vector3(basement.pos.ToWorldSpace().x -
                                (0.5f + corridorWidth / 2f), transform.position.y, Chunk.chunkSize / 2f * Block.QUAD_SIZE),
                    new Vector3(corridorWidth, corridorWidth, Chunk.chunkSize),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;
            }
            //end
        }
        return(dockObserver);
    }