Exemplo n.º 1
0
    public void Init(BeardModelHandler model)
    {
        _toolScribble = GetComponent <ScribbleTool>();
        _toolScribble.Init(new RenderTexturePainter[] { model._hairMainPainter, model._hairTempPainter }, null);
        List <SpriteHandler.SpriteData> listSpriteData = new List <SpriteHandler.SpriteData>();
        //string url = "Beard/Dye/" + model.gameObject.name + "/{0}.png";
        //listSpriteData.Add(new SpriteHandler.SpriteData(_toolScribble, _formatUrl, "", SpriteHandler.LoadType.StreamingAsset));
        string url      = string.Format("{0}/{1}_{2}_dye.unity3d", AppConst.AppName, AppConst.AppName, model.gameObject.name).ToLower();
        string fileName = "{0}.png";

        listSpriteData.Add(new SpriteHandler.SpriteData(_toolScribble, url, fileName, SpriteHandler.LoadType.AssetBundle));
        _spriteHandler = GetComponent <SpriteHandler>();
        _spriteHandler.Init(listSpriteData);
        _model = model;
        ToolScribble.OnToolStart.AddListener(OnToolStart);
        ToolScribble.OnToolEnd.AddListener(OnToolEnd);
    }