Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked {
                hashCode += 1000000007 * Scale1.GetHashCode();
                hashCode += 1000000009 * CameraHeight.GetHashCode();
                hashCode += 1000000021 * CameraAngle.GetHashCode();
                hashCode += 1000000033 * Background.GetHashCode();
                hashCode += 1000000087 * FogDistance.GetHashCode();
                hashCode += 1000000093 * MaxLightStrength.GetHashCode();
                hashCode += 1000000097 * Scale2.GetHashCode();
                hashCode += 1000000103 * ViewDistance.GetHashCode();
                if (Objects != null)
                {
                    hashCode += 1000000123 * Objects.GetHashCode();
                }
                if (Floors != null)
                {
                    hashCode += 1000000181 * Floors.GetHashCode();
                }
                if (ObjectInfos != null)
                {
                    hashCode += 1000000207 * ObjectInfos.GetHashCode();
                }
                if (Walls != null)
                {
                    hashCode += 1000000223 * Walls.GetHashCode();
                }
            }
            return(hashCode);
        }
Exemplo n.º 2
0
 void Start()
 {
     #if UNITY_ANDROID
     Input.multiTouchEnabled = false;
     ballColl = GetComponent <SphereCollider>();
     #endif
     camAngleScript = Camera.main.GetComponent <CameraAngle>();
     ballRigidbody  = GetComponent <Rigidbody>();
     ballTransform  = GetComponent <Transform>();
     InitializeBallPositionsOnField();
     ballVelocity = 0;
 }
Exemplo n.º 3
0
 public RegularLine(XmlElement element, LineCatalogue catalogue, Conversation conversation)
     : base(element, catalogue, conversation)
 {
     text = element.GetAttribute("text");
     speakerName = element.GetAttribute("speaker");
     if (speakerName.Equals("")){
         speakerName = "Abby";
     }
     prerequisite = new Prerequisite(element.GetAttribute("prerequisite"), speakerName, conversation);
     consequence = new Consequence(element.GetAttribute("consequence"), speakerName, conversation);
     cameraAngle = CameraAngle.GetCameraAngle(element.GetAttribute("camera_angle"));
     emotion = Emotion.GetEmotion(element.GetAttribute("expression"));
     id = element.GetAttribute("id");
 }
Exemplo n.º 4
0
 private void ShowMissileCam()
 {
     if (missileCam)
     {
         missileCam = false;
         CameraAngle newCameraAngle = new CameraAngle();
         newCameraAngle.fovRange      = new Vector2(75f, 85f);
         newCameraAngle.distanceRange = new Vector2(45f, 60f);
         newCameraAngle.timeRange     = new Vector2(8f, 10f);
         newCameraAngle.interestTime  = 15f;
         newCameraAngle.interest      = 25f;
         newCameraAngle.stationary    = false;
         newCameraAngle.localOffset   = false;
         MissileLauncher missileLauncher = ((BomberShip)ship).missileLauncher;
         newCameraAngle.focus = missileLauncher.missiles[missileLauncher.MissileIndex].transform;
         Director.main.AddAngle(newCameraAngle);
     }
 }
Exemplo n.º 5
0
 //UnitPanelクリック時に詳細表示する
 public void OnClickPanel()
 {
     //ユニット確認の場合(システムメニューなど)
     if (unitcheckflag)
     {
         UnitCheck.unitNowSelected = unit;
         UnitCheck.is_unitchange   = true;
     }
     else //戦闘パートの場合
     {
         Operation.setSE(seOk);
         BattleVal.selectedUnit = unit;
         CharaStatusPrinter.Show_Enemy_Range(1);
         if (sortiestate == SortieState.SORTIE || sortiestate == SortieState.FORCE)
         {
             //カメラの移動
             CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);
         }
     }
 }
