void Init() { if (preview == null) { GameObject obj = GameObject.Find(name); if (obj == null) { GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject> ( SWCommon.ProductFolder() + "/Prefabs/Preview.prefab"); obj = GameObject.Instantiate(prefab); obj.name = name; obj.hideFlags = HideFlags.HideInHierarchy; } preview = obj.GetComponent <SWPreview> (); preview.Init(startPos); } }