// Use this for initialization void Start () { _oldMaterial = new Hashtable(); mainNode = GameObject.Find("MainNode"); mainScene = GameObject.Find("MainScene"); camPivot = GameObject.Find("camPivot"); rotationbtn = new animatedGUI (0.02f, animatedGUI.TypeOfGUI.repeatButton); rotationbtn.loadFrom ("AnimatedBtns/rotationBtn"); mainCamera = Camera.main; rotateBG.width = UIRotate; rotateBG.height = UIRotate; UIbackground = new Rect (/*Screen.width - (1.1f*UIRotate)*/0, (Screen.height/2)- ((1.1f*UIRotate)/2), (1.1f*UIRotate), (1.1f*UIRotate)); _iosShadows = GameObject.Find("iosShadows"); hud = mainScene.GetComponent<GUIMenuMain>(); _imgMgr = GameObject.Find("backgroundImage").GetComponent<BgImgManager>(); m_rotateAllInit = false; m_moveStart = false; // GameObject gameobjet = GameObject.Find("mainCam"); // if(gameobjet!=null) // _mode2D = (MonoBehaviour) gameobjet.transform.GetComponent("mode2D"); }
//----------------------------------------------------- void Start() { GameObject GUITexLoupe = GameObject.Find("Background/loupe/GUITexLoupe"); _loupeGUI = GUITexLoupe.GetComponent<LoupeGUI>(); if(_loupeGUI!=null) _loupeGUI.SetInvert(m_invert); _GUIMenuMain = GameObject.Find("MainScene").GetComponent<GUIMenuMain>(); base.StartMouseTool(); if(m_grassNode == null) Debug.LogError(DEBUGTAG+"Grass Node" +PC.MISSING_REF); if(m_eraserNode == null) Debug.LogError(DEBUGTAG+"Eraser Node"+PC.MISSING_REF); if(m_mainCam == null) Debug.LogError(DEBUGTAG+"Main Camera"+PC.MISSING_REF); if(m_mainScene == null) Debug.LogError(DEBUGTAG+"Main Scene" +PC.MISSING_REF); if(m_style == null) Debug.LogError(DEBUGTAG+"GUI style " +PC.MISSING_REF); m_pleaseWaitUI = m_mainScene.GetComponent<PleaseWaitUI>(); if(m_pleaseWaitUI == null) Debug.LogError("Script PleaseWaitUI non trouve"); //m_guiZones = new List<Rect>(); // initialisation dans AddGuiZone() car Start est appelé après // m_cancelButtonRect = // de même pour m_cancelButtonRect m_lastClickTime = 0; m_clicked = false; m_loupeActive = false; m_loupeClickTime = 0; m_loupeTex = new Texture2D(64, 64, TextureFormat.RGB24, false); m_loupeGUI = GUITexLoupe.GetComponent<GUITexture>(); m_loupeRenderTex = null; m_loupeGUI.texture = m_loupeTex; // m_loupeCam.targetTexture = m_loupeRenderTex; m_stickBd = 16; // m_stickX = -1; // m_stickY = -1; // Outil à appeler après le remplissage du polygone, et éventuels paramètres m_tool = (m_tool == GUIEditTools.EditTool.None)? GUIEditTools.EditTool.Eraser : m_tool; // On utilise la gomme par défaut // -- GUI -- m_cancelRect = new Rect(0f, 0f, m_style.fixedWidth, m_style.fixedHeight); SetGUIrects(); // AddGuiZone(m_cancelRect); m_mainCam.GetComponent<Mode2D>().enabled = false; m_mainScene.GetComponent<HelpPanel>().enabled = false; }