Пример #1
0
 // Changes the size of the brush by 5
 public void IncreaseBrushSize()
 {
     // If the new size is bigger than the maxBrushSize, it won't change size
     if (currentBrushSize <= maxBrushSize - 5)
     {
         currentBrushSize += 5;
         mobilePaint.SetBrushSize(currentBrushSize);
     }
 }
Пример #2
0
        // Changes the size of the brush by 5
        public void IncreaseBrushSize()
        {
            // If the new size is bigger than the maxBrushSize, it won't change size
            if (currentBrushSize <= maxBrushSize - 5 && brushPreviewSize <= maxPreviewSize)
            {
                // Increase brush size
                currentBrushSize += 5;
                mobilePaint.SetBrushSize(currentBrushSize);

                // Increase preview
                brushPreviewSize += 0.05f;
                brushPreview.transform.localScale = new Vector2(brushPreviewSize, brushPreviewSize);
            }
            if (customSize > 0)
            {
                customSize -= 1;
            }
        }
Пример #3
0
        // Start is called before the first frame update
        void Start()
        {
            mobilePaint = PaintManager.mobilePaint;             // Gets reference to mobilePaint through PaintManager

            // Sets the Default Brush Size
            currentBrushSize = 20;
            mobilePaint.SetBrushSize(currentBrushSize);

            timeBeforeClick = timeBetweenClicks;
        }
Пример #4
0
        // Start is called before the first frame update
        void Start()
        {
            mobilePaint = PaintManager.mobilePaint;             // Gets reference to mobilePaint through PaintManager

            // Sets the default Brush Size
            currentBrushSize = 20;
            mobilePaint.SetBrushSize(currentBrushSize);

            // sets the default for brush preview
            brushPreviewSize = 0.3f;
            brushPreview.transform.localScale = new Vector2(brushPreviewSize, brushPreviewSize);

            customSize = 3;
        }
Пример #5
0
		void Start () 
		{
			mobilePaint = PaintManager.mobilePaint; // gets reference to mobilepaint through PaintManager

			if (mobilePaint==null) Debug.LogError("No MobilePaint assigned at "+transform.name, gameObject);

			slider = GetComponent<Slider>();
			if (slider==null) 
			{
				Debug.LogError("No Slider component founded",gameObject);
			}else{
				slider.value = mobilePaint.brushSize;
				slider.onValueChanged.AddListener((value) => { mobilePaint.SetBrushSize((int)value); });
			}
		}
Пример #6
0
        void Start()
        {
            mobilePaint = PaintManager.mobilePaint;             // gets reference to mobilepaint through PaintManager

            if (mobilePaint == null)
            {
                Debug.LogError("No MobilePaint assigned at " + transform.name, gameObject);
            }

            slider = GetComponent <Slider>();
            if (slider == null)
            {
                Debug.LogError("No Slider component founded", gameObject);
            }
            else
            {
                slider.value = mobilePaint.brushSize;
                slider.onValueChanged.AddListener((value) => { mobilePaint.SetBrushSize((int)value); });
            }
        }