Example #1
0
    public LAppView(LAppModel model, Transform tr)
    {
        this.model = model;
        transform  = tr;


        deviceToScreen = new L2DMatrix44();


        viewMatrix = new L2DViewMatrix();


        viewMatrix.setMaxScale(LAppDefine.VIEW_MAX_SCALE);
        viewMatrix.setMinScale(LAppDefine.VIEW_MIN_SCALE);

        viewMatrix.setMaxScreenRect(
            LAppDefine.VIEW_LOGICAL_MAX_LEFT,
            LAppDefine.VIEW_LOGICAL_MAX_RIGHT,
            LAppDefine.VIEW_LOGICAL_MAX_BOTTOM,
            LAppDefine.VIEW_LOGICAL_MAX_TOP
            );


        touchMgr = new TouchManager();

        dragMgr = new L2DTargetPoint();

        Bounds bounds = model.getBounds();

        localP_LT = new Vector3(-(bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_RT = new Vector3((bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_LB = new Vector3(-(bounds.size.x / 2), 0, -(bounds.size.z / 2));
    }
Example #2
0
    void Awake()
    {
        FileManager.Init();
        path = FileManager.Configs["ModelPath"];

        if (path == "")
        {
            return;
        }
        model = new LAppModel(this);

        LAppLive2DManager.Instance.AddModel(this);
        if (FileManager.Configs["DefaultModel"] == "true")
        {
            path = "live2d/haru/haru.model.json";
            var filename = FileManager.getFilename(path);
            var dir      = FileManager.getDirName(path);

            Debug.Log("Load " + dir + "  filename:" + filename);
            model.LoadFromStreamingAssets(dir, filename);
        }
        else
        {
            model.LoadFromPath(path);
        }
    }
    // Use this for initialization
    void Start()
    {
        Debug.Log("hi test");

        LAppModel model = this.gameObject.GetComponent <LAppModelProxy>().GetModel();

        Debug.Log(model);

        model.SetExpression("f08");
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        appModel = live2DCanvas.GetComponent <LAppModel>();

        Color color = new Color(1, 1, 1);

        color.a = 0;
        percent.material.color = color;

        percent.fontSize = Screen.height / 8;
    }
 public LAppView(LAppModel model, Transform tr)
 {
     this.model = model;
     this.transform = tr;
     this.deviceToScreen = new L2DMatrix44();
     this.touchMgr = new TouchManager();
     this.dragMgr = new L2DTargetPoint();
     Bounds bounds = model.GetBounds();
     this.localP_LT = new Vector3(-(bounds.size.x / 2f), 0f, bounds.size.z / 2f);
     this.localP_RT = new Vector3(bounds.size.x / 2f, 0f, bounds.size.z / 2f);
     this.localP_LB = new Vector3(-(bounds.size.x / 2f), 0f, -(bounds.size.z / 2f));
 }
 private void Init()
 {
     if (this.path != string.Empty)
     {
         this.inited = true;
         this.model = new LAppModel(this);
         LAppLive2DManager.Instance.AddModel(this);
         string filename = FileManager.getFilename(this.path);
         string dir = FileManager.getDirName(this.path);
         this.model.LoadFromStreamingAssets(dir, filename);
     }
 }
Example #7
0
    // Use this for initialization
    void Start()
    {
        appModel = live2DCanvas.GetComponent <LAppModel>();

        Color color = new Color(1, 1, 1);

        color.a = 0;
        percent.material.color = color;

        percent.fontSize = Screen.height / 8;

        avatar = PlayerPrefs.GetString("avatar");
    }
    void Awake()
    {
        if (path == "")
        {
            return;
        }
        model = new LAppModel(this);

        LAppLive2DManager.Instance.AddModel(this);

        var filename = FileManager.getFilename(path);
        var dir      = FileManager.getDirName(path);

        Debug.Log("Load " + dir + "  filename:" + filename);
        model.LoadFromStreamingAssets(dir, filename);
    }
Example #9
0
    void Awake()
    {
        if (path == "") return;
        model = new LAppModel(this);

        LAppLive2DManager.Instance.AddModel(this);

        var filename = FileManager.getFilename(path);
        var dir = FileManager.getDirName(path);

        //Debug.Log("Load " + dir +"  filename:"+ filename);
        model.LoadFromStreamingAssets(dir, filename);

        //settings intial expression
        model.SetExpression ("f02");
    }
Example #10
0
    private Vector3 localP_LB;     //y



    public LAppView(LAppModel model, Transform tr)
    {
        this.model = model;
        transform  = tr;
        // デバイス座標からスクリーン座標に変換する
        deviceToScreen = new L2DMatrix44();

        // タッチ関係のイベント管理
        touchMgr = new TouchManager();

        dragMgr = new L2DTargetPoint();

        Bounds bounds = model.GetBounds();

        localP_LT = new Vector3(-(bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_RT = new Vector3((bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_LB = new Vector3(-(bounds.size.x / 2), 0, -(bounds.size.z / 2));
    }
Example #11
0
    private Vector3 localP_LB;     //y



    public LAppView(LAppModel model, Transform tr, GameObject myoObject)
    {
        this.model = model;
        transform  = tr;
        myo        = myoObject;


        deviceToScreen = new L2DMatrix44();


        touchMgr = new TouchManager();

        dragMgr = new L2DTargetPoint();

        Bounds bounds = model.GetBounds();

        localP_LT = new Vector3(-(bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_RT = new Vector3((bounds.size.x / 2), 0, (bounds.size.z / 2));
        localP_LB = new Vector3(-(bounds.size.x / 2), 0, -(bounds.size.z / 2));
    }
Example #12
0
    private void Start()
    {
        if (path == "")
        {
            return;
        }

#if !UNITY_EDITOR
        LAppDefine.DEBUG_LOG       = false;
        LAppDefine.DEBUG_TOUCH_LOG = false;
#endif
        model = new LAppModel(this);


        Live2D.init();
        Live2DFramework.setPlatformManager(new PlatformManager());

        var filename = FileManager.getFilename(path);
        var dir      = FileManager.getDirName(path);
        model.LoadFromStreamingAssets(dir, filename);

        // model.loadTexture(2, "haru/haru_01.1024/texture_03.png");
    }
Example #13
0
    void Awake()
    {
        if (path == "") return;
        model = new LAppModel(this);

        LAppLive2DManager.Instance.AddModel(this);

        var filename = FileManager.getFilename(path);
        var dir = FileManager.getDirName(path);

        Debug.Log("Load " + dir +"  filename:"+ filename);
        model.LoadFromStreamingAssets(dir, filename);

        //model.GetLive2DModelUnity ().setRenderMode (Live2D.L2D_RENDER_DRAW_MESH);
        hairIndex = clothesIndex = 1;

        queuedAnimations = new List<string> ();
    }