public void Initialize(CommentDisplayManager manager, Transform parent, Comment comment) { this.manager = manager; this.comment = comment; rootRect.SetParent(parent); rootRect.localPosition = new Vector3(comment.X, comment.Y, comment.Z).normalized; colorDefault = Petals.PetalColor(Petals.StringToPetal(comment.Petal)); headerText.text = HeaderFormatter(comment); contentText.text = ContentFormatter(comment); LayoutRebuilder.ForceRebuildLayoutImmediate(rootRect); }
protected override void Awake() { manager = FindObjectOfType <CommentDisplayManager>(); }