Example #1
0
    void load()
    {
        live2DModel = Live2DModelUnity.loadModel(mocFile.bytes);

        // モーションのインスタンスの作成(mtnの読み込み)と設定
        motionAppeal = Live2DMotion.loadMotion(mtnFiles[0].bytes);
        motionAppeal.setFadeOut(5000);
        motionAppeal.setLoop(this.isMotionLoop);

        motionManager = new MotionQueueManager();        //モーション管理クラスの作成.
        //play
        motionManager.startMotion(motionAppeal, true);

        for (int i = 0; i < textureFiles.Length; i++)
        {
            live2DModel.setTexture(i, textureFiles[i]);
        }

        float modelWidth = live2DModel.getCanvasWidth();

        live2DCanvasPos = Matrix4x4.Ortho(0, modelWidth, modelWidth, 0, -50.0f, 50.0f);

        if (physicsFile != null)
        {
            physics = L2DPhysics.load(physicsFile.bytes);
        }
    }
Example #2
0
 protected override void Awake()
 {
     if (base.CheckInstance())
     {
         Live2D.init();
         this.motionMgr     = new MotionQueueManager();
         this.IsStop        = false;
         this.isOneDraw     = false;
         this.isOnePlay     = false;
         this.isLive2DModel = false;
         this.myCamera      = base.GetComponent <Camera>();
     }
 }
Example #3
0
 private void OnDestroy()
 {
     Mem.DelAry(ref textureFiles);
     if (live2DModelUnity != null)
     {
         live2DModelUnity.releaseModel();
     }
     live2DModelUnity = null;
     motionMgr        = null;
     motionFile       = null;
     mocFile          = null;
     textureFiles     = null;
     motion           = null;
 }
Example #4
0
    void Start()
    {
        modelManager = GetComponent <LAppModelProxy>();
        live2DModel  = modelManager.GetModel().getLive2DModel();
        motionMgr    = new MotionQueueManager();
        motion       = Live2DMotion.loadMotion(motionFile.bytes);
        int i = 0;

        foreach (TextAsset t in motionFiles)
        {
            motions[i] = Live2DMotion.loadMotion(motionFiles[i].bytes);
            i++;
        }
        InvokeRepeating("RandomMotion", 10, 10);
    }
Example #5
0
    void Start()
    {
        modelManager = GetComponent <LAppModelProxy>();
        live2DModel  = modelManager.GetModel().getLive2DModel();
        motionMgr    = new MotionQueueManager();
        motion       = Live2DMotion.loadMotion(motionFile.bytes);

        target    = GameObject.FindGameObjectWithTag("Player");
        AtkMotion = Live2DMotion.loadMotion(AttackMotion.bytes);
        attack    = StartCoroutine(Attack());

        int Stage = PlayerPrefs.GetInt("stage", 1);

        Damage = 20 + (5 * Stage);
        HP     = 100 + (10 * Stage);
    }
Example #6
0
    private int motioncnt = 0;                                          // ファイル項番


    /// <summary>
    /// 初期化処理
    /// </summary>
    void Start()
    {
        // JSONを読込
        Json_Read();
        // Live2D初期化
        Live2D.init();
        // モーション管理クラスのインスタンス
        motionManager = new MotionQueueManager();
        // モーションのインスタンス
        motion = Live2DMotion.loadMotion(mtnFiles[0].bytes);
        // モーションの再生
        motionManager.startMotion(motion, false);
        // 表示位置
        float modelWidth = live2DModel.getCanvasWidth();

        live2DCanvasPos = Matrix4x4.Ortho(0, modelWidth, modelWidth, 0, -50.0f, 50.0f);
    }
    void load()
    {
        live2DModel = Live2DModelUnity.loadModel(mocFile.bytes);

		// モーションのインスタンスの作成(mtnの読み込み)と設定
		motionAppeal = Live2DMotion.loadMotion( mtnFiles[ 0 ].bytes );
		motionAppeal.setFadeOut (5000);
		motionAppeal.setLoop( this.isMotionLoop );

		motionManager = new MotionQueueManager();//モーション管理クラスの作成.
		//play
		motionManager.startMotion(motionAppeal,true);

        for (int i = 0; i < textureFiles.Length; i++)
        {
            live2DModel.setTexture(i, textureFiles[i]);
        }

        float modelWidth = live2DModel.getCanvasWidth();
        live2DCanvasPos = Matrix4x4.Ortho(0, modelWidth, modelWidth, 0, -50.0f, 50.0f);

        if (physicsFile != null) physics = L2DPhysics.load(physicsFile.bytes);
    }
    void load()
    {
        // .moc.bytesファイルをロードしてセット
        m_live2DModel = Live2DModelUnity.loadModel(m_mocFile.bytes);

        // テクスチャのファイル数だけ読み込んでセット
        for (int i = 0; i < m_textureFiles.Length; i++)
        {
            m_live2DModel.setTexture(i, m_textureFiles[i]);
        }

        // キャンバスを用意
        float modelWidth = m_live2DModel.getCanvasWidth();
        m_live2DCanvasPos = Matrix4x4.Ortho(0, modelWidth, modelWidth, 0, -50.0f, 50.0f);

        // 物理設定ファイルが空ならロード
        if (m_physicsFile != null) m_physics = L2DPhysics.load(m_physicsFile.bytes);

        // モーション管理用変数を用意
        m_motionMgr = new MotionQueueManager();

        // モーションファイルの数だけモーション管理用配列を確保
        m_motions = new Live2DMotion[m_motionFiles.Length];
        // モーションファイルの数だけモーションを読み込み
        for (int i = 0; i < m_motionFiles.Length; i++)
        {
            m_motions[i] = Live2DMotion.loadMotion(m_motionFiles[i].bytes);
        }
    }
