public static SQYCharatorView CreateCharatorView() { UObject obj = PrefabLoader.loadFromPack("SQY/pbSQYCharatorView"); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; SQYCharatorView cv = go.GetComponent <SQYCharatorView>(); obj = null; return(cv); } return(null); }
void Awake() { for (int i = 0; i < lstAvatars.Count; i++) { SQYCharatorView cv = SQYCharatorView.CreateCharatorView(); cv.mIndex = i; RED.AddChild(cv.gameObject, lstAvatars[i]); cv.OnDrag += this.OnDrag; cv.OnPress += this.OnPress; cv.OnClick += this.OnClick; szHeadViews.Add(cv); } UIEventListener.Get(goZhuanPan).onDrag = this.OnDrag; }