コード例 #1
0
    public override void Awake()
    {
        GUICamera component = base.gameObject.GetComponent <GUICamera>();

        if (component != null && !(component is GameDramaGUICamera))
        {
            UnityEngine.Object.Destroy(component);
        }
        Camera camera = base.gameObject.GetComponent(typeof(Camera)) as Camera;

        if (camera != null)
        {
            this.UICameraRectX      = camera.rect.x;
            this.UICameraRectY      = camera.rect.y;
            this.UICameraRectWidth  = camera.rect.width;
            this.UICameraRectHeight = camera.rect.height;
            this.UICameraAspect     = camera.aspect;
        }
        this.CameraCorrection();
        this.SetCameraViewPort(base.gameObject.GetComponent(typeof(Camera)) as Camera);
        GameObject gameObject = new GameObject("bgCamera");

        if (gameObject != null)
        {
            gameObject.AddComponent <GameDramaBGCamera>();
        }
        base.Awake();
    }
コード例 #2
0
    public static void Tooltip_Rect(Form cForm, Vector3 showPosition)
    {
        if (TsPlatform.IsMobile)
        {
            float x = (GUICamera.width - cForm.GetSizeX() * 2f) / 2f;
            cForm.SetLocation(x, 10f);
        }
        else if (!TsPlatform.IsMobile || (showPosition == Vector3.zero && ItemTooltipDlg_Second.MOBILE_TOOLTIP_POS == Vector3.zero))
        {
            float   num    = 20f;
            Vector3 vector = GUICamera.ScreenToGUIPoint(NkInputManager.mousePosition);
            Vector2 size   = cForm.GetSize();
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.ITEMTOOLTIP_SECOND_DLG))
            {
                float x2 = (GUICamera.width - cForm.GetSizeX() * 2f) / 2f;
                cForm.SetLocation(x2, 10f);
            }
            else
            {
                float num2 = vector.x + num;
                if (num2 + size.x > GUICamera.width)
                {
                    num2 = vector.x - num - size.x;
                }
                float num3 = GUICamera.height - vector.y;
                if (num3 + size.y > GUICamera.height)
                {
                    float num4 = num3 + size.y - GUICamera.height;
                    num3 -= num4;
                }
                cForm.SetLocation(num2, num3);
            }
        }
        else
        {
            if (showPosition != Vector3.zero && ItemTooltipDlg_Second.MOBILE_TOOLTIP_POS == Vector3.zero)
            {
                showPosition.y = -showPosition.y;
                ItemTooltipDlg_Second.MOBILE_TOOLTIP_POS = showPosition;
            }
            Vector3 vector = GUICamera.ScreenToGUIPoint(ItemTooltipDlg_Second.MOBILE_TOOLTIP_POS);
            Vector2 size2  = cForm.GetSize();
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.ITEMTOOLTIP_SECOND_DLG))
            {
                Form form = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.ITEMTOOLTIP_SECOND_DLG);

                float x3 = vector.x;
                float y  = vector.y;
                form.SetLocation(x3 + size2.x + 2f, y);
                cForm.SetLocation(x3, y);
            }
            else
            {
                float x3 = vector.x;
                float y  = vector.y;
                cForm.SetLocation(x3, y);
            }
        }
    }
コード例 #3
0
        public Vector3 GetEffectUIPos(Vector2 ScreenPos)
        {
            Vector3 result = GUICamera.ScreenToGUIPoint(ScreenPos);

            result.y = -result.y;
            result.z = UIPanelManager.EFFECT_UI_DEPTH;
            return(result);
        }
コード例 #4
0
    protected virtual void DrawDragingNode(GUICamera camera)
    {
        Rect rect = new Rect
        {
            size   = NODE_SIZE * camera.Scale,
            center = camera.MouseInView
        };

        GUI.Box(rect, Draging.Index.ToString(), Draging.Parent ? AutoGraphStyles.NodeDrag : AutoGraphStyles.FreeNode);
    }
