Example #1
0
    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);
    }
Example #2
0
    //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>());
    }
Example #3
0
 private void SetRandomSection()
 {
     sections.Enqueue(ViewController.LoadSection(
                          EnumContoller.RandomEnumValue <SectionEnum>(),
                          ref distanse));
 }