Ejemplo n.º 1
0
 //-----------------------------------------------------
 // redimensionnement afin de créer une marge et donc un
 // mini espace de travail autour.
 // Trop compliqué donc abandonné pour l'instant.
 //    public void ResizeImages(float percent)
 //    {
 //        GUITexture child;
 //        Rect       pixIn;
 //        float      subSections = Mathf.Sqrt(transform.GetChildCount());
 //        
 //        for(int i=0; i<transform.GetChildCount(); i++)
 //        {
 //            child = transform.GetChild(i).guiTexture;
 //            pixIn = child.guiTexture.pixelInset;
 //            
 //            pixIn.x += func(i%subSections);
 //            pixIn.y += func2(i-pixIn.x*subSections);
 //            pixIn.width -= 8;//pixIn.width*percent/100;
 //            pixIn.height -= 6;//pixIn.height*percent/100;
 //            
 //            child.guiTexture.pixelInset = pixIn;
 //        }
 //    } // ResizeImages();
 //    
 //    private int func(float x)
 //    {
 //        if(x == 0)
 //            return 16;
 //        else if(x == 1)
 //            return 8;
 //        else if(x == 2)
 //            return 0;
 //        else if(x==3)
 //            return -8;
 //        else
 //            return 0;
 //    }
 //    
 //    private int func2(float x)
 //    {
 //        if(x == 0)
 //            return -6;
 //        else if(x == 1)
 //            return 0;
 //        else if(x == 2)
 //            return 6;
 //        else if(x==3)
 //            return 12;
 //        else
 //            return 0;
 //    }
 //    
 //    //-----------------------------------------------------
 //    public void ResetImages()
 //    {
 //        GUITexture child;
 //        Rect       pixIn;
 //        float      subSections = Mathf.Sqrt(transform.GetChildCount());
 //        float      w = m_guiTexRef.pixelInset.width/transform.GetChildCount();
 //        float      h = m_guiTexRef.pixelInset.height/transform.GetChildCount();
 //        
 //        for(int i=0; i<transform.GetChildCount(); i++)
 //        {
 //            child = transform.GetChild(i).guiTexture;
 //            pixIn = child.guiTexture.pixelInset;
 //            
 //            pixIn.x = i%subSections * w;
 //            pixIn.y = i-i%subSections*subSections * h;
 //            pixIn.width = w;
 //            pixIn.height = h;
 //            
 //            child.guiTexture.pixelInset = pixIn;
 //        }
 //    }
 //-----------------------------------------------------
 public void SetTool(GUIEditTools.EditTool newTool)
 {
     m_tool = newTool;
 }
Ejemplo n.º 2
0
 //-----------------------------------------------------
 public void SetTool(GUIEditTools.EditTool tool)
 {
     m_tool = tool;
 }