コード例 #5
0
    public Vector3 WorldToEZ(Vector3 Pos)
    {
        Camera main = Camera.main;

        if (null != main)
        {
            Pos = main.WorldToScreenPoint(Pos);
        }
        Pos.y = (float)Screen.height - Pos.y;
        Pos   = GUICamera.ScreenToGUIPoint(Pos);
        return(Pos);
    }
コード例 #6
0
 public override void Draw(GUICamera camera)
 {
     foreach (var node in Graph.Nodes)
     {
         if (!Graph.HasParent(node) && Draging.Nodes.Contains(node))
         {
             DrawNode(camera, node);
         }
     }
     if (Draging.Nodes.Count > 0)
     {
         DrawDragingNode(camera);
     }
 }
コード例 #7
0
 public override void SetComponent()
 {
     this.m_ListBox_ListBox            = new ListBox[3];
     this.m_ItemsCount                 = new int[3];
     this.m_DrawTexture_Line           = new DrawTexture[2];
     this.m_DrawTexture_ListBG1        = (base.GetControl("DrawTexture_ListBG1") as DrawTexture);
     this.m_DrawTexture_Name1          = (base.GetControl("DrawTexture_Name1") as DrawTexture);
     this.m_ListBox_ListBox[0]         = (base.GetControl("ListBox_ListBox0") as ListBox);
     this.m_ListBox_ListBox[0].Reserve = false;
     this.m_ListBox_ListBox[1]         = (base.GetControl("ListBox_ListBox1") as ListBox);
     this.m_ListBox_ListBox[1].Reserve = false;
     this.m_ListBox_ListBox[2]         = (base.GetControl("ListBox_ListBox2") as ListBox);
     this.m_ListBox_ListBox[2].Reserve = false;
     this.m_Label_Label4               = (base.GetControl("Label_Label4") as Label);
     this.m_DrawTexture_Line[0]        = (base.GetControl("DrawTexture_Line1") as DrawTexture);
     this.m_DrawTexture_Line[1]        = (base.GetControl("DrawTexture_Line2") as DrawTexture);
     for (int i = 0; i < 3; i++)
     {
         if (this.m_ListBox_ListBox[i].slider != null)
         {
             UnityEngine.Object.Destroy(this.m_ListBox_ListBox[i].slider.gameObject);
         }
         this.m_ListBox_ListBox[i].OffsetX = 0f;
         if (TsPlatform.IsMobile)
         {
             this.m_ListBox_ListBox[i].LineHeight = 80f;
             this.m_ListBox_ListBox[i].ColumnNum  = 1;
             this.m_ListBox_ListBox[i].SetColumnWidth((int)this.m_ListBox_ListBox[i].GetSize().x, 0, 0, 0, 0, 32f);
         }
         else
         {
             this.m_ListBox_ListBox[i].LineHeight = 20f;
             this.m_ListBox_ListBox[i].ColumnNum  = 1;
             this.m_ListBox_ListBox[i].SetColumnWidth((int)this.m_ListBox_ListBox[i].GetSize().x, 0, 0, 0, 0);
         }
         this.m_ListBox_ListBox[i].AddValueChangedDelegate(new EZValueChangedDelegate(this.ListBoxSelect));
         this.m_ListBox_ListBox[i].AddLongTapDelegate(new EZValueChangedDelegate(this.ListBoxSelect));
     }
     if (TsPlatform.IsWeb || TsPlatform.IsEditor || TsPlatform.IsAndroid)
     {
         float x   = NkInputManager.mousePosition.x;
         float num = GUICamera.height - NkInputManager.mousePosition.y;
         base.SetLocation((float)((int)x), (float)((int)num));
     }
     else
     {
         Vector3 vector = GUICamera.ScreenToGUIPoint(new Vector3(NkInputManager.GetTouch(0).position.x, GUICamera.height - NkInputManager.GetTouch(0).position.y, 1f));
         base.SetLocation((float)((int)vector.x), (float)((int)vector.y));
     }
 }
