using System; using UnityEngine; public class PhotoTutorialButton : MonoBehaviour { public void Awake() { EventDelegate.Add(base.GetComponent().onClick, new EventDelegate.Callback(this.OnClickEvent)); } public void SetTarget(GameObject target_object) { this.target_text_ = target_object; this.scroll_view_ = NGUITools.FindInParents(this.target_text_.transform); } public void OnClickEvent() { this.scroll_view_.verticalScrollBar.value = 0f; this.scroll_view_.ResetPosition(); Transform parent = this.target_text_.transform.parent; for (int i = 0; i < parent.childCount; i++) { parent.GetChild(i).localScale = Vector3.zero; } this.target_text_.transform.localScale = Vector3.one; this.scroll_view_.verticalScrollBar.value = 0f; this.scroll_view_.ResetPosition(); } private UIScrollView scroll_view_; private GameObject target_text_; }