// Use this for initialization
        void Start()
        {
            // Get reference to resource manager
            m_ResourceManager = Painter3DResourceManager.Instance;

            // Instantiate new example stroke
            m_ExampleStroke = Stroke.GetNewStroke(Painter3DResourceManager.Instance.GetActiveStrokeRenderer(), Painter3DManager.Instance.m_PaintingLayer, strokeSize, Color.gray);
            m_ExampleStroke.transform.SetParent(transform);
            m_ExampleStroke.transform.localPosition = Vector3.zero;

            //m_ExampleStroke.Init(Painter3DResourceManager.Instance.GetActiveStrokeRenderer(), Painter3DManager.Instance.m_PaintingLayer, strokeSize);

            Transform tempBrushTip = new GameObject("Temp brushtip").transform;

            tempBrushTip.SetParent(transform);

            tempBrushTip.localRotation = Quaternion.Euler(0, 0, 90);
            tempBrushTip.localScale    = Vector3.one * strokeSize;

            tempBrushTip.localPosition = -(Vector3.right * m_Length * .5f);

            // Begin stroke
            m_ExampleStroke.BeginStroke(tempBrushTip);

            tempBrushTip.localPosition = (Vector3.right * m_Length * .5f);
            m_ExampleStroke.EndStroke(tempBrushTip);
        }
Beispiel #2
0
 void Awake()
 {
     Instance = this;
 }