Exemplo n.º 6
0
    public void SetAngleStateWithButton()
    {
        switch (angleDropdown.value)
        {
        case 0:
            cameraAngle = CameraAngle.Sideview;
            break;

        case 1:
            cameraAngle = CameraAngle.HalfWay;
            break;

        case 2:
            cameraAngle = CameraAngle.TopDown;
            break;

        default:
            cameraAngle = CameraAngle.HalfWay;
            break;
        }
    }
 public static void SetCameraAngle(CameraAngle destinationAngle, GameObject pc, GameObject npc, bool useDamping)
 {
     if (destinationAngle == CameraAngle.SEMI_CLOSE_UP_NPC || destinationAngle == CameraAngle.CLOSE_UP_NPC){
         instance.target = npc.transform;
     } else {
         instance.target = pc.transform;
     }
     instance.destinationAngle = destinationAngle;
     if (!useDamping){
         instance.currentAngle.forwardOffset = destinationAngle.forwardOffset;
         if (instance.mirror){
             instance.currentAngle.angle = -destinationAngle.angle;
         } else {
             instance.currentAngle.angle = destinationAngle.angle;
         }
         instance.currentAngle.height = destinationAngle.height;
         instance.currentAngle.distance = destinationAngle.distance;
     }
     instance.angleChanged = true;
     instance.spinningAngle = 0.0f;
 }
    void LateUpdate()
    {
        PlayerInput input     = new PlayerInput();
        AxisInput   axisInput = input.SubAxis();

        DeltaCameraAngle deltaAngle = new DeltaCameraAngle(axisInput.value)
                                      .Multi(speed)
                                      .MultiCurrentFrameTime()
                                      .Reverse();

        CameraAngle currentCameraAngle = prevCameraAngle.Add(deltaAngle);

        prevCameraAngle = currentCameraAngle;

        Vector3 lookPoint     = playerTransformCache.position + Vector3.up * height;
        Vector3 localPosition = currentCameraAngle.ToLocalPosition(distance);
        Vector3 position      = lookPoint + localPosition;

        transformCache.position = position;

        transformCache.LookAt(playerTransformCache);
    }
Exemplo n.º 9
0
 //ユニット設置可能なマスにタイルを描く
 void DrawTile()
 {
     unitsetposlist.Clear();
     for (int i = 0; i < Mapclass.mapxnum; i++)
     {
         for (int j = 0; j < Mapclass.mapynum; j++)
         {
             if (BattleVal.mapdata[(int)MapdataList.MAPUNITSET][j][i] == 1)
             {
                 unitsetlist.Add(Instantiate(UnitSetTile));
                 Mapclass.DrawCharacter(unitsetlist[unitsetlist.Count - 1], i, j);
                 //1つ目の座標に視点移動
                 if (unitsetposlist.Count == 0)
                 {
                     Vector3 temp = new Vector3();
                     Mapclass.TranslateMapCoordToPosition(ref temp, i, j);
                     CameraAngle.CameraPoint(temp);
                 }
                 unitsetposlist.Add(new int[] { i, j });
             }
         }
     }
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     cameraAngle = GetComponent <CameraAngle>();
 }
Exemplo n.º 11
0
    void SetCamera()
    {
        if (followPlayerSetting == FollowPlayer.RotateWithPlayer)
        {
            switch (cameraAngle)
            {
            case CameraAngle.Sideview:
                RealeaseMainCam();
                cameras[0].tag = "MainCamera";
                cameras[0].gameObject.SetActive(true);
                cameras[1].gameObject.SetActive(false);
                cameras[2].gameObject.SetActive(false);
                cameras[3].gameObject.SetActive(false);
                cameras[4].gameObject.SetActive(false);
                cameras[5].gameObject.SetActive(false);
                privateAngle = cameraAngle;
                break;

            case CameraAngle.HalfWay:
                RealeaseMainCam();
                cameras[1].tag = "MainCamera";
                cameras[0].gameObject.SetActive(false);
                cameras[1].gameObject.SetActive(true);
                cameras[2].gameObject.SetActive(false);
                cameras[3].gameObject.SetActive(false);
                cameras[4].gameObject.SetActive(false);
                cameras[5].gameObject.SetActive(false);
                privateAngle = cameraAngle;
                break;

            case CameraAngle.TopDown:
                RealeaseMainCam();
                cameras[2].tag = "MainCamera";
                cameras[0].gameObject.SetActive(false);
                cameras[1].gameObject.SetActive(false);
                cameras[2].gameObject.SetActive(true);
                cameras[3].gameObject.SetActive(false);
                cameras[4].gameObject.SetActive(false);
                cameras[5].gameObject.SetActive(false);
                privateAngle = cameraAngle;
                break;
            }
            privateFollow = followPlayerSetting;
        }
        else if (followPlayerSetting == FollowPlayer.FixedWorldAngle)
        {
            switch (cameraAngle)
            {
            case CameraAngle.Sideview:
                RealeaseMainCam();
                cameras[3].tag = "MainCamera";
                cameras[0].gameObject.SetActive(false);
                cameras[1].gameObject.SetActive(false);
                cameras[2].gameObject.SetActive(false);
                cameras[3].gameObject.SetActive(true);
                cameras[4].gameObject.SetActive(false);
                cameras[5].gameObject.SetActive(false);
                privateAngle = cameraAngle;
                break;

            case CameraAngle.HalfWay:
                RealeaseMainCam();
                cameras[4].tag = "MainCamera";
                cameras[0].gameObject.SetActive(false);
                cameras[1].gameObject.SetActive(false);
                cameras[2].gameObject.SetActive(false);
                cameras[3].gameObject.SetActive(false);
                cameras[4].gameObject.SetActive(true);
                cameras[5].gameObject.SetActive(false);
                privateAngle = cameraAngle;
                break;

            case CameraAngle.TopDown:
                RealeaseMainCam();
                cameras[5].tag = "MainCamera";
                cameras[0].gameObject.SetActive(false);
                cameras[1].gameObject.SetActive(false);
                cameras[2].gameObject.SetActive(false);
                cameras[3].gameObject.SetActive(false);
                cameras[4].gameObject.SetActive(false);
                cameras[5].gameObject.SetActive(true);
                privateAngle = cameraAngle;
                break;
            }
            privateFollow = followPlayerSetting;
        }
        update = false;
    }
