void SetDrawMessage() { //涂色背景(只做淡入展示) UIHelper.instance.SetImage(GameData.instance.drawBgPathList[GameManager.instance.homeSelectIndex], ImgDrawBg, true); //绘画素材 Sprite s = UIHelper.instance.LoadSprite(GameData.instance.drawBgPathList[GameManager.instance.homeSelectIndex]); mobilePaint.InitializeEverything(s.texture); mobilePaint.SetBrushSize(1); PenScaleSlider.value = 0.5f; ImageScaleSlider.value = 0.5f; AdjustBurshSize(PenScaleSlider.value); joinGuide.AddMobileDrawDelagate(); Invoke("ShowDrawPanel", 0.4f); }
void Update() { // set random paint color mobilePaint.paintColor = new Color(Random.value, Random.value, Random.value, Random.value); // set random brush size mobilePaint.SetBrushSize((int)(Random.value * 64)); // draw random single pixel point mobilePaint.DrawCircle((int)(Random.value * Screen.width), (int)(Random.value * Screen.height)); // random 1 pixel lines mobilePaint.SetBrushSize(1); mobilePaint.DrawLine((int)(Random.value * Screen.width), (int)(Random.value * Screen.height), (int)(Random.value * Screen.width), (int)(Random.value * Screen.height)); // set texture dirty, so it needs to be applied mobilePaint.textureNeedsUpdate = true; }