コード例 #8
0
    public void UpdatePosition()
    {
        if (this.m_goTarget == null)
        {
            this.Close();
            return;
        }
        if (this.m_goTarget.CastedTarget == null)
        {
            this.Close();
            return;
        }
        Vector3 pos = Vector3.zero;

        pos    = this.m_goTarget.CastedTarget.transform.position;
        pos    = GUICamera.WorldToEZ(pos);
        pos.x -= base.GetSizeX() / 2f;
        base.SetLocation(pos.x, pos.y);
    }
コード例 #9
0
    private void UpdatePosition(Vector2 pos)
    {
        Vector3 worldPoint = GUICamera.ScreenToWorldPoint(pos);

        if (enableAxisX)
        {
            padPos.x = worldPoint.x;
        }
        if (enableAxisY)
        {
            padPos.y = worldPoint.y;
        }

        img.localPosition = Vector3.ClampMagnitude(padPos, offset);

        if (moving)
        {
            padPos.Normalize();
        }
    }
コード例 #10
0
ファイル: UI_UIGuide.cs プロジェクト: parikharsh/GLOH_Source
    public void SetBattleTutorial(int value1, int value2, NkBattleChar pkBattleChar)
    {
        base.SetShowLayer(0, false);
        base.SetShowLayer(1, true);
        this.SetTextBattle(value1.ToString());
        if (value1 == 101010703)
        {
            Vector2 zero  = Vector2.zero;
            Vector2 zero2 = Vector2.zero;
            if (pkBattleChar != null)
            {
                this.m_TargetChar = pkBattleChar;
                Vector3 pos = Vector3.zero;
                pos   = this.m_TargetChar.CastedTarget.Get3DChar().GetRootGameObject().transform.position;
                pos   = GUICamera.WorldToEZ(pos);
                zero  = new Vector2(pos.x, pos.y - 150f);
                zero2 = new Vector2(pos.x - 20f, pos.y - 190f);
            }
            else
            {
                zero  = new Vector2(GUICamera.width / 2f + this.m_Touch.width, GUICamera.height / 2f - 150f);
                zero2 = new Vector2(GUICamera.width / 2f, GUICamera.height / 2f - 190f);
            }
            this.Move(zero, zero2);
            this._BG.UsedCollider(false);
        }
        else if (value1 == 101010701)
        {
            Battle_Control_Dlg battle_Control_Dlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BATTLE_CONTROL_DLG) as Battle_Control_Dlg;

            if (battle_Control_Dlg == null)
            {
                return;
            }
            Vector2 skillButtonPos = battle_Control_Dlg.GetSkillButtonPos();
            Vector3 v = new Vector2(skillButtonPos.x + 60f, skillButtonPos.y - 25f);
            Vector2 x = new Vector2(skillButtonPos.x - this.m_HelpText.GetSize().x - 30f, skillButtonPos.y - 55f);
            this.Move(v, x);
            this._BG.UsedCollider(false);
        }
    }
コード例 #11
0
ファイル: UI_UIGuide.cs プロジェクト: parikharsh/GLOH_Source
    public override void Update()
    {
        base.Update();
        this.OnGeneralTouchCallback();
        if (this.m_TargetChar != null && this.m_TargetChar.CastedTarget != null)
        {
            Nr3DCharBase nr3DCharBase = this.m_TargetChar.CastedTarget.Get3DChar();
            if (nr3DCharBase != null)
            {
                Vector2 zero  = Vector2.zero;
                Vector2 zero2 = Vector2.zero;
                Vector3 pos   = Vector3.zero;
                pos   = nr3DCharBase.GetRootGameObject().transform.position;
                pos   = GUICamera.WorldToEZ(pos);
                zero  = new Vector2(pos.x, pos.y - 150f);
                zero2 = new Vector2(pos.x - 20f, pos.y - 190f);
                this.Move(zero, zero2);
            }
        }
        if (this._ScreenWidth != GUICamera.width || this._ScreenHeight != GUICamera.height)
        {
            this.ResizeDlg();
        }
        if (this.m_nOtherWinID != G_ID.NONE)
        {
            Form form = NrTSingleton <FormsManager> .Instance.GetForm(this.m_nOtherWinID);

            if (form != null)
            {
                form.SetLocation(form.GetLocationX(), form.GetLocationY(), NrTSingleton <FormsManager> .Instance.GetTopMostZ() - 1f);
            }
        }
        if (!this.bAutoClose)
        {
            return;
        }
        if (Time.realtimeSinceStartup > this.fCloseTime)
        {
            this.Close();
        }
    }