Exemplo n.º 12
0
    //Update
    private void Update()
    {
        //戦闘中
        if (BattleVal.status == STATUS.USESKILL)
        {
            int damage = 0;
            switch (bstate)
            {
            case BATTLE_STATUS.SETVECT:
                //キャラの向き調整;攻撃元が発動場所を向く
                Vector3 r0     = new Vector3(); //攻撃元
                Vector3 rSkill = new Vector3();
                Mapclass.TranslateMapCoordToPosition(ref r0, BattleVal.selectX, BattleVal.selectY);
                Mapclass.TranslateMapCoordToPosition(ref rSkill, skillpos[0], skillpos[1]);
                rSkill.y = r0.y;
                BattleVal.selectedUnit.gobj.transform.LookAt(rSkill);

                /*
                 * //攻撃対象
                 * foreach (int[] attackedpos in attackedposlist)
                 * {
                 *  Vector3 r1 = new Vector3(); //攻撃先
                 *  Mapclass.TranslateMapCoordToPosition(ref r1, attackedpos[0], attackedpos[1]);
                 *  Unitdata temp = BattleVal.id2index[string.Format("{0},{1}", attackedpos[0], attackedpos[1])];
                 *  damage = Calc_Damage(BattleVal.selectedUnit, temp);
                 *
                 *  temp.hp -= damage; //ダメージ処理
                 *
                 *  string damagetext = string.Format("{0}", (int)Mathf.Abs(damage));
                 *  int count = 1;
                 *  //ダメージテキストの中心座標
                 *  Vector3 damage_center = Camera.main.WorldToScreenPoint(r1);
                 *
                 *  //テキストの登録
                 *  List<Text> damagenumtmp = new List<Text>();
                 *  foreach (char a in damagetext)
                 *  {
                 *      int num = (int)char.GetNumericValue(a); //数を取得
                 *
                 *      damagenumtmp.Add(Instantiate(damagetextprefab, r1, Quaternion.identity));
                 *      damagenumtmp[count - 1].text = a.ToString();
                 *      //サイズ取得
                 *      damagenumtmp[count - 1].rectTransform.sizeDelta =
                 *          new Vector2(damagenumtmp[count - 1].preferredWidth, damagenumtmp[count - 1].preferredHeight);
                 *      damagenumtmp[count - 1].rectTransform.sizeDelta =
                 *          new Vector2(damagenumtmp[count - 1].preferredWidth, damagenumtmp[count - 1].preferredHeight);
                 *      damagenumtmp[count - 1].transform.SetParent(canvas.transform, false);
                 *      damagenumtmp[count - 1].transform.localPosition = damage_center - new Vector3(canvas.GetComponent<RectTransform>().sizeDelta.x / 2, canvas.GetComponent<RectTransform>().sizeDelta.y / 2, 0);
                 *
                 *      //1桁当たりの文字ブロック
                 *      Vector3 numsize = damagenumtmp[count - 1].GetComponent<RectTransform>().sizeDelta * damagenumtmp[count - 1].GetComponent<RectTransform>().localScale;
                 *      numsize.y = 0;
                 *      numsize.z = 0;
                 *
                 *      damagenumtmp[count - 1].transform.localPosition += (count - 1) * numsize;
                 *      damagenumtmp[count - 1].transform.localPosition += new Vector3(0, 30, 0);
                 *      damagenumtmp[count - 1].color = new Vector4(1, 0, 0, 1);
                 *      if (damage < 0) damagenumtmp[count - 1].color = new Vector4(0.7f,1,0.7f,1);
                 *      damagenumtmp[count - 1].gameObject.SetActive(false);
                 *      count++;
                 *
                 *  }
                 *  damagenum.Add(damagenumtmp);
                 *
                 *  //アニメーション設定
                 *  attackedAnimator.Add(temp.gobj.GetComponent<Animator>());
                 *  if(damage > 0)
                 *      attackedanimstate.Add(hitAnimName);    //共通モーションだと思うが、一部キャラで回復・ダメージが混ざる将来性も加味する
                 *  else
                 *      attackedanimstate.Add(healAnimName); //暫定 Healモーションも作る
                 *  attackedCharaAnimation.Add(temp.gobj.GetComponent<CharaAnimation>());
                 * }
                 */
                nowtime = -1;     //initialize

                //スキルの消費
                selectedskill.Consume(1);
                //行動スタックのクリア(1手戻し不可能に)
                BattleVal.actions.Clear();

                //カットイン演出の場合
                if (selectedskill.is_cutscene)
                {
                    gobjCutin = Instantiate(selectedskill.prefab_cutin);
                    bstate    = BATTLE_STATUS.CUTIN;
                }
                else
                {
                    //通常スキルの場合
                    //スキル使用モーション再生
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().Play(selectedskill.animname);
                    //state update
                    bstate         = BATTLE_STATUS.EFFECT;
                    skilltext.text = selectedskill.skillname;
                    skillnamePanel.SetActive(true);
                }


                break;

            case BATTLE_STATUS.CUTIN:
                if (gobjCutin.GetComponent <CutinChecker>().cutinFinish)
                {
                    Destroy(gobjCutin);
                    //スキル使用モーション再生
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().Play(selectedskill.animname);
                    //state update
                    bstate         = BATTLE_STATUS.EFFECT;
                    skilltext.text = selectedskill.skillname;
                    skillnamePanel.SetActive(true);
                }
                break;

            case BATTLE_STATUS.EFFECT:
                //スキル使用モーションが終了し、音声はなり終わったか?

                /*
                 * if (BattleVal.selectedUnit.gobj.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).normalizedTime >= 1
                 *  && !BattleVal.selectedUnit.gobj.GetComponent<CharaAnimation>().voiceSource.isPlaying
                 *  && !BattleVal.selectedUnit.gobj.GetComponent<CharaAnimation>().seSource.isPlaying)
                 */
                if (!BattleVal.selectedUnit.gobj.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).shortNameHash.Equals(Animator.StringToHash(selectedskill.animname)) &&
                    !BattleVal.selectedUnit.gobj.GetComponent <CharaAnimation>().voiceSource.isPlaying &&
                    !BattleVal.selectedUnit.gobj.GetComponent <CharaAnimation>().seSource.isPlaying)
                {
                    Vector3 effectcampoint = new Vector3();
                    Mapclass.TranslateMapCoordToPosition(ref effectcampoint, skillpos[0], skillpos[1]);
                    CameraAngle.CameraPoint(effectcampoint);

                    //エフェクト再生へ
                    Vector3 reffect = new Vector3();
                    Mapclass.TranslateMapCoordToPosition(ref reffect, skillpos[0], skillpos[1]);
                    hitEffect = Instantiate(selectedskill.skillefect, reffect, selectedskill.skillefect.transform.rotation);
                    bstate    = BATTLE_STATUS.BATTLE;
                }
                break;

            case BATTLE_STATUS.BATTLE:
                //バトルのアニメーション

                //エフェクトの再生が終了したか?
                if (hitEffect == null)
                {
                    //被弾モーション再生
                    if (nowtime == -1)
                    {
                        //攻撃対象
                        foreach (int[] attackedpos in attackedposlist)
                        {
                            Vector3 r1 = new Vector3();     //攻撃先
                            Mapclass.TranslateMapCoordToPosition(ref r1, attackedpos[0], attackedpos[1]);
                            Unitdata temp = BattleVal.id2index[string.Format("{0},{1}", attackedpos[0], attackedpos[1])];
                            damage = Calc_Damage(BattleVal.selectedUnit, temp);

                            temp.hp -= damage;     //ダメージ処理

                            string damagetext = string.Format("{0}", (int)Mathf.Abs(damage));
                            int    count      = 1;
                            //ダメージテキストの中心座標
                            Vector3 damage_center = Camera.main.WorldToScreenPoint(r1);

                            //テキストの登録
                            List <Text> damagenumtmp = new List <Text>();
                            foreach (char a in damagetext)
                            {
                                int num = (int)char.GetNumericValue(a);     //数を取得

                                damagenumtmp.Add(Instantiate(damagetextprefab, r1, Quaternion.identity));
                                damagenumtmp[count - 1].text = a.ToString();
                                //サイズ取得
                                damagenumtmp[count - 1].rectTransform.sizeDelta =
                                    new Vector2(damagenumtmp[count - 1].preferredWidth, damagenumtmp[count - 1].preferredHeight);
                                damagenumtmp[count - 1].rectTransform.sizeDelta =
                                    new Vector2(damagenumtmp[count - 1].preferredWidth, damagenumtmp[count - 1].preferredHeight);
                                damagenumtmp[count - 1].transform.SetParent(canvas.transform, false);
                                damagenumtmp[count - 1].transform.localPosition = damage_center - new Vector3(canvas.GetComponent <RectTransform>().sizeDelta.x / 2, canvas.GetComponent <RectTransform>().sizeDelta.y / 2, 0);

                                //1桁当たりの文字ブロック
                                Vector3 numsize = damagenumtmp[count - 1].GetComponent <RectTransform>().sizeDelta *damagenumtmp[count - 1].GetComponent <RectTransform>().localScale;
                                numsize.y = 0;
                                numsize.z = 0;

                                damagenumtmp[count - 1].transform.localPosition += (count - 1) * numsize;
                                damagenumtmp[count - 1].transform.localPosition += new Vector3(0, 30, 0);
                                damagenumtmp[count - 1].color = new Vector4(1, 0, 0, 1);
                                if (damage < 0)
                                {
                                    damagenumtmp[count - 1].color = new Vector4(0.7f, 1, 0.7f, 1);
                                }
                                damagenumtmp[count - 1].gameObject.SetActive(false);
                                count++;
                            }
                            damagenum.Add(damagenumtmp);

                            //アニメーション設定
                            attackedAnimator.Add(temp.gobj.GetComponent <Animator>());
                            if (damage > 0)
                            {
                                attackedanimstate.Add(hitAnimName);        //共通モーションだと思うが、一部キャラで回復・ダメージが混ざる将来性も加味する
                            }
                            else
                            {
                                attackedanimstate.Add(healAnimName);     //暫定 Healモーションも作る
                            }
                            attackedCharaAnimation.Add(temp.gobj.GetComponent <CharaAnimation>());
                        }
                        for (int i = 0; i < attackedAnimator.Count; i++)
                        {
                            //Count不一致するかも?
                            attackedAnimator[i].Play(attackedanimstate[i]);
                            if (attackedanimstate[i] == hitAnimName)
                            {
                                attackedCharaAnimation[i].seSource.clip = seDamage;
                            }
                            else
                            {
                                attackedCharaAnimation[i].seSource.clip = seHeal;
                            }
                            attackedCharaAnimation[i].seSource.Play();
                        }
                        //テキスト表示
                        foreach (List <Text> damagenumtmp in damagenum)
                        {
                            foreach (Text a in damagenumtmp)
                            {
                                a.gameObject.SetActive(true);
                            }
                            //CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);
                        }
                        nowtime = 0;
                    }
                    else if (nowtime >= battle_time - Time.deltaTime)
                    {
                        //戦闘後処理
                        bstate = BATTLE_STATUS.AFTERBATTLE;

                        //ダメージ数値のテキストを消す処理
                        foreach (List <Text> damagenumtmp in damagenum)
                        {
                            foreach (Text a in damagenumtmp)
                            {
                                Destroy(a.gameObject);
                            }
                        }
                        //戦闘用のダメージ表示などの判定が終了した後に、カメラの位置の移動
                        CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);
                        //アニメーション関連の初期化
                        attackedAnimator.Clear();
                        attackedanimstate.Clear();
                        attackedCharaAnimation.Clear();
                        damagenum.Clear();
                        skillnamePanel.SetActive(false);
                        //攻撃可能フラグをオフに
                        BattleVal.selectedUnit.atackable = false;
                    }
                    else
                    {
                        //ダメージ数値のテキストを消す処理
                        //damagetext.color -= new Color(0,0,0,Time.deltaTime);
                        foreach (List <Text> damagenumtmp in damagenum)
                        {
                            foreach (Text a in damagenumtmp)
                            {
                                a.color -= new Color(0, 0, 0, Time.deltaTime);
                                a.transform.position += new Vector3(0, 1, 0);
                            }
                        }
                        nowtime += Time.deltaTime;
                    }
                }


                break;

            //戦闘後処理
            case BATTLE_STATUS.AFTERBATTLE:
                //獲得経験値
                int getexp = 10;     //基本値
                //撃墜処理
                foreach (int[] attackedpos in attackedposlist)
                {
                    Unitdata temp = BattleVal.id2index[string.Format("{0},{1}", attackedpos[0], attackedpos[1])];
                    //撃墜処理
                    if (temp.hp <= 0)
                    {
                        Vector3 defeatpos = new Vector3();
                        Mapclass.TranslateMapCoordToPosition(ref defeatpos, attackedpos[0], attackedpos[1]);
                        StartCoroutine(UnitDefeat.DefeatHandle(temp, defeatEffect, defeatpos));

                        //撃墜ボーナス
                        getexp += BattleVal.id2index[string.Format("{0},{1}", attackedpos[0], attackedpos[1])].status.needexp;

                        //ユニットデータを消去
                        ////BattleVal.unitlistから消去
                        for (int i = 0; i < BattleVal.unitlist.Count; i++)
                        {
                            if (BattleVal.unitlist[i].x == temp.x && BattleVal.unitlist[i].y == temp.y)
                            {
                                BattleVal.unitlist.RemoveAt(i);
                                break;
                            }
                        }
                        ////BattleVal.id2indexから消去
                        BattleVal.id2index.Remove(string.Format("{0},{1}", temp.x, temp.y));
                        ////mapdataからユニット情報の削除
                        BattleVal.mapdata[(int)MapdataList.MAPUNIT][temp.y][temp.x] = 0;
                    }
                    if (temp.hp > temp.status.maxhp)
                    {
                        temp.hp = temp.status.maxhp;
                    }
                }

                //必殺技の場合、獲得経験値が1.5倍ボーナス
                if (selectedskill.is_cutscene)
                {
                    getexp = (int)((float)getexp * 1.5f);
                }
                //ユニットセレクトに戻る
                bstate = BATTLE_STATUS.SETVECT;
                if (BattleVal.selectedUnit.team == 0)
                {
                    //経験値を獲得するキャラの場合
                    if (BattleVal.selectedUnit.status.needexp != 0 &&
                        BattleVal.selectedUnit.status.level < 99 && BattleVal.selectedUnit.status.level >= 1)
                    {
                        Operation.AddGetExp(BattleVal.selectedUnit, getexp);
                        BattleVal.status = STATUS.GETEXP;
                    }
                    else
                    {
                        BattleVal.status = STATUS.PLAYER_UNIT_SELECT;
                    }
                }
                else
                {
                    BattleVal.status = STATUS.ENEMY_UNIT_SELECT;
                }
                break;
            }
        }
        else
        {
        }
    }
