示例#1
0
    //is called when the brush size slider is moved
    public void set_brush_size()
    {
        float size = brush_size_slider.GetComponent <Slider>().value;

        (drawing_script.get_tool("brush") as sc_tool_brush).brush_size = (int)size;
        sc_connection_handler.instance.send_brush_size((int)size);
    }
示例#2
0
    private string info_name = "", info_age = "", info_sex = ""; //infos added while saving

    // Start is called before the first frame update
    public void Start()
    {
        color_picker_canvas = sc_canvas.instance.color_picker_canvas;
        gallery_canvas      = sc_canvas.instance.gallery_canvas;
        drawing_canvas      = sc_canvas.instance.drawing_canvas;
        drawing_script      = FindObjectOfType <sc_drawing_handler>();
        gallery_loader      = FindObjectOfType <sc_gallery_loader>();
        color_picker        = FindObjectOfType <sc_color_picker_ui>();
        gallery_ui          = FindObjectOfType <sc_gallery_ui>();
        name_input          = save_dialog.transform.Find("NameInput").GetComponent <InputField>();
        age_input           = save_dialog.transform.Find("AgeInput").GetComponent <InputField>();
        sex_input           = save_dialog.transform.Find("SexDropdown").GetComponent <Dropdown>();
        brush_button.transform.Find("BrushIcon").Find("BrushHead").GetComponent <Image>().color        = drawing_script.default_color;
        bucket_button.transform.Find("BucketIcon").Find("BucketContents").GetComponent <Image>().color = drawing_script.default_color;
        drawing_script.drawing_color = drawing_script.default_color;

        brush_size_slider.GetComponent <Slider>().value = (drawing_script.get_tool("brush") as sc_tool_brush).brush_size;
    }
示例#3
0
 /* This method returns the size of the brush.
  * INPUT: none
  * OUTPUT: int, Size of the brush   */
 public int get_brush_size()
 {
     return((drawing_script.get_tool("brush") as sc_tool_brush).brush_size);
 }