Example #1
0
    //-----------------------------------------------------
    public void CreateGui()
    {
        //UI
        Root = new GUIItemV2(-1,-1,"Root","","",this);

        //Title = new GUIItemV2(-1,-1,TextManager.GetText("GUIMenuInteraction.Options"),"title","title",this);

        Root.addSubItem(new GUIItemV2(0,2,TextManager.GetText("GUIMenuInteraction.Configure"),"configOn","configOff",this));//2
        indexConf = 0;
        Root.addSubItem(new GUIItemV2(0,0,TextManager.GetText("GUIMenuInteraction.NewObject"),"newOn","newOff",this));//0
        Root.addSubItem(new GUIItemV2(0,3,TextManager.GetText("GUIMenuInteraction.Replace"),"swapOn","swapOff",this));//3
        if(usefullData._edition != usefullData.OSedition.Lite)
            Root.addSubItem(new GUIItemV2(0,4,TextManager.GetText("GUIMenuInteraction.Copy"),"copyOn","copyOff",this));//4
        Root.addSubItem(new GUIItemV2(0,5,TextManager.GetText("GUIMenuInteraction.Refocus"),"reinitOn","reinitOff",this));//5
        if(usefullData._edition != usefullData.OSedition.Lite)
        {
            Root.addSubItem(new GUIItemV2(0,1,TextManager.GetText("GUIMenuInteraction.Lock"),"lockOn","lockOff",this));//1
            indexLock = 5;
        }
        Root.addSubItem(new GUIItemV2(0,6,TextManager.GetText("GUIMenuInteraction.Delete"),"suppressOn","suppressOff",this));//6
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        m_menuGroup = new Rect();
        m_menuGroup.Set(Screen.width-260,0,260,Screen.height);

        m_grassCurTex = (Texture2D) GameObject.Find("grassGround").GetComponent<Renderer>().material.GetTexture("_MainTex");
        _matTexMenu = new GUIItemV2 (0, 0, "Material", "sousMenuOn", "sousMenuOff", this);
        _matTexList = new GUIUpperList (1, 0, TextManager.GetText("material"), "sousMenuOn", "sousMenuOff", this);

        _matTexMenu.addSubItem (_matTexList);
        enabled = false;
    }
Example #3
0
 void OnEnable()
 {
     _root = new GUIItemV2(-1, -1, "Root", "", "", this);
     _root.addSubItem (_matTexMenu);
     setContent();
 }
    void OnEnable()
    {
        GUI.skin = skin;
        m_off7 = Screen.width;
        Root = new GUIItemV2(-1,-1,"Root","","",this);

        GUIItemV2 mapsConfig = new GUIItemV2(0,0,TextManager.GetText("GUIMenuConfiguration.Materials"),"MaterialOn","MaterialOff",this);
        specFunctions = new GUIItemV2(0,1,TextManager.GetText("GUIMenuConfiguration.SpecialFunction"),"FunctionOn","FunctionOff",this);

        //Textures et couleurs
        obj2config = Camera.main.GetComponent<ObjInteraction>().configuringObj(null);// <- récupération de l'objet a configurer

        ObjData objData = obj2config.GetComponent <ObjData> ();
        OSLibObject obj = objData.GetObjectModel (); // get from obj2congfig
        OSLibModules modules = obj.GetModules ();
        int x = 0;
        //Debug.Log("Nb De Mobules>"+modules.GetStandardModuleList ().Count);
        foreach (OSLibModule module in modules.GetStandardModuleList ())
        {
            int thumbCount = module.GetTextureList ().Count + module.GetColorList ().Count;

        //			string nameThumb = "";
            if (thumbCount > 0/* || true*/)
            {
                Texture2D [] thumbnails = new Texture2D [thumbCount];
                string [] nameThumbs = new string [thumbCount];
                int textIndex = 0;
                foreach (OSLibColor col in module.GetColorList ()) //Ajout des vignettes des couleurs
                {
                    Texture2D thumbnail = col.GetThumbnail ();
                    nameThumbs[textIndex] = col.GetText(PlayerPrefs.GetString("language"));

                    if (thumbnail != null)
                        thumbnails[textIndex++] = thumbnail;
                    else
                    {
                        Color colorThumb = col.GetColor();
                        thumbnail = new Texture2D(128,128);
                        for (int cy=0; cy<128;cy++)
                            for(int cx=0; cx<128; cx++)
                                thumbnail.SetPixel(cx,cy,colorThumb);
                        thumbnail.Apply();
                        thumbnails[textIndex++] = thumbnail;
                    //	thumbnails[textIndex++] = Resources.Load("thumbnails/noThumbs",typeof(Texture2D)) as Texture2D;
                    }
                }

                foreach (OSLibTexture tex in module.GetTextureList () ) //Ajout des vignettes des textures
                {
                    Texture2D thumbnail = tex.GetThumbnail ();
                    nameThumbs[textIndex] = tex.GetText(PlayerPrefs.GetString("language"));

                    if (thumbnail != null)
                        thumbnails[textIndex++] = thumbnail;
                    else
                        thumbnails[textIndex++] = Resources.Load("thumbnails/noThumbs",typeof(Texture2D)) as Texture2D;
                }

                /*GUIGridV2*/GUIUpperList thumbGrid = new /*GUIGridV2*/GUIUpperList (1,x, TextManager.GetText(module.GetModuleType ()), "outilOn", "outilOff", this);
                x++;
                thumbGrid.setImgContent (thumbnails, nameThumbs, null, null);
                mapsConfig.addSubItem (thumbGrid);
            }
        }

        //Ajout au rootNode
        if(modules.GetStandardModuleList().Count > 0)
            Root.addSubItem(mapsConfig);

        //Func. speciales

        components =  obj2config.GetComponent<ObjData>().getSpecFcns();
        bool bspecFunction = false;

        for(int i=0; i<components.Length;i++)
        {
            Object comp = components[i];

            if (comp.GetType().ToString().StartsWith("Function_"))
            {

                Function_OS3D funct = (Function_OS3D)comp;
                /*if(funct.GetFunctionName() == "Reglage plage"){
                    GUIItemV2 guiItem = new GUIItemV2(2,i+1,TextManager.GetText(funct.GetFunctionParameterName()),"FunctionOn","FunctionOff",this);
                    funct.setGUIItem(guiItem);
                    Root.addSubItem(guiItem);
                }else{*/
                    GUIItemV2 guiItem = new GUIItemV2(2,i+1,TextManager.GetText(funct.GetFunctionParameterName()),"outilOn","outilOff",this);
                    funct.setGUIItem(guiItem);

                    specFunctions.addSubItem(guiItem);
                    bspecFunction = true;
                //}
         	}
            if (comp.GetType().ToString().StartsWith("FunctionAlt1_"))
            {
                Function_OS3D funct = (Function_OS3D)comp;
                GUIItemV2 guiItem = new GUIItemV2(2,i+1,TextManager.GetText(funct.GetFunctionParameterName()),"outilOn","outilOff",this);
                funct.setGUIItem(guiItem);
                specFunctions.addSubItem(guiItem);
                bspecFunction = true;
         	}
            if (comp.GetType().ToString().StartsWith("FunctionConf_"))
            {
                Function_OS3D funct = (Function_OS3D)comp;
                GUIItemV2 guiItem = new GUIItemV2(0,i+1,TextManager.GetText(funct.GetFunctionParameterName()),"menuOn","menuOff",this,true);
                funct.setGUIItem(guiItem);

                //specFunctions.addSubItem(guiItem);
                //bspecFunction = true;

                Root.addSubItem(guiItem);
         	}
           	}

        //Ajout au rootNode
           	if(bspecFunction)
           	{
            Root.addSubItem(specFunctions);
        }

        showMenu = true;
    }
