コード例 #1
0
    public static UIHangarObserver InitializeHangarObserverScript()
    {
        UIHangarObserver uho = Instantiate(Resources.Load <GameObject>("UIPrefs/hangarObserver"), mycanvas.rightPanel.transform).GetComponent <UIHangarObserver>();

        uho.LocalizeTitles();
        return(uho);
    }
コード例 #2
0
    public static UIHangarObserver InitializeHangarObserverScript()
    {
        UIHangarObserver uho = Instantiate(Resources.Load <GameObject>("UIPrefs/hangarObserver"), UIController.current.rightPanel.transform).GetComponent <UIHangarObserver>();

        Hangar.hangarObserver = uho;
        return(uho);
    }
コード例 #3
0
    public override UIObserver ShowOnGUI()
    {
        if (hangarObserver == null)
        {
            hangarObserver = UIHangarObserver.InitializeHangarObserverScript();
        }
        else
        {
            hangarObserver.gameObject.SetActive(true);
        }
        hangarObserver.SetObservingHangar(this);
        showOnGUI = true;
        if (!correctLocation)
        {
            //#incorrectLocationDisplaying - Hangar
            float   len = 1;
            Vector3 pos = basement.pos.ToWorldSpace() + Vector3.up * Block.QUAD_SIZE;
            switch (modelRotation)
            {
            case 0:
                len = basement.pos.z * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(pos.x, pos.y, pos.z + Block.QUAD_SIZE / 2f + len / 2f),
                    new Vector3(1, 1, len),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 2:
                len = (Chunk.chunkSize - pos.x - 1) * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(pos.x + Block.QUAD_SIZE / 2f + len / 2f, pos.y, pos.z),
                    new Vector3(len, 1, 1),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 4:
                len = (Chunk.chunkSize - pos.z - 1) * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(pos.x, pos.y, pos.z - Block.QUAD_SIZE / 2f - len / 2f),
                    new Vector3(1, 1, len),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 6:
                len = basement.pos.x * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(pos.x - Block.QUAD_SIZE / 2f - len / 2f, pos.y, pos.z),
                    new Vector3(len, 1, 1),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;
            }
            //end
        }
        return(hangarObserver);
    }
コード例 #4
0
ファイル: Hangar.cs プロジェクト: Alan-Baylis/VoxelGame-1
    public override UIObserver ShowOnGUI()
    {
        if (hangarObserver == null)
        {
            hangarObserver = UIHangarObserver.InitializeHangarObserverScript();
        }
        else
        {
            hangarObserver.gameObject.SetActive(true);
        }
        hangarObserver.SetObservingHangar(this);
        showOnGUI = true;
        if (!correctLocation)
        {
            //#incorrectLocationDisplaying - Hangar
            float len = 1;
            float x = basement.transform.position.x, y = basement.transform.position.y, z = basement.transform.position.z;
            switch (modelRotation)
            {
            case 0:
                len = basement.pos.z * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(x, y, z + Block.QUAD_SIZE / 2f + len / 2f),
                    new Vector3(1, 1, len),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 2:
                len = (Chunk.CHUNK_SIZE - x - 1) * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(x + Block.QUAD_SIZE / 2f + len / 2f, y, z),
                    new Vector3(len, 1, 1),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 4:
                len = (Chunk.CHUNK_SIZE - z - 1) * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(x, y, z - Block.QUAD_SIZE / 2f - len / 2f),
                    new Vector3(1, 1, len),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;

            case 6:
                len = basement.pos.x * Block.QUAD_SIZE;
                PoolMaster.current.DrawZone(
                    new Vector3(x - Block.QUAD_SIZE / 2f - len / 2f, y, z),
                    new Vector3(len, 1, 1),
                    new Color(1, 0.076f, 0.076f, 0.4f)
                    );
                break;
            }
            //end
        }
        return(hangarObserver);
    }