// Use this for initialization void Start() { if (this.transform.parent.GetComponent <A_PaintBrush>() == null) { print("[Paint_Brush] doesn't seem to exist or has been moved?"); } else { pB = this.transform.parent.GetComponent <A_PaintBrush>(); } }
//Transform currentBrush; private void OnEnable() { print(Resources.FindObjectsOfTypeAll <A_PaintBrush>()[0].name); paintBrush = Resources.FindObjectsOfTypeAll <A_PaintBrush>()[0].GetComponent <A_PaintBrush>(); paintBrush.onBrushStrokeStart.AddListener(StartingBrushstroke); paintBrush.onBrushStrokeEnd.AddListener(EndingBrushstroke); paintBrushPos = paintBrush.transform.GetChild(1); // currentBrush = this.transform.GetChild(0); //A_PaintBrush.OnBrushStart += StartingBrushstroke; //A_PaintBrush.OnBrushEnd += EndingBrushstroke; }
// Use this for initialization void Start() { if (this.transform.parent.gameObject.GetComponent <A_PaintBrush>() == null) { print("[Paint Brush Script not found"); } pb = this.transform.parent.gameObject.GetComponent <A_PaintBrush>(); lineRenderer = this.GetComponent <LineRenderer>(); pb.helperLineRenderer.SetPosition(0, Vector3.zero); pb.helperLineRenderer.SetPosition(1, Vector3.zero); }
void Awake() { if (PaintBrush == null) { try { PaintBrush = GameObject.Find("[Paint_Brush]"); paintBrush = PaintBrush.GetComponent <A_PaintBrush>(); } catch (Exception e) { print("please attach the [Paint_Brush] object in the inspector"); }; } else { paintBrush = PaintBrush.GetComponent <A_PaintBrush>(); //get raypoint script try { ray = PaintBrush.transform.GetChild(0).GetComponent <RayPointer>(); } catch (Exception e) { print("ray pointer script doesnt exist or has been moved?"); }; } }
private void Awake() { //get paint brush paintBrush = this.transform.parent.GetComponent <A_PaintBrush>(); //line renderer lineRenderer = this.transform.GetChild(0).GetComponent <LineRenderer>(); rayVisible = true; ///tip if (Tip == null) { Tip = this.transform.GetChild(1).gameObject; } }
void Start() { pB = this.transform.parent.GetComponent <A_PaintBrush>(); }