コード例 #12
0
    public void UpdatePosition()
    {
        if (this.m_TargetChar == null)
        {
            return;
        }
        if (!this.m_TargetChar.CastedTarget.IsReady3DModel())
        {
            return;
        }
        if (this.MAXHP != (float)this.m_TargetChar.CastedTarget.GetMaxHP(false))
        {
            this.MAXHP = (float)this.m_TargetChar.CastedTarget.GetMaxHP(false);
        }
        Vector3 pos = Vector3.zero;

        pos    = this.m_TargetChar.CastedTarget.Get3DChar().GetRootGameObject().transform.position;
        pos    = GUICamera.WorldToEZ(pos);
        pos.x -= base.GetSizeX() / 2f;
        base.SetLocation(pos.x, pos.y);
    }
コード例 #13
0
    public static Vector3 WorldToEZ(Vector3 Pos)
    {
        Camera main = Camera.main;

        if (null != main)
        {
            Vector3 rhs = Pos - main.transform.position;
            float   num = Vector3.Dot(main.transform.forward, rhs);
            if (num < 0f)
            {
                float y = -2000f;
                Pos   = Vector3.zero;
                Pos.y = y;
                return(Pos);
            }
            Pos = main.WorldToScreenPoint(Pos);
        }
        Pos.y = (float)Screen.height - Pos.y;
        Pos   = GUICamera.ScreenToGUIPoint(Pos);
        return(Pos);
    }
コード例 #14
0
    protected virtual void DrawNode(GUICamera camera, GraphNode node)
    {
        if (Draging.Nodes.Contains(node))
        {
            return;
        }
        Rect selfInView = camera.WorldToScreen(node.Bounds);

        if (Graph.HasParent(node))
        {
            Rect parentInView = camera.WorldToScreen(Graph.GetParent(node).Node.Bounds);
            DrawLine(parentInView, selfInView, Color.white, camera.Scale * LineWidth);
        }
        if (camera.ViewBounds.Overlaps(selfInView))
        {
            GUI.Box(selfInView, "", GetNodeStyle(node));
        }
        if (!node.FoldChildren)
        {
            if (Draging.Parent.GUID == node.GUID && Draging.Index >= 0)
            {
                if (Draging.Nodes.Exists(obj => Graph.GetParent(obj.Node) == Draging.Parent))
                {
                    Rect bounds       = GetChildPlaceholderRect(node, Draging.Index);
                    Rect boundsInView = camera.WorldToScreen(bounds);
                    DrawLine(selfInView, boundsInView, Color.yellow, camera.Scale * LineWidth);
                    GUI.Box(boundsInView, "", AutoGraphStyles.NodePlaceholder);
                }
            }
            foreach (var link in Graph.Links)
            {
                if (link.From.Node != node)
                {
                    continue;
                }
                DrawNode(camera, link.To.Node);
            }
        }
    }