Exemplo n.º 13
0
        public Tile(Polygon region, Tile[] targets, int x = 0, int y = 0, CameraAngle angle = CameraAngle.COMPASS_NORTH_TOP)
        {
            gameX = x;
            gameY = y;
            screenRegion = region;
            predictedAngle = angle;

            others = targets ?? new Tile[0];
        }
Exemplo n.º 14
0
 public void Update()
 {
     if (Input.GetKey("1")){
         destinationAngle = CameraAngle.BEHIND;
     } else if (Input.GetKey("2")){
         destinationAngle = CameraAngle.SEMI_CLOSE_UP_PC;
     } else if (Input.GetKey("3")){
         destinationAngle = CameraAngle.CLOSE_UP_PC;
     } else if (Input.GetKey("x")) {
         string fileName="screenshot" + Time.time + ".png";
         Application.CaptureScreenshot(fileName);
     } else if (enableDevCameraControls) {
         if (Input.GetKey("t")){
             destinationAngle.MoveCloser();
         } else if (Input.GetKey("g")){
             destinationAngle.MoveFarther();
         } else if (Input.GetKey("f")){
             destinationAngle.TurnClockwise();
         } else if (Input.GetKey("h")){
             destinationAngle.TurnCounterClockwise();
         } else if (Input.GetKey("u")){
             destinationAngle.MoveUp();
         } else if (Input.GetKey("j")){
             destinationAngle.MoveDown();
         } else if (Input.GetKey("i")){
             destinationAngle.TiltDown();
         } else if (Input.GetKey("k")){
             destinationAngle.TiltUp();
         } else if (Input.GetKey("o")){
             destinationAngle.MoveForward();
         } else if (Input.GetKey("l")){
             destinationAngle.MoveBackward();
         } else if (Input.GetKey("b")){
             destinationAngle.DecreaseFieldOfView();
         } else if (Input.GetKey("n")){
             destinationAngle.IncreaseFieldOfView();
         } else if (Input.GetKey("m")){
             destinationAngle.PrintValues();
         }
     }
 }
