public TopicPostRequest(TopicExtended topic) { Name = topic.Name; TimestampStart = topic.TimestampStart; TimestampEnd = topic.TimestampEnd; Ad = topic.Ad; CommunityContributed = topic.CommunityContributed; foreach (Subtopic item in topic.Subtopic) { Subtopics.Add(new SubtopicPostRequest() { Name = item.Name }); } }
private void Awake() { Canvas = GameObject.FindGameObjectWithTag("MainCanvas"); ParentTopic = transform.parent.GetComponentInParent <Topic>(); if (ParentTopic == null) { TurnOn(); } foreach (Transform child in SubTopicsGO.transform) { var topic = child.GetComponentInChildren <Topic>(); if (topic != null) { Subtopics.Add(topic); } } Description.SetActive(false); CM.gameObject.SetActive(false); }