private void OnMouseDown() { GameObject speechBubble = SerializeObject.Instance.GetSpeechBubbleSprite; GameObject speechTextUI = SerializeObject.Instance.GetSpeechBubbleText; if (!speechBubble.activeSelf) { speechBubble.SetActive(true); speechBubble.GetComponent <SpeechBubbleMove>().parent = this.gameObject; speechBubble.GetComponent <SpeechBubbleMove>().ChangeSpeechBubblePosition(); speechTextUI.GetComponent <Text>().text = SpeechBubbleTextCreate.ChildAttributeToText_Parent(this.gameObject.transform.parent .GetComponent <OneChildAttribute>().childAttribute); } else { speechBubble.SetActive(false); speechBubble.GetComponent <SpeechBubbleMove>().parent = null; } }
private void OnDragEnd() { if (isExitChildBackSprite) { GameObject parent = this.gameObject.GetComponent <ChildInParentOwnParentObject>().parentObj; parent.SetActive(true); GameObject speechBubble = SerializeObject.Instance.GetSpeechBubbleSprite; speechBubble.SetActive(true); speechBubble.GetComponent <SpeechBubbleMove>().parent = parent; speechBubble.GetComponent <SpeechBubbleMove>().ChangeSpeechBubblePosition(); GameObject speechBubbleText = SerializeObject.Instance.GetSpeechBubbleText; speechBubbleText.GetComponent <Text>().text = SpeechBubbleTextCreate.ChildAttributeToText_Parent(parent.GetComponent <OneChildAttribute>() .childAttribute); parent.transform.position = this.gameObject.transform.position; this.gameObject.transform.localPosition = defaultPanelPosition; this.gameObject.GetComponent <ChildInParentOwnParentObject>().parentObj = null; spriteRenderer.sprite = null; isExitChildBackSprite = false; } }