// Use this for initialization
    protected void start()
    {
        _SceneManager_Script = GameObject.Find ("SceneManager").GetComponent<SceneManager_Script> ();
        _select_Object_Script = GameObject.Find ("SceneManager").GetComponent<Select_Object_Script> ();
        _lastMousePos = Input.mousePosition;

        _saveColor = transform.GetComponent<Renderer> ().material.color;
        _menuNum = 0;
        lightIsActiv = true;
        _blockMove = false;
    }
예제 #2
0
 // Use this for initialization
 protected void start()
 {
     _select_Object_Script = GameObject.Find ("SceneManager").GetComponent<Select_Object_Script> ();
 }
    // Use this for initialization
    public void Start()
    {
        _pass = true;
        _Wall_Main = Wall_Tab[0];
        _Wall_Left = Wall_Tab[1];
        _Wall_Right = Wall_Tab[2];
        _Wall_Behind  = Wall_Tab[3];
        _Enseigne = transform.FindChild ("Enseigne").gameObject;
        _Reserve = transform.FindChild ("Reserve").gameObject;
        //_Door = transform.FindChild ("Door").gameObject;

        _longueur = MySingleton.Instance._length;
        _largeur = MySingleton.Instance._width;

        _reserveLargeur = 1;
        _reserveLongueur = 1;

        if (_largeur == 0) {
            _largeur = 3;
            MySingleton.Instance._length = 3;
        }
        if (_longueur == 0){
            _longueur = 4;
            MySingleton.Instance._width = 4;
        }

        _lastValueLongueur = _longueur;
        _lastValueLargeur = _largeur;
        _lastValueEnseigne = 3;
        _lastValueLongueurReserve = 1;
        _lastValueLargeurReserve = 1;

        CreateAlutri(3);

        Wall_Tab_Script = new Cloison_Script[4];

        for(int i = 0;i < 4; i++)
            Wall_Tab_Script [i] = Wall_Tab [i].GetComponent<Cloison_Script> ();

        _largeurTxt.text = "Largeur                  " + _largeur+"m";
        _longueurTxt.text = "Longueur               " + _longueur+"m";

        select_Script = GetComponent<Select_Object_Script>();
        _lightManager_Script = GameObject.Find ("LightManager").GetComponent<LightManager_Script>();
        _Enseigne.SetActive(true);
        setIsCarre(false);
        _Enseigne.SetActive(false);
    }
    public void OnExternalDragEnd(Texture2D aTexture)
    {
        if(selectScript == null)
        {
            selectScript = GameObject.Find ("SceneManager").GetComponent<Select_Object_Script> ();
        }

        selectScript.SelectObjectViaMenu(gameObject);
        selectScript.DeselectMenu ();

        if (selectScript._select_GO.name.StartsWith("Decal"))
        {
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(5).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(1).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(2).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(3).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.WhiteTextMenu(selectScript.MainMenu.transform.GetChild(4).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(0).transform.GetChild(0).GetComponent<Text>());
            selectScript.SideMenu.SetActive(true);
            selectScript.SideMenu.transform.GetChild(2).gameObject.SetActive(true);

            selectScript.SecondMenu.SetActive(true);
            selectScript.SecondMenu.transform.GetChild(0).gameObject.SetActive(true);

            selectScript.PrixDetail.SetActive(true);
            selectScript.OK.SetActive(true);
            selectScript.Surface.SetActive(false);
        }
        else if (selectScript._select_GO.name.StartsWith("Enseigne"))
        {
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(5).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(1).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(4).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(3).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.WhiteTextMenu(selectScript.MainMenu.transform.GetChild(2).transform.GetChild(0).GetComponent<Text>());
            selectScript._SceneManager_Script.GriserTextMenu(selectScript.MainMenu.transform.GetChild(0).transform.GetChild(0).GetComponent<Text>());
            selectScript.SecondMenu.SetActive(true);
            selectScript.SecondMenu.transform.GetChild(2).gameObject.SetActive(true);
            selectScript.SideMenu.SetActive(true);
            selectScript.SideMenu.transform.GetChild(5).gameObject.SetActive(true);

            selectScript.PrixDetail.SetActive(true);
            selectScript.OK.SetActive(true);
            selectScript.Surface.SetActive(false);
        }

        GetComponent<Decal_Script>().ResetPosition();
        if (name.StartsWith("Decal"))
            GetComponent<Decal_Script>()._scale = 3.0f;
        else
            GetComponent<Decal_Script>()._scale = 1.0f;
        GetComponent<Decal_Script>()._rotation = 180.0f;

        if (name.StartsWith("Decal"))
            menuSide.transform.GetChild(2).GetComponent<Slider>().value = 3.0f;
        else
            menuSide.transform.GetChild(2).GetComponent<Slider>().value = 1.0f;

        menuSide.transform.GetChild(3).GetComponent<Slider>().value = 180;

        Decal_Script decal_Script = GetComponent<Decal_Script>();

        int[] tab = new int[2];
        print (""+aTexture.width+ "   "+aTexture.height);
        tab[0] = aTexture.width;
        tab[1] = aTexture.height;
        Simplify(tab);
        float ratio = (float)tab[0]/(float)tab[1];
        print (""+ratio);

        decal_Script._ratioX = ratio;
        decal_Script._ratioY = 1;
        if (name.StartsWith("Decal"))
        {
            menuSide.transform.GetChild(2).GetComponent<Slider>().value = 3.0f;
            transform.localScale = new Vector3(ratio * 3.0f, 3.0f, 1f);
        }
        else
        {
            menuSide.transform.GetChild(2).GetComponent<Slider>().value = 1.0f;
            transform.localScale = new Vector3(ratio, 1.0f, 1f);
        }

        gameObject.GetComponent<Renderer>().material.mainTexture = aTexture;
        // what we receive is a newly instatiated texture,
        // you may want to clean up the previous texture
        //transform.localScale = dftScale;
        isDraging = false;
        //_dropOnUnityCtrl = GameObject.Find ("DropOnUnity").GetComponent<DropOnUnityCtrl> ();
        //_dropOnUnityCtrl._chargementTXT.gameObject.SetActive (false);

        selectScript.ActivAideDeplacerVisuel ();
        selectScript.AideMultiFace.SetActive (false);
        selectScript.AideMultiFace2.SetActive (false);
        selectScript.AideGlisserDeposer.SetActive (false);
    }
    void Start()
    {
        isDraging = false;
        dftScale = transform.localScale;

        selectScript = GameObject.Find ("SceneManager").GetComponent<Select_Object_Script> ();
    }
 // Use this for initialization
 void Start()
 {
     _sceneManager_Script = GameObject.Find ("SceneManager").GetComponent<SceneManager_Script>();
     _select_Object_Script = GameObject.Find ("SceneManager").GetComponent<Select_Object_Script>();
 }