Example #9
0
    void Start()
    {
        Live2D.init();
        if (figure == Figure.Catwoman)
        {
            Lines = new AudioClip[12];
            Lines = Resources.LoadAll <AudioClip>("Voice/L2D");


            III             = transform.gameObject.AddComponent <AudioSource>();
            III.playOnAwake = false;
        }

        modelUnity = Live2DModelUnity.loadModel(textAsset.bytes);
        for (int i = 0; i < texture2Ds.Length; i++)
        {
            modelUnity.setTexture(i, texture2Ds[i]);
        }
        float mo = modelUnity.getCanvasWidth();

        matrix4X4 = Matrix4x4.Ortho(0, mo, mo, 0, -50.0f, 50.0f);

        queueManager = new MotionQueueManager();
        dMotion      = Live2DMotion.loadMotion(textAssets[0].bytes);
        content      = new string[12];
        if (figure == Figure.YoungerSister)
        {
            if (!File.Exists(Application.dataPath + "Lottery"))
            {
                content[0]  = "第一次免费帮你占卜吧";
                content[1]  = "今天运气非常好,消灭敌人有概率获得极品道具哦";
                content[2]  = "商城今天会刷新一大批道具快去购买吧";
                content[3]  = "我们主城堡隐藏着某个神秘的道具";
                content[4]  = "<color=red>今天真糟糕,把道具都放在箱子里面吧</color>";
                content[5]  = "<color=red>仍有风云,小心谨慎</color>";
                content[6]  = "心情不好不要哭,让我来陪陪你吧";
                content[7]  = "<color=blue>每次进入副本建议别重要的装备放仓库里,不然死亡之后什么都没有啦</color>";
                content[8]  = "<color=red>一闪一闪亮晶晶,每天都是小星星</color>";
                content[9]  = "<color=blue>太累了吧,休息一下吧,我在这等你哦</color>";
                content[10] = "<color=red>他们说游戏里其实是另一个世界</color>";
                content[11] = "<color=blue>好好珍惜你身边的所有人,也许有那么一天就····</color>";
            }
        }
        else if (figure == Figure.Sorceress)
        {
            if (!File.Exists(Application.dataPath + "Lottery"))
            {
                content[0]  = "给老娘1000金币老娘帮你占卜一次";
                content[1]  = "今天运气一般,杀敌也不会获得极品道具哪";
                content[2]  = "存钱干嘛,商城每天都会刷新一大批道具快去买那";
                content[3]  = "别看了,天上不会掉馅饼那";
                content[4]  = "<color=red>呵呵,把道具都带在身上,不会死的那</color>";
                content[5]  = "<color=red>这么担心干嘛那,没了就充钱买那</color>";
                content[6]  = "<color=blue>管他三七二十一,别影响打游戏</color>";
                content[7]  = "<color=blue>去去去,哪凉快哪呆着去</color>";
                content[8]  = "<color=blue>你个沙雕,没事就知道调戏老娘</color>";
                content[9]  = "1 2 3画个圈圈诅咒你";
                content[10] = "<color=red>今天在主城堡找神秘宝箱,谁趁老娘不注意,在地上扔香蕉皮,害得我屁股现在都痛</color>";
                content[11] = "<color=red>往地上扔香蕉皮的就是你吧,你完蛋了</color>";
            }
        }
        else if (figure == Figure.Catwoman)
        {
            if (!File.Exists(Application.dataPath + "Lottery"))
            {
                content[0]  = "欢迎来到《LastProject》";
                content[1]  = "没有账号可以去注册一个新的账号哦";
                content[2]  = "登录失败不要慌,仔细想想应该可以想起来";
                content[3]  = "一个账号可以注册多个角色呢";
                content[4]  = "<color=red>不要盲目的删除角色,因为删除之后就永远不存在了</color>";
                content[5]  = "<color=red>如果你非常无聊不妨来试试这款游戏吧</color>";
                content[6]  = "<color=blue>适当游戏益脑,沉迷游戏伤身</color>";
                content[7]  = "<color=blue>用心创造快乐</color>";
                content[8]  = "<color=blue>人是铁饭是钢,吃饱了才有力气玩游戏</color>";
                content[9]  = "副本难度不要太高,小心打不过哦";
                content[10] = "<color=red>有朋自远方来,交个朋友吧</color>";
                content[11] = "<color=red>我们这个世界需要你来守护</color>";
            }
        }
        else if (figure == Figure.Recyclebin)
        {
            if (!File.Exists(Application.dataPath + "Lottery"))
            {
                content[0]  = "这里是柚子回收站,你想出售什么道具吗";
                content[1]  = "高价回收、电冰箱、旧电脑、旧手机、旧电视·····";
                content[2]  = "想好了在出售哦我可是不给你退货的";
                content[3]  = "今天又想出售什么东西呢";
                content[4]  = "<color=red>没道具了,快去杀怪掉落吧</color>";
                content[5]  = "<color=red>柚子回收站24小时开放哦</color>";
                content[6]  = "<color=blue>你的旧装备都可以在这里出售哦</color>";
                content[7]  = "<color=blue>没钱了,不妨出售装备吧</color>";
                content[8]  = "<color=blue>人是铁饭是钢,吃饱了才有力气卖装备</color>";
                content[9]  = "装备全靠打,一键回收9999";
                content[10] = "<color=red>今天你肝了吗,不肝没装备卖了</color>";
                content[11] = "<color=red>以前这里有多个回收站的,后来就····</color>";
            }
        }


        his = transform.Find("ChatBubble").GetComponent <FalseHis>();
    }