Example #5
0
    public void CreateGui()
    {
        //Debug.Log("Creation de la GUI START");
        //NEW INTERFACE-------------------------
        //Title = new GUIItemV2(-1,-1,TextManager.GetText("GUIStart.Title"),"title","title",this);
        //Root = new GUIItemV2 (-1,-1, "Root", "", "", this);

        GUIItemV2 pjt = new GUIItemV2(0,1,TextManager.GetText("GUIStart.NewProject"),"menuProjOn","menuProjOff",this);

        #if UNITY_IPHONE && !UNITY_EDITOR
        if(m_authPhotoPerso)
        {
            pjt.addSubItem (new GUIItemV2 (1,1, TextManager.GetText("GUIStart.TakePicture"), "menuOn", "menuOff", this));

            if(usefullData._edition == usefullData.OSedition.Full)
            {
                pjt.addSubItem (new GUIItemV2 (1,2,TextManager.GetText("GUIStart.LoadPicture"), "menuOn", "menuOff", this));
            }
        }
        #elif UNITY_ANDROID && !UNITY_EDITOR
        if(m_authPhotoPerso)
        {
            pjt.addSubItem (new GUIItemV2 (1,3, TextManager.GetText("GUIStart.TakePicture"), "menuOn", "menuOff", this));

            if(usefullData._edition == usefullData.OSedition.Full)
            {
                pjt.addSubItem (new GUIItemV2 (1,4,TextManager.GetText("GUIStart.LoadPicture"), "menuOn", "menuOff", this));
            }
        }
        #else
        if(m_authPhotoPerso && usefullData._edition == usefullData.OSedition.Full)
        {
            pjt.addSubItem (new GUIItemV2 (1,5, TextManager.GetText("GUIStart.LoadPicture"), "menuOn", "menuOff", this));
        }
        #endif

        _itemPhotoExample = new GUIItemV2 (1,6, TextManager.GetText("GUIStart.ExamplePicture"), "menuOn", "menuOff", this);
        pjt.addSubItem (_itemPhotoExample);
        GetRoot().addSubItem(pjt);

        if(m_authClientsFile)
        {
            GetRoot().addSubItem (new GUIItemV2 (0,0, TextManager.GetText("GUIStart.Dossiers"), "menuFilesOn", "menuFilesOff", this));
        }
        /*
        #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IPHONE
        _itemUpdate = new GUIItemV2 (0,6, TextManager.GetText("GUIStart.UpdateDispo"), "alertOn", "alertOff", this);
        GetRoot().addSubItem (_itemUpdate);
        #endif*/

        //menu Parametres
        GUIItemV2 param = new GUIItemV2(0,10,TextManager.GetText("GUIMenuRight.Software"),"menuSoftOn","menuSoftOff",this);

        //menu touch windows
        /*
        #if UNITY_STANDALONE_WIN
        if(PC.In.TouchSupported()){
        int touchpref=PlayerPrefs.GetInt("win8TouchEnable",1);
        _btnSwitchTouch = new GUICheckbox(1,7,
            TextManager.GetText("GUIStart.TouchInterface"),"outilOn","outilOff",this);
        if(touchpref==1){
            ((GUICheckbox)_btnSwitchTouch).SetValue (true);
            }
        else{
            ((GUICheckbox)_btnSwitchTouch).SetValue (false);
            PC.In=MouseInput.GetInstance();
            }
                param.addSubItem(_btnSwitchTouch);
        }

        #endif
        */
        //SOUS MENU langues
        param.addSubItem( new GUIItemV2(1,5,TextManager.GetText("GUIMenuRight.Historic"),"outilOn","outilOff",this));
        GUIItemV2 rgSubMenuLanguage = new GUIItemV2(1,1,TextManager.GetText("GUIMenuRight.Language"),"outilOn","outilOff",this);//2

        param.addSubItem(rgSubMenuLanguage);
        param.addSubItem( new GUIItemV2(1,2,TextManager.GetText("GUIMenuRight.apropos"),"outilOn","outilOff",this));

        /*_btnSwitchAidePopup = new GUICheckbox(1,3,
                                             TextManager.GetText("GUIStart.HelpPopup"),"outilOn","outilOff",this);
        ((GUICheckbox)_btnSwitchAidePopup).SetValue (true);
        if(PlayerPrefs.HasKey("HelpPopup"))
            if (PlayerPrefs.GetInt("HelpPopup")==0)
                ((GUICheckbox)_btnSwitchAidePopup).SetValue (false);
        param.addSubItem(_btnSwitchAidePopup);*/

        #if UNITY_IPHONE
        param.addSubItem( new GUIItemV2(1,4,TextManager.GetText("GUIMenuRight.ContactUs"),"outilOn","outilOff",this));
        #endif

        param.addSubItem( new GUIItemV2(1,0,TextManager.GetText("GUIMenuRight.Deactivate"),"outilOn","outilOff",this));

        GetRoot().addSubItem (param);

        #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IPHONE
        _itemUpdate = new GUIItemV2 (0,11, TextManager.GetText("GUIStart.UpdateDispo"), "alertOff", "alertOff", this);
        GetRoot().addSubItem (_itemUpdate);
        #endif

        _itemQuit = new GUIItemV2(0, 9, TextManager.GetText("GUIStart.Exit"), "menuQuitOn", "menuQuitOff", this);
        GetRoot().addSubItem(_itemQuit);
    }
