public void GetObjInfo(FaceObjInfoContainer f = null, bool side = true) { if (f != null) { if (Element == null || Index != f.Current.Index) { if (Element != null) { DestroyImmediate(Element.gameObject); } Element = Instantiate(f.Current.Prefab).GetComponent <FaceObj>(); Element.transform.SetParent(this.transform); //Element.GetComponent<RectTransform>().anchorMax = Vector3.one; //Element.GetComponent<RectTransform>().sizeDelta = Vector3.zero; Child = new UIObj[1]; Child[0] = Element; Index = f.Current.Index; } //Info = f; //SetInfo(f.Current, null, side); } }
public void SetupObj(FaceObj p, FaceObjInfoContainer f = null, bool side = true) { FaceParent = p; GetObjInfo(f, side); }