void Awake() { _montage = GameObject.Find("MainScene").GetComponent<Montage>(); _guistart = GameObject.Find("MainScene").GetComponent<GUIStart>(); _cb = GetComponent<GUIDialogBox>(); _plugPhoto = GameObject.Find("MainScene").GetComponent<PluginPhotoManagerGUI>(); #if UNITY_ANDROID //s'il y à un fichier autosave.cub enregistré, affichage boîte de dialogue proposant de charger cette scène if (PlayerPrefs.GetInt("autosave") == 1) { Debug.Log(" autosave à 1"); string path = usefullData.SavePath + "autosave" + usefullData.SaveNewFileExtention; if (File.Exists(path)) { _guistart.enabled = false; _askAutosave = true; _cb.showMe(true, GUI.depth); _cb.setBtns(TextManager.GetText("GUIMenuRight.Yes"), TextManager.GetText("GUIMenuRight.No")); _cb.setText(TextManager.GetText("GUIMenuRight.AskAutoSave1") + "\n" + TextManager.GetText("GUIMenuRight.AskAutoSave2")); } PlayerPrefs.SetInt("autosave", 0); } #endif }
public static IEnumerator Deactivate(GUIDialogBox cb, bool saveBefore) { if(Application.internetReachability != NetworkReachability.NotReachable) { EncodeToolSet encoder = new EncodeToolSet(); string login = PlayerPrefs.GetString(usefullData.k_logIn); string mdp = PlayerPrefs.GetString(usefullData.k_password); string code = encoder.createSendCode(false,false,int.Parse(login),mdp); WWWForm deactForm = new WWWForm(); deactForm.AddField("ac", code); WWW sender = new WWW(usefullData.DeactivationUrl,deactForm); yield return sender; if(sender.error != null) { Debug.Log("ERROR : "+sender.error); } else { Debug.Log("Deactivation result "+sender.text); usefullData.DeleteLogo(); PlayerPrefs.DeleteAll(); //SetAllowQuit(true); InterProcess.Stop(); #if UNITY_STANDALONE_WIN System.Diagnostics.Process.GetCurrentProcess().Kill(); #else UnityEngine.Application.Quit(); #endif } } else if(saveBefore) { cb.showMe(true,GUI.depth); cb.setBtns(TextManager.GetText("GUIMenuRight.Yes"), TextManager.GetText("GUIMenuRight.No"), TextManager.GetText("GUIMenuRight.Save")); cb.setText(TextManager.GetText("GUIMenuRight.ConnectionFailed")); } }
//----------------------------------------------------- void Start() { if(m_mainCam == null) Debug.LogError(DEBUGTAG+"mainCam"+PC.MISSING_REF); if(m_mode2D == null) Debug.LogError(DEBUGTAG+"mode2D"+PC.MISSING_REF); getListOfSavedFiles (); mainScene = GameObject.Find("MainScene"); mainNode = GameObject.Find ("MainNode"); eraserNode = GameObject.Find ("eraserImages"); grassNode = GameObject.Find ("grassImages"); // -- Rects GUI -- saveBox = new Rect (0f, 0f, 300, 600); loadBox = new Rect (0f, 0f, 300, 600); filesBox = new Rect (0f, 0f, 300, 600); RelocateUI(); if(PlayerPrefs.HasKey(usefullData.k_toLoadPath) && PlayerPrefs.HasKey(usefullData.k_toLoadParams)) { string path = PlayerPrefs.GetString(usefullData.k_toLoadPath); string boolean = PlayerPrefs.GetString(usefullData.k_toLoadParams); if(boolean != "") m_completeLoad = bool.Parse(boolean); if(path != "") { StartCoroutine(load(path,true)); } } getListOfClients(); if(PlayerPrefs.HasKey(usefullData.k_selectedClient)) { string cl = PlayerPrefs.GetString(usefullData.k_selectedClient); if(cl != "") { m_client = cl; for(int i=0;i<m_clients.Length;i++) { if(m_clients[i] == m_client) m_selectedClient = i; } getListOfSavedFiles(); } PlayerPrefs.DeleteKey(usefullData.k_selectedClient); } //ConfirmationBox _cb = GetComponent<GUIDialogBox>(); }
//----------------------------------------------------- void Start() { if(m_mainCam == null) Debug.LogError(DEBUGTAG+"mainCam"+PC.MISSING_REF); if(mBackGrid == null) Debug.LogError(DEBUGTAG+"BackGrid"+PC.MISSING_REF); if(m_eraser == null) Debug.LogError(DEBUGTAG+"Eraser" +PC.MISSING_REF); if(m_grass == null) Debug.LogError(DEBUGTAG+"Grass" +PC.MISSING_REF); // -- Progress bar -- r_loadBarFond = new Rect(162,UnityEngine.Screen.height*0.865f,UnityEngine.Screen.width-162*2,4); // new Rect(162,664,700,4); r_loadBarGrpMv = new Rect(162,UnityEngine.Screen.height*0.865f,0,4); // new Rect(162,664,0,4); r_loadBar = new Rect(0,0,UnityEngine.Screen.width-162*2f,4); // new Rect(0,0,700,4); // -- Loading circle animé -- mLoadingCircle = this.GetComponent<RotatingGUITexture>(); if(mLoadingCircle != null) mLoadingCircle.SetRect(new Rect(UnityEngine.Screen.width-192f, UnityEngine.Screen.height-192f, 128f, 128f)); UnityEngine.Screen.autorotateToPortrait = false; //Marges // margeLft = (5 * UnityEngine.Screen.width) / 32; // margeTop = (4 * UnityEngine.Screen.height) / 24; // margeInterH = (2 * UnityEngine.Screen.width) / 32; // margeInterV = (2 * UnityEngine.Screen.height) / 24; // btnWSize = (10 * UnityEngine.Screen.width) / 32; // btnHSize = (7 * UnityEngine.Screen.height) / 24; //RECTS mButtonBackRect = new Rect(); SetRects(); // uiPos = UnityEngine.Screen.width / 4; ScrollView = new Rect (162, 145, 700, 485); fillPhototheque (); //Confirmation box _cb = GetComponent<GUIDialogBox>(); //Dossier client Loading Override if(PlayerPrefs.HasKey(usefullData.k_toLoadPath) && PlayerPrefs.HasKey(usefullData.k_toLoadParams)) { string path = PlayerPrefs.GetString(usefullData.k_toLoadPath); if(path != "") { started = false; //GetComponent<PleaseWaitUI>().SetDisplayIcon(true); } } /*if(!PlayerPrefs.HasKey("HelpPopup")) { PlayerPrefs.SetInt("HelpPopup", 1); }*/ guiNotificationLicenceExpiration = new GUINotificationLicenceExpiration(); guiNotificationLicenceExpiration.skin = skin; guiNotificationLicenceExpiration.BgTexture = BgTexture_forLicenceExpiration; guiRandomHelpSentence = new GUIRandomHelpSentence(); guiRandomHelpSentence.skin = skin; StartCoroutine(guiRandomHelpSentence.init()); }
//----------------------------------------------------- void Start() { m_objInter=GameObject.Find("mainCam").GetComponent<ObjInteraction>(); if (grassNode==null) Debug.LogError(DEBUGTAG+"grassNode"+PC.MISSING_REF); if (gommeNode==null) Debug.LogError(DEBUGTAG+"gommeNode"+PC.MISSING_REF); if (m_mode2D == null) Debug.LogError(DEBUGTAG+"Mode2D"+PC.MISSING_REF); m_off7 = Screen.width; m_slideTouchEnded = false; // touchOldPos = new Queue<Vector2>(); // touchCount = 0; othersMenu = new ArrayList(); foreach(Component cp in this.GetComponents<MonoBehaviour>()) { if(cp.GetType() != this.GetType() && cp.GetType().GetInterface("GUIInterface")!= null) { othersMenu.Add(cp); } } //shortcuts _camPivot = GameObject.Find("camPivot"); if(_camPivot!=null) sc = _camPivot.GetComponent<SceneControl>(); GameObject lightPivot = GameObject.Find("LightPivot"); if(lightPivot!=null) { lc = lightPivot.GetComponent<LightConfiguration>(); } _lightEffects = GameObject.Find("lightEffects"); if(_lightEffects!=null) { _lightEffectsParentNode = _lightEffects.transform.parent; } interacteur = Camera.main.GetComponent<ObjInteraction>(); _grid = GameObject.Find("grid"); _mainNode = GameObject.Find("MainNode"); _childrenNodes = new ArrayList(); // //CREATION DE LA GUI // CreateGui(); //Before/After c_camCull = Camera.main.cullingMask; // s2hRect = new Rect(Screen.width/2-256,-200,512,200); //ConfirmationBox _cb = GetComponent<GUIDialogBox>(); initLanguages(); if(GameObject.Find("_avatar")) { _avatarControl = GameObject.Find("_avatar").GetComponent<Avatar>(); avatarTransform = GameObject.Find("_avatar").transform; } _pluginPhotoRef = GetComponent<PluginPhotoManagerGUI>(); }
//----------------------------------------------------- void Start() { if((PC.DEBUG && DEBUG) || PC.DEBUGALL) Debug.Log(DEBUGTAG+"Start"); if(m_background == null) Debug.LogError(DEBUGTAG+"Background not set, please set it in the inspector."); // -- Progress bar -- r_loadBarFond = new Rect(162,UnityEngine.Screen.height*0.865f,UnityEngine.Screen.width-162*2,4); // new Rect(162,664,700,4); r_loadBarGrpMv = new Rect(162,UnityEngine.Screen.height*0.865f,0,4); // new Rect(162,664,0,4); r_loadBar = new Rect(0,0,UnityEngine.Screen.width-162*2f,4); // new Rect(0,0,700,4); PlayerPrefs.SetString(usefullData.k_toLoadPath,""); PlayerPrefs.SetString(usefullData.k_toLoadParams,""); PlayerPrefs.SetString(usefullData.k_startBypass,""); //PlayerPrefs.SetString(usefullData.k_selectedClient,""); #if UNITY_IPHONE EtceteraManager.mailComposerFinishedEvent += IOutils.EndMail; #endif m_rootPath = usefullData.SavePath; m_currentPath = m_rootPath; m_projects = new string[0]; gui_cb = GetComponent<GUIDialogBox>(); updateClientList(); arrows = GetComponent<GUIArrows>(); arrows.setDepth(GUI.depth); // -- Rects GUI -- r_group1 = new Rect(); r_fullPanelBG = new Rect(162, 134, 700, 500); r_fullPanel = new Rect(200,150,624,468); r_fullPanelSV = new Rect(0,0,624,468); r_halfPanelLeft = new Rect(162,134+50,350,500-50); r_halfPanelLeftSV = new Rect(0,0,350,500); r_backButton = new Rect(r_halfPanelLeft.x-30, r_halfPanelLeft.y+(r_halfPanelLeft.height-350)/2,30,350); r_halfPanelRight = new Rect(162+350,134,350,500); r_leftPanelArrows = new Rect(); r_fullPanelBGArrows = new Rect(); m_useClientSkin = true; SetRects(); if(PlayerPrefs.HasKey(usefullData.k_selectedClient)) { string cl = PlayerPrefs.GetString(usefullData.k_selectedClient); if(cl != "") { for(int i=0;i<m_clients.Length;i++) { if(m_clients[i] == cl) { id_selectedClient = i; id_selectedProject = -1; cdm = null; m_currentPath = m_rootPath + m_clients[id_selectedClient]; arrows.setArrowsRect(r_leftPanelArrows,"projetUp","projetDwn"); m_useClientSkin = false; updateProjectList(); if(m_projects.Length>0) autoSelect = true; } } } } updateClientList(); }