Exemplo n.º 1
0
    void Start()
    {
        _elementsPatterns = PatternParser.ParsePatterns <FacadeItem> (_elementsPatternsFile, this);
        _detailsPatterns  = PatternParser.ParsePatterns <FacadeItem> (_detailsPatternsFile, this);
        if (_usesOperations)
        {
            _operationsPatterns = PatternParser.ParsePatterns <FacadeOperation> (_operationsPatternsFile, this);
        }

        if (_textureAtlasFile == null)
        {
            throw new Exception("_textureAtlasFile == null");
        }

        _textureAtlas = TextureAtlas.LoadFromString(_textureAtlasFile.text);

        if (_wallTextures == null || _wallTextures.Length == 0)
        {
            throw new Exception("there must be at least 1 wall texture");
        }

        if (_terraceTextures == null || _terraceTextures.Length == 0)
        {
            throw new Exception("there must be at least 1 terrace texture");
        }

        foreach (string wallTexture in _wallTextures)
        {
            _wallTexturesRects.Add(_textureAtlas.atlasRects [wallTexture]);
            //_wallBumpTexturesRects.Add (_textureAtlas.atlasRects [wallTexture + "-normal"]);
            _wallBumpTexturesRects.Add(new Rect(0, 0, 0, 0));
        }

        foreach (string terraceTexture in _terraceTextures)
        {
            _terraceTexturesRects.Add(_textureAtlas.atlasRects [terraceTexture]);
            //_terraceBumpTexturesRects.Add (_textureAtlas.atlasRects [terraceTexture + "-normal"]);
            _terraceBumpTexturesRects.Add(new Rect(0, 0, 0, 0));
        }
    }