コード例 #15
0
ファイル: Tooltip_Dlg.cs プロジェクト: parikharsh/GLOH_Source
    public static void Tooltip_Rect(Form cForm, Vector3 showPosition)
    {
        if (!TsPlatform.IsMobile || (showPosition == Vector3.zero && Tooltip_Dlg.MOBILE_TOOLTIP_POS == Vector3.zero))
        {
            float   num    = 20f;
            Vector3 vector = GUICamera.ScreenToGUIPoint(NkInputManager.mousePosition);
            Vector2 size   = cForm.GetSize();
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.TOOLTIP_SECOND_DLG))
            {
                Form form = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOOLTIP_SECOND_DLG);

                Vector2 size2 = form.GetSize();
                float   num2  = vector.x + num;
                if (num2 + size.x + 2f + size2.x > GUICamera.width)
                {
                    num2 = vector.x - num - size.x - 2f - size2.x;
                }
                float num3 = GUICamera.height - vector.y;
                if (num3 + size.y > GUICamera.height)
                {
                    float num4 = num3 + size.y - GUICamera.height;
                    num3 -= num4;
                }
                form.SetLocation(num2 + size.x + 2f, num3);
                cForm.SetLocation(num2, num3);
            }
            else
            {
                float num2 = vector.x + num;
                if (num2 + size.x > GUICamera.width)
                {
                    num2 = vector.x - num - size.x;
                }
                float num3 = GUICamera.height - vector.y;
                if (num3 + size.y > GUICamera.height)
                {
                    float num5 = num3 + size.y - GUICamera.height;
                    num3 -= num5;
                }
                cForm.SetLocation(num2, num3);
            }
        }
        else
        {
            if (showPosition != Vector3.zero && Tooltip_Dlg.MOBILE_TOOLTIP_POS == Vector3.zero)
            {
                showPosition.y = -showPosition.y;
                Tooltip_Dlg.MOBILE_TOOLTIP_POS = showPosition;
            }
            Vector3 vector = GUICamera.ScreenToGUIPoint(Tooltip_Dlg.MOBILE_TOOLTIP_POS);
            Vector2 size3  = cForm.GetSize();
            if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.TOOLTIP_SECOND_DLG))
            {
                Form form2 = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.TOOLTIP_SECOND_DLG);

                float x = vector.x;
                float y = vector.y;
                form2.SetLocation(x + size3.x + 2f, y);
                cForm.SetLocation(x, y);
            }
            else
            {
                float x = vector.x;
                float y = vector.y;
                cForm.SetLocation(x, y);
            }
        }
    }
コード例 #16
0
ファイル: GraphLayout.cs プロジェクト: zh880517/UnityLib
 public abstract void Draw(GUICamera camera);
