//Cann't instance some same view public static IView LoadView(ViewesEnum viewEnum) { var view = Instantiate(Resources.Load(EnumContoller.GetPath(viewEnum)) as GameObject); if (viewes == null) { viewes = new Dictionary <ViewesEnum, GameObject>(); } viewes.Add(viewEnum, view); return(view.GetComponent <IView>()); }
public static GameObject LoadSection(SectionEnum sectioEnum, ref float distanse) { //now section size is const. //we need build correct section prefab const float SIZE = 10; GameObject go = Instantiate(Resources.Load(EnumContoller.GetPath(sectioEnum)) as GameObject, new Vector3(distanse, 0, 0), Quaternion.identity); distanse += SIZE; return(go); }