Example #6
0
    // Use this for initialization
    void Start()
    {
        _stairMenu = new GUIItemV2 (0, 0, "Stair", "sousMenuOn", "sousMenuOff", this);
        _stairModelList = new GUIUpperList (1, 0, TextManager.GetText("stair"), "sousMenuOn", "sousMenuOff", this);

        _stairMenu.addSubItem (_stairModelList);
        enabled = false;
    }
Example #7
0
 void OnEnable()
 {
     _root = new GUIItemV2(-1, -1, "Root", "", "", this);
     _root.addSubItem (_stairMenu);
 }
Example #8
0
    public void CreateGui()
    {
        // menu niveau
        GUIItemV2 edition = new GUIItemV2 (0, 0, TextManager.GetText("PoolDesigner.Edit"), "leftOutilOn", "leftOutilOff", this, true);
        GUIItemV2 snap = new GUIItemV2 (0, 1, TextManager.GetText("PoolDesigner.Snap"), "leftOutilOn", "leftOutilOff", this, true);
        GUIItemV2 plan = new GUIItemV2 (0, 2, TextManager.GetText("PoolDesigner.Plan"), "leftOutilOn", "leftOutilOff", this, true);
        GUIItemV2 img = new GUIItemV2 (0, 5, TextManager.GetText("PoolDesigner.Image"), "leftOutilOn", "leftOutilOff", this, true);
        GUIItemV2 cotation = new GUIItemV2 (0, 6, TextManager.GetText("PoolDesigner.Cotation"), "leftOutilOn", "leftOutilOff", this, true);

        // snap
        _alignedSnapping = new GUICheckbox (1, 0, TextManager.GetText("PoolDesigner.AlignedSnap"), "leftOutilOn", "leftOutilOff", this);
        _alignedSnapping.SetValue (true);

        _angleSnapping = new GUICheckbox (1, 1, TextManager.GetText("PoolDesigner.AngleSnap"), "leftOutilOn", "leftOutilOff", this);

        snap.addSubItem (_alignedSnapping);
        //snap.addSubItem (_angleSnapping);

        // cotation
        _squareCotation = new GUICheckbox (1, 2, TextManager.GetText("PoolDesigner.SquareCotation"), "leftOutilOn", "leftOutilOff", this);

        _edgeCotation = new GUICheckbox (1, 3, TextManager.GetText("PoolDesigner.EdgeCotation"), "leftOutilOn", "leftOutilOff", this);
        _edgeCotation.SetValue (true);

        cotation.addSubItem (_squareCotation);
        cotation.addSubItem (_edgeCotation);

        //		GUIItemV2 zoomToPoly = new GUIItemV2 (1, 2, TextManager.GetText("PoolDesigner.ZoomToPoly"), "leftOutilOn", "leftOutilOff", this);
        //plan.addSubItem (zoomToPoly);

        GUIItemMultiBtn validCancelReset = new GUIItemMultiBtn (0, "multi_bg", "", "", this, 20, true);

        GUIAutoItem clear = new GUIAutoItem (1, "", "clear", "clear", this);
        clear.doEvent += Clear;
        validCancelReset.addSubItem (clear);

        GUIAutoItem reset = new GUIAutoItem (1, "", "reset", "reset", this);
        reset.doEvent += Reset;
        validCancelReset.addSubItem (reset);

        GUIAutoItem valid = new GUIAutoItem (1, "", "valid", "valid", this);
        valid.doEvent += Validate;
        validCancelReset.addSubItem (valid);

        _curveSlider = new GUIHSlider (0, 3, "rightOutilOn", "rightOutilOff", this);
        GUIItemV2 delete = new GUIItemV2 (0, 4, TextManager.GetText("PoolDesigner.RemovePoint"), "rightOutilOn", "rightOutilOff", this);

        // menu image niveaux 0
        GUIItemV2 load = new GUIItemV2 (0, 7, TextManager.GetText("PoolDesigner.Image.Load"), "rightOutilOn", "rightOutilOff", this);
        _showHideBackgroundImage = new GUICheckbox (0, 8, TextManager.GetText("PoolDesigner.Image.ShowHide"), "rightOutilOn", "rightOutilOff", this);
        _showHideBackgroundImage.SetValue (true);
        GUIItemV2 scale = new GUIItemV2 (0, 9, TextManager.GetText("PoolDesigner.Image.Scale"), "rightOutilOn", "rightOutilOff", this);
        GUIItemV2 position = new GUIItemV2 (0, 10, TextManager.GetText("PoolDesigner.Image.Move"), "rightOutilOn", "rightOutilOff", this);
        GUIItemV2 removeImg = new GUIItemV2 (0, 11, TextManager.GetText("PoolDesigner.Image.Remove"), "rightOutilOn", "rightOutilOff", this);

        LeftRoot = new GUIItemV2 (-1, -1, "Root", "", "", this);
        LeftRoot.addSubItem (edition);
        LeftRoot.addSubItem (snap);
        LeftRoot.addSubItem (plan);
        LeftRoot.addSubItem (img);
        LeftRoot.addSubItem (cotation);
        LeftRoot.addSubItem (validCancelReset);

        RightRoot = new GUIItemV2 (-1, -1, "Root", "", "", this);
        RightRoot.addSubItem (_curveSlider);
        RightRoot.addSubItem (delete);

        bgImgRoot = new GUIItemV2 (-1, -1, "Root", "", "", this);
        bgImgRoot.addSubItem (load);
        bgImgRoot.addSubItem (_showHideBackgroundImage);
        bgImgRoot.addSubItem (scale);
        bgImgRoot.addSubItem (position);
        bgImgRoot.addSubItem (removeImg);

        LeftTitle = new GUIItemV2 (-1, -1, TextManager.GetText("PoolDesigner.LeftTitle"), "leftTitle", "leftTitle", this);
        RightTitle = new GUIItemV2 (-1, -1, TextManager.GetText("PoolDesigner.RightTitle"), "rightTitle", "rightTitle", this);
        bgImgTitle = new GUIItemV2 (-1, -1, TextManager.GetText("PoolDesigner.Image"), "rightTitle", "rightTitle", this);

        leftMenuGroup = new Rect(leftOff7, 0, 300, UnityEngine.Screen.height);
        rightMenuGroup = new Rect(rightOff7, 0, 300, UnityEngine.Screen.height);
        bgImgMenuGroup = new Rect(bgImgOff7, 0, 300, UnityEngine.Screen.height);

        leftRect = new Rect(leftOff7, UnityEngine.Screen.height / 2 - 200, 260, 420);
        rightRect = new Rect(rightOff7, UnityEngine.Screen.height / 2 - 100, 260, 200);
        bgImgRect = new Rect(bgImgOff7, UnityEngine.Screen.height / 2 - 150, 280, 300);

        LeftRoot.setSelected (0);

        canDisp = true;
    }