Exemplo n.º 15
0
 public void Start()
 {
     SetDefaultCameraAngle();
     currentAngle = new CameraAngle(destinationAngle.angle, destinationAngle.forwardOffset, destinationAngle.height, destinationAngle.tilt, destinationAngle.distance, destinationAngle.fieldOfView, destinationAngle.spinningSpeed, true);
     currentRotationAngle = target.transform.eulerAngles.y;
     angleChanged = true;
     mirror = false;
     hiddenCharacters = new ArrayList();
 }
Exemplo n.º 16
0
    //Update
    private void Update()
    {
        //移動中の場合
        if (BattleVal.status == STATUS.MOVING)
        {
            switch (mstate)
            {
            case MOVING_STATUS.SETVECT:

                //移動終了の判定
                if (nowstep == movepath.Count - 1)
                {
                    //行動スタックを積む(1手戻し用)
                    if (BattleVal.status == STATUS.MOVING)
                    {
                        Action thisact = new Action(BattleVal.selectedUnit,
                                                    BattleVal.selectedUnit.x, BattleVal.selectedUnit.y, movepath[nowstep][0], movepath[nowstep][1]);
                        BattleVal.actions.Push(thisact);
                    }

                    //map上のキャラクターIDの更新
                    //座標情報のアップデート
                    BattleVal.mapdata[(int)MapdataList.MAPUNIT][movepath[nowstep][1]][movepath[nowstep][0]]
                        = BattleVal.mapdata[(int)MapdataList.MAPUNIT][movepath[0][1]][movepath[0][0]];
                    //移動した場合
                    if (nowstep != 0)
                    {
                        BattleVal.mapdata[(int)MapdataList.MAPUNIT][movepath[0][1]][movepath[0][0]] = 0;
                    }
                    //BattleVal.selectedUnit.gobj.GetComponent<QuerySDMecanimController>().ChangeAnimation(QuerySDMecanimController.QueryChanSDAnimationType.NORMAL_STAND);
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().SetBool("Walk", false);
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().SetBool("Jump", false);
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().Play("Idle");
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().Update(0);

                    BattleVal.selectedUnit.x = movepath[nowstep][0];
                    BattleVal.selectedUnit.y = movepath[nowstep][1];
                    //ディクショナリのアップデート
                    BattleVal.id2index.Remove(string.Format("{0},{1}", BattleVal.selectX, BattleVal.selectY));
                    BattleVal.id2index.Add(string.Format("{0},{1}", movepath[nowstep][0], movepath[nowstep][1]), BattleVal.selectedUnit);

                    //Battleval.statusのアップデート
                    Debug.Log(BattleVal.turnplayer);
                    if (BattleVal.turnplayer == 0)
                    {
                        BattleVal.status  = STATUS.PLAYER_UNIT_SELECT;
                        BattleVal.selectX = -1;
                        BattleVal.selectY = -1;
                    }
                    else
                    {
                        BattleVal.status = STATUS.ENEMY_UNIT_SELECT;
                    }

                    //移動可能フラグをオフに
                    BattleVal.selectedUnit.movable = false;


                    break;
                }
                //速度ベクトル(実空間)の計算
                Vector3 r0 = new Vector3();
                Mapclass.TranslateMapCoordToPosition(ref r0, movepath[nowstep][0], movepath[nowstep][1]);
                Vector3 r1 = new Vector3();
                Mapclass.TranslateMapCoordToPosition(ref r1, movepath[nowstep + 1][0], movepath[nowstep + 1][1]);
                velocity = (1.0f / steptime) * (r1 - r0);      //1マスの移動に0.5sec
                nowtime  = 0;
                stoptime = 0;

                if (Mathf.Abs(BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep + 1][1]][movepath[nowstep + 1][0]] - BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep][1]][movepath[nowstep][0]]) > 0)
                {
                    //ジャンプモーション
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().Play("Jump");
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().SetBool("Walk", false);
                    stoptime = 0.3f;
                }
                else
                {
                    BattleVal.selectedUnit.gobj.GetComponent <Animator>().SetBool("Walk", true);
                }

                /*
                 * //もしもジャンプする場合
                 * if (BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep + 1][1]][movepath[nowstep + 1][0]] - BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep][1]][movepath[nowstep][0]] > 0)
                 * {
                 *  //ジャンプモーション
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Walk", false);
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Jump",true);
                 *  //BattleVal.selectedUnit.gobj.GetComponent<QuerySDMecanimController>().ChangeAnimation(QuerySDMecanimController.QueryChanSDAnimationType.NORMAL_FLY_UP);
                 *  stoptime = 0.3f;
                 * }
                 * else if (BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep + 1][1]][movepath[nowstep + 1][0]] - BattleVal.mapdata[(int)MapdataList.MAPHEIGHT][movepath[nowstep][1]][movepath[nowstep][0]] < 0)
                 * {
                 *  //ジャンプモーション
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Walk", false);
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Jump", true);
                 *
                 *  //BattleVal.selectedUnit.gobj.GetComponent<QuerySDMecanimController>().ChangeAnimation(QuerySDMecanimController.QueryChanSDAnimationType.NORMAL_FLY_DOWN);
                 *  stoptime = 0.3f;
                 * }
                 * else
                 * {
                 *  //歩行モーション
                 *  //BattleVal.selectedUnit.gobj.GetComponent<QuerySDMecanimController>().ChangeAnimation(QuerySDMecanimController.QueryChanSDAnimationType.NORMAL_WALK);
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Jump", false);
                 *  BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Walk", true);
                 *
                 * }
                 */
                //キャラの向きの調整
                Mapclass.TranslateMapCoordToPosition(ref r1, movepath[nowstep + 1][0], movepath[nowstep + 1][1]);
                BattleVal.selectedUnit.gobj.transform.LookAt(r1);
                //mstateのアップデート
                mstate = MOVING_STATUS.MOVING;

                break;

            case MOVING_STATUS.MOVING:

                //ステップ終了の判定
                if (nowtime >= steptime - Time.deltaTime)
                {
                    if (now_stop_time == 0)
                    {
                        //BattleVal.selectedUnit.gobj.GetComponent<Animator>().SetBool("Jump", false);
                    }
                    //終点に表示
                    if (now_stop_time > stoptime)
                    {
                        r1 = new Vector3();
                        Mapclass.TranslateMapCoordToPosition(ref r1, movepath[nowstep + 1][0], movepath[nowstep + 1][1]);
                        BattleVal.selectedUnit.gobj.transform.position = r1;
                        BattleVal.selectedUnit.gobj.transform.LookAt(new Vector3(r1.x, BattleVal.selectedUnit.gobj.transform.position.y, r1.z));
                        CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);
                        nowstep++;
                        now_stop_time = 0;
                        mstate        = MOVING_STATUS.SETVECT;
                        break;
                    }
                    now_stop_time += Time.deltaTime;
                    nowtime       += Time.deltaTime;

                    /*
                     * //終点に表示
                     *
                     * r1 = new Vector3();
                     * Mapclass.TranslateMapCoordToPosition(ref r1, movepath[nowstep + 1][0], movepath[nowstep + 1][1]);
                     * BattleVal.selectedUnit.gobj.transform.position = r1;
                     * BattleVal.selectedUnit.gobj.transform.LookAt(new Vector3(r1.x, BattleVal.selectedUnit.gobj.transform.position.y, r1.z));
                     * CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);
                     * nowstep++;
                     * now_stop_time = 0;
                     * mstate = MOVING_STATUS.SETVECT;
                     * break;
                     */
                }
                else
                {
                    r1 = new Vector3();
                    Mapclass.TranslateMapCoordToPosition(ref r1, movepath[nowstep + 1][0], movepath[nowstep + 1][1]);
                    BattleVal.selectedUnit.gobj.transform.LookAt(new Vector3(r1.x, BattleVal.selectedUnit.gobj.transform.position.y, r1.z));
                    //nowtime 加算処理
                    nowtime += Time.deltaTime;
                    //移動
                    BattleVal.selectedUnit.gobj.transform.position += new Vector3(velocity.x, 0, velocity.z) * Time.deltaTime;
                    //カメラの移動
                    CameraAngle.CameraPoint(BattleVal.selectedUnit.gobj.transform.position);

                    if (nowtime < steptime / 2 && velocity.y > 0)
                    {
                        BattleVal.selectedUnit.gobj.transform.position += new Vector3(0, (float)velocity.y * steptime * 60 * nowtime, 0) * Time.deltaTime;
                    }
                    else if (nowtime >= steptime / 2 && velocity.y > 0)
                    {
                        float tempvelocity = (r1.y - BattleVal.selectedUnit.gobj.transform.position.y) / (steptime - nowtime);
                        BattleVal.selectedUnit.gobj.transform.position += new Vector3(0, tempvelocity, 0) * Time.deltaTime;
                    }
                    else if (velocity.y < 0)
                    {
                        BattleVal.selectedUnit.gobj.transform.position += new Vector3(0, velocity.y, 0) * Time.deltaTime;
                    }

                    /*
                     * //モーションチェンジ
                     *
                     * if (nowtime < steptime / 2 && velocity.y > 0)
                     * {
                     *  BattleVal.selectedUnit.gobj.transform.position += new Vector3(0, (float)velocity.y * steptime * 60 * nowtime, 0) * Time.deltaTime;
                     * }
                     * else if (nowtime >= steptime / 2 && velocity.y > 0)
                     * {
                     *  BattleVal.selectedUnit.gobj.transform.position -= new Vector3(0, (float)(velocity.y * steptime * 16 + Physics.gravity.y) * (nowtime - steptime / 2)) * Time.deltaTime;
                     * }
                     * else if (velocity.y < 0)
                     * {
                     *  BattleVal.selectedUnit.gobj.transform.position -= new Vector3(0, (float)(velocity.y * steptime * 8 - Physics.gravity.y) * nowtime - steptime) * Time.deltaTime;
                     * }
                     */
                }

                break;
            }
        }
    }