예제 #1
0
 protected virtual void Update()
 {
     if (strokeFilter == null)
     {
         strokeFilter = GetComponent <StrokeFilter>();
         if (strokeFilter != null)
         {
             strokeFilter.OnStrokeModified += UpdateRenderer;
         }
     }
 }
예제 #2
0
파일: Brush.cs 프로젝트: ccdump/Paint-1
        public void Begin()
        {
            _isBrushing = true;

            _curStroke         = new Stroke();
            _lastStrokePoint   = StrokePointFromCurrentState();
            _curStrokeObj      = Instantiate <GameObject>(strokeRendererPrefab.gameObject, outputParent);
            _curStrokeObj.name = "Brush " + this.name + " Stroke " + (++_curStrokeObjIdx);
            //var curStrokeRenderer = _curStrokeObj.GetComponent<StrokeRendererBase>();
            _curStrokeFilter = _curStrokeObj.GetComponent <StrokeFilter>();
            if (_curStrokeFilter == null)
            {
                _curStrokeFilter = _curStrokeObj.AddComponent <StrokeFilter>();
            }
            _curStrokeFilter.stroke = _curStroke;
            AddStrokePoint(_lastStrokePoint);
        }