Пример #1
0
    public static AreaInstance Create(LevelInstance level, AreaData data)
    {
        GameObject   obj  = new GameObject("Area " + data.index);
        AreaInstance area = obj.AddComponent <AreaInstance>();

        if (area.Initialize(level, data))
        {
            area.transform.parent = level.transform;
            return(area);
        }
        DestroyImmediate(obj);
        return(null);
    }