Example #9
0
    //-----------------------------------------------------
    public void updateSceneObj()
    {
        if(usefullData._edition == usefullData.OSedition.Lite)	// Do nothing in lite edition (no "scene objects" menu)
            return;

        ArrayList tmpList = new ArrayList();
        string s;
        GUIItemV2 uniques = new GUIItemV2(1,2, TextManager.GetText("GUIMenuLeft.Unique"), "sousMenuOn", "sousMenuOff", this); //onglet regroupant la liste des objets

        if(mainNode.transform.GetChildCount() > 0)
        {
            tmpList.Add(new GUIItemV2(1,0, TextManager.GetText("GUIMenuLeft.All"), "outilOn", "outilOff", this)); // Pour deplacement de toute la scene
            tmpList.Add(new GUIItemV2(1,1, TextManager.GetText("GUIMenuLeft.Several"), "outilOn", "outilOff", this)); // Pour activer la selection par group
            tmpList.Add(uniques);
        }
        int i=0;
        foreach(Transform t in mainNode.transform)
        {
            if(t.name != "_avatar")
            {
        //				s = t.name.Replace("(Clone)","");
                if(t.GetComponent<ObjData>().GetObjectModel() != null)
                {
                    s = t.GetComponent<ObjData>().GetObjectModel().getCategory().GetText(PlayerPrefs.GetString("language"));
                    s = s +" - "+ t.GetComponent<ObjData>().GetObjectModel().GetText(PlayerPrefs.GetString("language"));
                    /*tmpList*/uniques.addSubItem(new GUIItemV2(/*1*/2,i,s,"outilOn","outilOff",this));
                    i++;
                }
                else
                {
                    print ("error !!!");
                }
            }
        }

        sceneObjs.setItems(tmpList);
    }
