Package info.ata4.unity.cli.extract

Source Code of info.ata4.unity.cli.extract.TextAssetHandler

/*
** 2013 July 01
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
*/
package info.ata4.unity.cli.extract;

import info.ata4.unity.serdes.UnityObject;
import info.ata4.unity.serdes.UnityString;
import java.io.IOException;

/**
*
* @author Nico Bergemann <barracuda415 at yahoo.de>
*/
public class TextAssetHandler extends AssetExtractHandler {
   
    public TextAssetHandler(String ext) {
        setOutputFileExtension(ext);
    }

    @Override
    public void extract(UnityObject obj) throws IOException {
        String name = obj.getValue("m_Name");
        UnityString script = obj.getValue("m_Script", false);
       
        setOutputFileName(name);
        writeData(script.getRaw());
    }
}
TOP

Related Classes of info.ata4.unity.cli.extract.TextAssetHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.