コード例 #17
0
    public void Other()
    {
        if (NkInputManager.GetKeyUp(KeyCode.F9))
        {
        }
        if (NkInputManager.GetKeyUp(KeyCode.F10))
        {
            NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NEWEXPLORATION_MAIN_DLG);
        }
        if (NkInputManager.GetKeyUp(KeyCode.Z) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            GameObject gameObject = GameObject.Find("back light");
            if (gameObject != null)
            {
                gameObject.SetActive(false);
            }
        }
        if (NkInputManager.GetKeyUp(KeyCode.Q) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.QUEST_GM_DLG);
        }
        if (NkInputManager.GetKeyUp(KeyCode.C) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            Screen.fullScreen = !Screen.fullScreen;
        }
        if (NkInputManager.GetKeyUp(KeyCode.C) && NkInputManager.GetKey(KeyCode.RightShift))
        {
            NkWorldMapATB worldMapATB = NrTSingleton <MapManager> .Instance.GetWorldMapATB();

            if (worldMapATB != null)
            {
                worldMapATB.ShowCellGrid();
            }
        }
        if (NkInputManager.GetKeyUp(KeyCode.U) && NkInputManager.GetKey(KeyCode.RightShift))
        {
            GUICamera.ShowUI_Toggle();
        }
        if (NkInputManager.GetKeyUp(KeyCode.D) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            if (!NrTSingleton <FormsManager> .Instance.IsShow(G_ID.MESSAGE_DLG))
            {
                NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.MESSAGE_DLG);
            }
            else
            {
                NrTSingleton <FormsManager> .Instance.Hide(G_ID.MESSAGE_DLG);
            }
        }
        if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKey(KeyCode.LeftControl) && NkInputManager.GetKeyUp(KeyCode.D))
        {
            NrTSingleton <MapManager> .Instance.ShowDestPosition(true);
        }
        if (NkInputManager.GetKey(KeyCode.LeftShift) && NkInputManager.GetKey(KeyCode.LeftAlt) && NkInputManager.GetKeyUp(KeyCode.D))
        {
            NrTSingleton <MapManager> .Instance.ShowDestPosition(false);
        }
        if (NkInputManager.GetKeyDown(KeyCode.Alpha1) && NkInputManager.GetKey(KeyCode.LeftShift) && Scene.CurScene != Scene.Type.BATTLE)
        {
            NrTSingleton <NkCharManager> .Instance.ToggleShowCharUnique();

            NrTSingleton <NkQuestManager> .Instance.ToggleQeustUnique();
        }
        if (NkInputManager.GetKeyDown(KeyCode.P) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            NrTSingleton <NrAutoPath> .Instance.ShowRPPoint();
        }
        if (NkInputManager.GetKeyDown(KeyCode.P) && NkInputManager.GetKey(KeyCode.RightShift))
        {
            NrTSingleton <NrAutoPath> .Instance.ClearRPPoint();
        }
        if (!NkInputManager.GetKey(KeyCode.LeftAlt) || NkInputManager.GetKeyUp(KeyCode.K))
        {
        }
        if (NkInputManager.GetKeyUp(KeyCode.S) && NkInputManager.GetKey(KeyCode.LeftShift))
        {
            if (!NrTSingleton <FormsManager> .Instance.IsShow(G_ID.DLG_AUDIO))
            {
                NrTSingleton <FormsManager> .Instance.ShowForm(G_ID.DLG_AUDIO);
            }
            else
            {
                NrTSingleton <FormsManager> .Instance.Hide(G_ID.DLG_AUDIO);
            }
        }
        if (!NkInputManager.GetKeyUp(KeyCode.Alpha2) || NkInputManager.GetKey(KeyCode.LeftShift))
        {
        }
        if (NkInputManager.GetKeyUp(KeyCode.A) && NkInputManager.GetKey(KeyCode.LeftShift) && !Scene.IsCurScene(Scene.Type.SOLDIER_BATCH))
        {
            SoldierBatch.SOLDIER_BATCH_MODE        = eSOLDIER_BATCH_MODE.MODE_GUILDBOSS_MAKEUP;
            SoldierBatch.GUILDBOSS_INFO.m_i16Floor = 1;
            FacadeHandler.PushStage(Scene.Type.SOLDIER_BATCH);
        }
    }
コード例 #18
0
ファイル: GUIManager.cs プロジェクト: ja003/Fractal-Nature-II
    void Start()
    {
        cm = GameObject.Find("MainCamera").GetComponent<CameraManager>();

        menuWidth = 200;
        rightOffset = 5;
        topOffset = 5;
        menuButtonHeight = 40;
        smallButtonHeight = 20;

        fractalNatureFlag = true;
        generalSettingsFlag = true;
        erosionMenuFlag = false;
        filterMenuFlag = false ;
        riverMenuFlag = false;
        debugMenuFlag = false;

        messageFlag = false;
        //messageEndFrame = 666;

        terrainProcessing = false;

        scaleY = cm.scaleTerrainY;
        visibleArea = cm.terrainWidth;
        //visibleArea = 100;
        patchSize = cm.patchSize;

        message = new GUIMessage(this);//has to be declared first!

        menu = new GUIMenu(this);
        cameraMenu = new GUICamera(this);
        mesh = new GUIMesh(this);
        export = new GUIExport(this);
        progress = new GUIProgress(this);
        filter = new GUIFilters(this);
        river = new GUIRiver(this);
        debug = new GUIDebug(this);
        erosion = new GUIErosion(this);

        AssignFunctions();
    }