Example #10
0
    public void CreateMenu(OSLib library)
    {
        _library = library;
        Montage.om.setLibrary(library); // < temporaire, mettre cette ligne ailleur
        //Menu ajout objets
        //GUIItemV2 originalsObj = new GUIItemV2(0,0,TextManager.GetText("GUIMenuLeft.Add"),"menuAddOn","menuAddOff",this);
        int x = 0;

        foreach(OSLibCategory catLvl1 in library.GetCategoryList ())
        {
            if (catLvl1.GetCategoryList ().Count > 0)
            {
                GUIItemV2 typToAdd;
                if(catLvl1.GetText (PlayerPrefs.GetString("language")) == "OneShot 3d")
                {
                    typToAdd = new GUIItemV2(0,x, catLvl1.GetText (PlayerPrefs.GetString("language")), "menuOSOn", "menuOSOff", this);
                }
                else
                {
                    typToAdd = new GUIItemV2(0,x, catLvl1.GetText (PlayerPrefs.GetString("language")), "menuAddOn", "menuAddOff", this);
                }

                _firstCategory[catLvl1.GetBrandId()]=x;
                x++;
                int y = 0;
                foreach(OSLibCategory catLvl2 in catLvl1.GetCategoryList ())
                {
                    _secondCategory[catLvl2.GetBrandId()]=y;

                    GUIUpperList fabToAdd = null;
                    string szparentCategory = catLvl2.GetText (PlayerPrefs.GetString("language") + "_parent");
                    if(szparentCategory != "")
                    {
                        foreach(GUIItemV2 guiItemV2 in listParentCategory)
                        {
                            if(szparentCategory == guiItemV2.m_text)
                            {
                                fabToAdd = new GUIUpperList(1,/*guiItemV2.getSubItemsCount()*/y, catLvl2.GetText (PlayerPrefs.GetString("language")), "sousMenuOn2", "sousMenuOff2", this);
                                guiItemV2.addSubItem(fabToAdd);
                                break;
                            }
                        }

                        if(fabToAdd == null)
                        {
                            GUIItemV2 parent = new GUIItemV2(1,listParentCategory.Count, szparentCategory,
                                                             "sousMenuOn", "sousMenuOff", this);

                            fabToAdd = new GUIUpperList(1,y, catLvl2.GetText (PlayerPrefs.GetString("language")), "sousMenuOn2", "sousMenuOff2", this);

                            parent.addSubItem(fabToAdd);
                            typToAdd.addSubItem(parent);

                            listParentCategory.Add(parent);
                        }
                    }
                    else
                    {
                        fabToAdd = new GUIUpperList(1,y, catLvl2.GetText (PlayerPrefs.GetString("language")), "sousMenuOn2", "sousMenuOff2", this);
                        typToAdd.addSubItem(fabToAdd);
                    }

                    y++;

                    int size = catLvl2.GetObjectList ().Count;
                    int numberPerPage = 24;
                    //Screen.currentResolution;

                    #if UNITY_IPHONE
                        numberPerPage = 9;
                    #else

                    if(Screen.currentResolution.width/Screen.currentResolution.height == 1.25f)
                        numberPerPage = 25;
                    else if(Screen.currentResolution.width/Screen.currentResolution.height == 1.6f)
                        numberPerPage = 24;
                    else
                        numberPerPage = 24;
                    #endif

                    if( size % numberPerPage != 0)
                    {
                        size = (catLvl2.GetObjectList ().Count/numberPerPage)*numberPerPage + numberPerPage;
                    }

                    Texture2D[] tmpTexs = new Texture2D[size];
                    string[] tmpTexts = new string[size];
                    bool[] tmpCustomizables = new bool[size];
                    bool[] tmpBrands = new bool[size];

                    int i = 0;
                    foreach(OSLibObject obj in catLvl2.GetObjectList ())
                    {
                        // load texture
                        Texture2D tmp = obj.GetThumbnail ();//Resources.Load (obj.GetThumbnailPath ());
                        if(tmp == null)
                            tmp =  Resources.Load ("thumbnails/noThumbs", typeof(Texture2D)) as Texture2D;
                        if(obj==null)
                            Debug.Log("Obj null");
                        if (obj.GetDefaultText ()==null)
                            Debug.Log("Obj null");
        //						tmp.name = obj.GetDefaultText ();
                        tmpTexts[i] = obj.GetText(PlayerPrefs.GetString("language"));
                        tmpTexs[i] = tmp;
                        tmpCustomizables[i] = obj.GetModules().GetStandardModuleList().Count > 0;
                        tmpBrands[i] = obj.IsBrandObject();
                        //print (tmpTexts[i]);

                        ++i;

                    }

                    fabToAdd.m_ctxPanelConfig = m_ctxPanelID_1;
                    fabToAdd.m_ctxPanelBrand = m_ctxPanelID_2;
                    fabToAdd.setImgContent(tmpTexs,tmpTexts, tmpCustomizables, tmpBrands);

                }

                Root.addSubItem(typToAdd);

            }

            if (catLvl1.GetObjectList ().Count > 0)
            {
                GUIUpperList fabToAdd = new GUIUpperList(0,x, catLvl1.GetDefaultText (), "sousMenuOn", "sousMenuOff", this);
                x++;

                Texture2D[] tmpTexs = new Texture2D[catLvl1.GetObjectList ().Count];
                int i = 0;
                foreach(OSLibObject obj in catLvl1.GetObjectList ())
                {
                    // load texture
                    Texture2D tmp = obj.GetThumbnail ();
                    if(tmp == null)
                        tmp =  Resources.Load ("thumbnails/noThumbs",typeof(Texture2D)) as Texture2D;

                    tmp.name = obj.GetText(PlayerPrefs.GetString("language"));// obj.GetDefaultText ();
                    tmpTexs[i] = (Texture2D)tmp;

                    ++i;
                }

                fabToAdd.setImgContent(tmpTexs);
                Root.addSubItem(fabToAdd);

            }

        }

        //Root.addSubItem(originalsObj);
        //print (x);
        if(usefullData._edition != usefullData.OSedition.Lite)
        {
            //Menu objets present dans la scene (sauf en édition lite)
            sceneObjs = new GUIItemV2(0,++x,TextManager.GetText("GUIMenuLeft.Select"),"menuSceneOn","menuSceneOff",this);
            Root.addSubItem(sceneObjs);
        }

        sceneObjs.SetEnableUI(GameObject.Find("MainNode").GetComponent<ObjBehavGlobal>().getNumberObjects() > 0);

        ResetMenu();
    }
