Ejemplo n.º 1
0
    /* 処理が重いため一旦停止
     *
     * // Update is called once per frame
     * void Update () {
     *      if (scrollInDelay < 0) {
     *              if (movingFrameCnt > 0) {
     *                              movingFrameCnt -= 1;
     *                              Vector3 tmpV = new Vector3 (2f, 0f, 0f);
     *                              this.gameObject.transform.localPosition += tmpV;
     *              }
     *      } else {
     *              scrollInDelay -= 1;
     *      }
     * }
     */

    void OnMouseDown()
    {
        parentMenu.buttonActionFlag = true;

        switch (thisButtonType)
        {
        case 0:
            parentChara.setMode(characterMode.Attack);
            parentMenu.setCharaModeIcon(characterMode.Attack);
            break;

        case 1:
            parentChara.setMode(characterMode.Defence);
            parentMenu.setCharaModeIcon(characterMode.Defence);
            break;

        case 2:
            parentChara.setMode(characterMode.Move);
            parentMenu.setCharaModeIcon(characterMode.Move);
            break;

        case 3:
            //アニメーション終了時にイベント発生
            break;
        }
        soundManagerGetter.getManager().playOneShotSound(enm_oneShotSound.modeChange);
        thisAnime.updateMode = AnimatorUpdateMode.UnscaledTime;
    }
    public void buttonActionBase(bool cancelFlag)
    {
        if (cancelFlag)
        {
            //true
            parentMenu.closeMe();
        }
        else
        {
            //スキル情報を戻す
            parentChara.setSkillTatgetInfo(thisTrgt);
            parentChara.setMode(characterMode.Skill);

            //thisAnimetor.SetTrigger("gotoAttack");
            Animator tmpAnime = parentChara.gameObject.GetComponentInChildren <Animator>();
            tmpAnime.SetTrigger("gotoSkill");

            parentMenu.setCharaModeIcon(characterMode.Skill);
            parentMenu.closeMe();
        }
    }