예제 #1
0
    public void StartDraw()
    {
        //Debug.Log("StartDraw");
        if (cs == null)
        {
            //Debug.Log("dc, cs is null");
            cs = GetComponent <CanvasSizer>();
            //Debug.LogFormat("dc, cs is still null: {0}", cs == null);
        }
        tex = cs.GetImage();
        px  = -100;
        py  = -100;
        //data = tex.GetPixels ();
        if (lr != null)
        {
            Destroy(lr.gameObject);
        }

        lr = Instantiate(LinePrefab).GetComponent <LineRenderer> ();
        lr.gameObject.transform.parent           = transform;
        lr.gameObject.transform.localEulerAngles = Vector3.zero;
        lr.gameObject.transform.localPosition    = new Vector3(0, 0.1f, 0);
        lr.gameObject.transform.localScale       = new Vector3(1, 0.1f, 1);
        lr.material.color = DrawColor;
    }
예제 #2
0
 public void Start()
 {
     cs = GetComponent <CanvasSizer>();
     Line.SetActive(false);
 }
예제 #3
0
 private void Start()
 {
     cs = GetComponent <CanvasSizer>();
 }
 // Use this for initialization
 void Awake()
 {
     main = FindObjectOfType <MainController>();
     cs   = GetComponentInChildren <CanvasSizer>();
     SetPlaceText();
 }