Example #11
0
    public void CreateGui()
    {
        //Title = new GUIItemV2(-1,-1,TextManager.GetText("GUIMenuRight.Parameters"),"title","title",this);

        menuGroup = new Rect(m_off7,0,320,Screen.height);
        m_off7 = Screen.width;

        //MENUS
        GUIItemV2 rg = null;
        GUIItemV2 upgd = null;

        if(usefullData._edition == usefullData.OSedition.Full)
        {
            //Reglage grille
            rg = _3DItem = new GUIItemV2(_mMenu,_mConfGrnd,TextManager.GetText("GUIMenuRight.GroundConfiguration"),"menuSolOn","menuSolOff",this);
            //Gomme gazon
            upgd = new GUIItemV2(_mMenu,_mUpgrade,TextManager.GetText("GUIMenuRight.improvements"),"menuUpgOn","menuUpgOff",this);
        }
        //Ambiance
        GUIItemV2 am = 	new GUIItemV2(_mMenu,_mAtmosphr,TextManager.GetText("GUIMenuRight.Atmosphere"),"menuLiteOn","menuLiteOff",this);
        //Photo de fond
        GUIItemV2 bgImg = new GUIItemV2(_mMenu,_mBgImg,TextManager.GetText("GUIMenuRight.BGImage"),"menuBgOn","menuBgOff",this);
        //Projet
        GUIItemV2 pjt = new GUIItemV2(_mMenu,_mProject,TextManager.GetText("GUIMenuRight.Project"),"menuProjOn","menuProjOff",this);
        //PhotoMontage
        //GUIItemV2 pm = new GUIItemV2(_mMenu,_mAssembly,TextManager.GetText("GUIMenuRight.Assembly"),"menuAssemblyOn","menuAssemblyOff",this);
        //Plugins
        GUIItemV2 pluginsUI = new GUIItemV2(_mMenu,_mPlugins,TextManager.GetText("GUIMenuRight.Plugins"),"menuPlugsOn","menuPlugsOff",this);
        //Accueil (BTN)
        GUIItemV2 wlcm = new GUIItemV2(_mMenu,_mStartMenu,TextManager.GetText("GUIStart.Title"),"menuQuitOn","menuQuitOff",this);

        //----------------------------------------------------

        //Filling Menus
        //Menu reglage de la grille
        if(rg != null)
        {
            //GUIItemV2 avatar = new GUIItemV2(_mSubMenu,6,TextManager.GetText("GUIMenuRight.Avatar"),"sousMenuOn","sousMenuOff",this);
            //_avatarItem = new GUIItemV2(_mTool,1,TextManager.GetText("GUIMenuRight.MoveAvatar"),"outilOn","outilOff",this);
            //_avatarItem.SetEnableUI(false);
            _avatarDisplay = new GUIItemV2(_mSubMenu,6,TextManager.GetText("GUIMenuRight.DisplayAvatar"),"outilOn","outilOff",this);//6
            _avatarDisplay.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            rg.addSubItem(_avatarDisplay);
            //avatar.addSubItem(_avatarItem);
            //rg.addSubItem(avatar);

            _inclinaisonItem = new GUIItemV2(_mSubMenu,0,TextManager.GetText("GUIMenuRight.Inclinaison"),"outilOn","outilOff",this);
            _inclinaisonItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            rg.addSubItem(_inclinaisonItem);//0
            //rg.addSubItem(new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.Echelle"),"outilOn","outilOff",this));//1
            //rg.addSubItem( new GUIItemV2(/*_mTool*/_mSubMenu,2,TextManager.GetText("GUIMenuRight.Hauteur"),"outilOn","outilOff",this));//1
            //rg.addSubItem(new GUIItemV2(_mSubMenu,8,TextManager.GetText("GUIMenuRight.Rotation"),"outilOn","outilOff",this));//0

        //SOUS MENU AUTRES REGLAGES
        //		GUIItemV2 rgSubMenu = new GUIItemV2(_mSubMenu,2,TextManager.GetText("GUIMenuRight.MoreAdjustment"),"sousMenuOn","sousMenuOff",this);//2
        /*rgSubMenu*/
            _rotationItem = new GUIItemV2(/*_mTool*/_mSubMenu,7,TextManager.GetText("GUIMenuRight.Rotation"),"outilOn","outilOff",this);//7
            _rotationItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            rg.addSubItem(_rotationItem);

            _perspectiveItem = new GUIItemV2(_mSubMenu,3,TextManager.GetText("GUIMenuRight.Perspective"),"outilOn","outilOff",this);//2
            _perspectiveItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            rg.addSubItem(_perspectiveItem);

            _roulisItem = new GUIItemV2(/*_mTool*/_mSubMenu,4,TextManager.GetText("GUIMenuRight.Roulis"),"outilOn","outilOff",this);//3
            _roulisItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            rg.addSubItem(_roulisItem);

            rg.addSubItem( new GUIItemV2(/*_mTool*/_mSubMenu,5,TextManager.GetText("GUIMenuRight.Reset"),"outilOff","outilOff",this));//5
            //		rg.addSubItem(rgSubMenu);
        }

        //Ambiance
        //SousMenu eclairage
        GUIItemV2 lite = new GUIItemV2(_mSubMenu,0,TextManager.GetText("GUIMenuRight.light"),"sousMenuOn","sousMenuOff",this);

        _hourItem = new GUIItemV2(_mTool,0,TextManager.GetText("GUIMenuRight.lightHour"),"outilOn","outilOff",this);//0
        _hourItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
        lite.addSubItem(_hourItem);

        _orientationItem = new GUIItemV2(_mTool,1,TextManager.GetText("GUIMenuRight.lightOrientation"),"outilOn","outilOff",this);//1
        _orientationItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
        lite.addSubItem(_orientationItem);

        _intensityItem = new GUIItemV2(_mTool,2,TextManager.GetText("GUIMenuRight.lightIntensity"),"outilOn","outilOff",this);//2
        _intensityItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
        lite.addSubItem(_intensityItem);

        _guiItemv2Night = new GUIItemV2(_mTool,3,TextManager.GetText("LightPresets.NightMode"),"outilOn","outilOff",this);//3
        lite.addSubItem(_guiItemv2Night);//3

        _guiItemv2Day = new GUIItemV2(_mTool,4,TextManager.GetText("LightPresets.DayMode"),"outilOn","outilOff",this);
        lite.addSubItem(_guiItemv2Day);//4
        _guiItemv2Day.SetEnableUI(false);

        //if(usefullData._edition == usefullData.OSedition.Lite)	// Fonction intensité dans menu "3D" en édition lite
        //	rg.addSubItem( new GUIItemV2(_mSubMenu,9,TextManager.GetText("GUIMenuRight.lightIntensity"),"outilOn","outilOff",this));//2

        //SousMenu Ombres
        //	GUIItemV2 shadows = new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.Shadow"),"sousMenuOn","sousMenuOff",this);
        //	shadows.addSubItem( new GUIItemV2(_mTool,0,TextManager.GetText("GUIMenuRight.Blur"),"outilOn","outilOff",this));//0
        //	shadows.addSubItem( new GUIItemV2(_mTool,1,TextManager.GetText("GUIMenuRight.lightIntensity"),"outilOn","outilOff",this));//1
        //SousMenu Reflexion
        GUIItemV2 reflex = new GUIItemV2(_mSubMenu,2,TextManager.GetText("GUIMenuRight.reflection"),"sousMenuOn","sousMenuOff",this);
        reflex.addSubItem( new GUIItemV2(_mTool,1,TextManager.GetText("GUIMenuRight.ReflectionActivate"),"outilOn","outilOff",this));//1
        reflex.addSubItem( new GUIItemV2(_mTool,0,TextManager.GetText("GUIMenuRight.reflectionIntensity"),"outilOn","outilOff",this));//0
        ((GUIItemV2)reflex.getSubItems()[1]).SetEnableUI(false);
        //SousMenu Presets
        GUIItemV2 Presets = new GUIItemV2(_mSubMenu,3,TextManager.GetText("GUIMenuRight.Preset"),"sousMenuOn","sousMenuOff",this);
        int i =0;
        foreach(LightPresets.Preset p in lc.getPresets())
        {
            Presets.addSubItem(new GUIItemV2(_mTool,i,TextManager.GetText(p.p_name),"outilOn","outilOff",this));
            i++;
        }

        am.addSubItem(lite);//0
        //	am.addSubItem(shadows);//1
        am.addSubItem(reflex);//2
        am.addSubItem(Presets);//3
        //}

        //Gomme gazon
        _gommeItem = new GUIItemV2(_mSubMenu,0,TextManager.GetText("GUIMenuRight.Eraser"),"sousMenuOn","sousMenuOff",this);
        _gazonItem = new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.Grass"),"sousMenuOn","sousMenuOff",this);

        if(!usefullData.lowTechnologie && usefullData._edition == usefullData.OSedition.Full)
        {
            _gommeAddItem = new GUIItemV2(_mTool,0,TextManager.GetText("GUISubTools.erase"),"outilOn","outilOff",this);
            _gommeAddItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            _gommeItem.addSubItem (_gommeAddItem);

            _gommeEraseItem = new GUIItemV2(_mTool,1,TextManager.GetText("GUISubTools.eraseRedo"),"outilOn","outilOff",this);
            _gommeEraseItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            _gommeItem.addSubItem (_gommeEraseItem);

            _gommeItem.addSubItem(new GUIItemV2(_mTool,2,TextManager.GetText("GUISubTools.eraseReinit"),"outilOff","outilOff",this));

            upgd.addSubItem(_gommeItem);

            //---//

            _gazonAddItem = new GUIItemV2(_mTool,0,TextManager.GetText("GUISubTools.grassHelp"),"outilOn","outilOff",this);
            _gazonAddItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            _gazonItem.addSubItem (_gazonAddItem);

            _gazonEraseItem = new GUIItemV2(_mTool,1,TextManager.GetText("GUISubTools.grassRedoHelp"),"outilOn","outilOff",this);
            _gazonEraseItem.setSecondButton("secondButton", "secondButton", "textOutilOn", "textOutilOff");
            _gazonItem.addSubItem (_gazonEraseItem);

            m_gazonMaterial = new GUIItemV2(_mTool,2,TextManager.GetText("GUISubTools.grassMaterial"),"outilOn","outilOff",this);
            m_gazonMaterial.setIcon(GetComponent<GUISubTools>().getCurrentMaterial(), "textOutilOn", "textOutilOff");
            _gazonItem.addSubItem(m_gazonMaterial);

            _gazonItem.addSubItem(new GUIItemV2(_mTool,3,TextManager.GetText("GUISubTools.eraseReinit"),"outilOff","outilOff",this));

            upgd.addSubItem(_gazonItem);

        }

        //Photo de fond
        #if UNITY_IPHONE || UNITY_ANDROID
            bgImg.addSubItem(new GUIItemV2(_mSubMenu,0,TextManager.GetText("GUIMenuRight.TakePhoto"),"outilOn","outilOff",this));//PRENDRE PHOTO
        #endif
        if(usefullData._edition == usefullData.OSedition.Full)
        {
            bgImg.addSubItem(new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.LoadImage"),"outilOn","outilOff",this));//IMPORTER PHOTO
        }
        bgImg.addSubItem(new GUIItemV2(_mSubMenu,2,TextManager.GetText("GUIMenuRight.Phototech"),"outilOn","outilOff",this));//EXAMPLE PHOTO

        //Projet
        //pjt.addSubItem(new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.newProject"),"outilOn","outilOff",this));
        pjt.addSubItem(new GUIItemV2(_mSubMenu,0,TextManager.GetText("GUIMenuRight.saveProject"),"outilOn","outilOff",this));
        #if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
        pjt.addSubItem(new GUIItemV2(_mSubMenu,1,TextManager.GetText("GUIMenuRight.ExportProject"),"outilOn","outilOff",this));
        #elif UNITY_IPHONE || UNITY_ANDROID
        pjt.addSubItem(new GUIItemV2(_mSubMenu,3,TextManager.GetText("GUIMenuRight.SendProject"),"outilOn","outilOff",this));
        #endif

        //Plugins
        //Récupération des plugins
        _pluginsOS3D = new ArrayList();
        GameObject plugs = GameObject.Find("Plugins");
        foreach(Component cp in plugs.GetComponents<MonoBehaviour>())
        {
            if(cp.GetType().GetInterface("PluginsOS3D")!= null)
            {
                if(((PluginsOS3D)cp).isAuthorized())
                {
                    _pluginsOS3D.Add(cp);
                }

            }
        }
        //---
        if(_pluginsOS3D.Count > 0)
        {
            i = 0;
            foreach(Component plug in _pluginsOS3D)
            {
                string nm = ((PluginsOS3D)plug).GetPluginName();
                pluginsUI.addSubItem( new GUIItemV2(_mTool,i,nm,"outilOn","outilOff",this));
                i++;
            }
        }

        //PhotoMontage
        #if UNITY_IPHONE || UNITY_ANDROID
        pjt.addSubItem(new GUIItemV2(_mSubMenu,4,TextManager.GetText("GUIMenuRight.saveImage"),"outilOn","outilOff",this));//SAUVER IMAGE
        pjt.addSubItem(new GUIItemV2(_mSubMenu,5,TextManager.GetText("GUIMenuRight.loadImage"),"outilOn","outilOff",this));//ENVOYER IMAGE
        #else
        //PC OSX
        pjt.addSubItem(new GUIItemV2(_mSubMenu,2,TextManager.GetText("GUIMenuRight.saveImage"),"outilOn","outilOff",this));//SAUVER IMAGE
        #endif

        //----------------------------------------------------

        //Ajout au root node
        GetRoot().addSubItem(rg);

        if(usefullData._edition != usefullData.OSedition.Lite)	// Pas de réglages d'ambiance en édition Lite
            GetRoot().addSubItem(am);

        if(m_authUpgrade)
        {
            if(!usefullData.lowTechnologie && usefullData._edition == usefullData.OSedition.Full)
            {
                GetRoot().addSubItem(upgd);
            }
        }
        GetRoot().addSubItem(bgImg);
        GetRoot().addSubItem(pjt);

        /*if(m_authSaveSendImg)
        {
            GetRoot().addSubItem(pm);
        }*/
        if(_pluginsOS3D.Count > 0)
        {
            GetRoot().addSubItem(pluginsUI);
        }
        GetRoot().addSubItem(wlcm);
    }