Exemplo n.º 1
0
    public ArrayList getConfig()
    {
        ArrayList config = new ArrayList();

        int nb = 0;
        foreach(Transform t in transform)
        {
            if(t.GetComponent<AABBOutlineResizer>())
            {
                nb ++;
            }
        }
        config.Add(nb);//int

        foreach(Transform t in transform)
        {
            if(t.GetComponent<AABBOutlineResizer>())
            {
                _resizer = t.GetComponent<AABBOutlineResizer>();
                config.Add(t.name);//string
                if(t.gameObject.name != "margelle")
                {
                    config.Add(_resizer.GetDownOffset());// vv Floats vv
                    config.Add(_resizer.GetUpOffset());
                    config.Add(_resizer.GetForwardOffset());
                    config.Add(_resizer.GetBackOffset());
                    config.Add(_resizer.GetRightOffset());
                    config.Add(_resizer.GetLeftOffset());
                }
                config.Add(_resizer.getOffsetRotationUV());
                config.Add(_resizer.getOffsetTileUV());

                if(t.gameObject.name == "plage")
                {
                    config.Add(_resizer.getColorPlage().x);
                    config.Add(_resizer.getColorPlage().y);
                    config.Add(_resizer.getColorPlage().z);
                }
                else if(t.gameObject.name == "margelle")
                {
                    config.Add(_resizer.getColorMargelle().x);
                    config.Add(_resizer.getColorMargelle().y);
                    config.Add(_resizer.getColorMargelle().z);
                }
                else if(t.gameObject.name == "muret")
                {
                    config.Add(_resizer.getColorMuret().x);
                    config.Add(_resizer.getColorMuret().y);
                    config.Add(_resizer.getColorMuret().z);
                }
                config.Add(_resizer.getHueLevel());
                config.Add(_resizer.getSaturation());
            }
        }

        return config;
    }
Exemplo n.º 2
0
    //SAVE/LOAD
    public void save(BinaryWriter buf)
    {
        int nb = 0;
        foreach(Transform t in transform)
        {
            if(t.GetComponent<AABBOutlineResizer>())
            {
                nb ++;
            }
        }
        buf.Write(nb);//int

        foreach(Transform t in transform)
        {
            if(t.GetComponent<AABBOutlineResizer>())
            {
                _resizer = t.GetComponent<AABBOutlineResizer>();
                buf.Write(t.name);//string
                if(t.gameObject.name != "margelle")
                {
                    buf.Write(_resizer.GetDownOffset());// vv Floats vv
                    buf.Write(_resizer.GetUpOffset());
                    buf.Write(_resizer.GetForwardOffset());
                    buf.Write(_resizer.GetBackOffset());
                    buf.Write(_resizer.GetRightOffset());
                    buf.Write(_resizer.GetLeftOffset());
                }
                buf.Write(_resizer.getOffsetRotationUV());
                buf.Write(_resizer.getOffsetTileUV());
                //Debug.Log("ECRITURE TILE : " + _resizer.getOffsetTileUV());
                if(t.gameObject.name == "plage")
                {
                    buf.Write(_resizer.getColorPlage().x);
                    buf.Write(_resizer.getColorPlage().y);
                    buf.Write(_resizer.getColorPlage().z);
                    //Debug.Log("ECRITURE COLORPLAGE  x:" + _resizer.getColorPlage().x + "  y:"+_resizer.getColorPlage().y + "  z:"+_resizer.getColorPlage().z);
                }
                else if(t.gameObject.name == "margelle")
                {
                    buf.Write(_resizer.getColorMargelle().x);
                    buf.Write(_resizer.getColorMargelle().y);
                    buf.Write(_resizer.getColorMargelle().z);
                }
                else if(t.gameObject.name == "muret")
                {
                    buf.Write(_resizer.getColorMuret().x);
                    buf.Write(_resizer.getColorMuret().y);
                    buf.Write(_resizer.getColorMuret().z);
                }
                buf.Write(_resizer.getHueLevel());
                buf.Write(_resizer.getSaturation());
            }
        }
    }