コード例 #1
0
ファイル: BossManager.cs プロジェクト: ryohalon/ShootingW
    void SetupTakeTimes()
    {
        string currentPath = Directory.GetCurrentDirectory() + "/";

        using (StreamReader sr = new StreamReader(currentPath + nextPointFileName))
        {
            sr.ReadLine();
            while (sr.Peek() > -1)
            {
                string[] data = sr.ReadLine().Split(',');
                Root     r    = new Root();
                r.takeTimes = new List <TakeTime>();
                r.p         = int.Parse(data[0]);

                for (int i = 1; i < data.Length; i += 3)
                {
                    TakeTime takeTime = new TakeTime();
                    takeTime.p               = int.Parse(data[i]);
                    takeTime.time            = float.Parse(data[i + 1]);
                    takeTime.rotateDirection = int.Parse(data[i + 2]);

                    r.takeTimes.Add(takeTime);
                }

                roots.Add(r);
            }
        }

        using (StreamReader sr = new StreamReader(currentPath + nextLaterPointFileName))
        {
            sr.ReadLine();
            while (sr.Peek() > -1)
            {
                string[] data = sr.ReadLine().Split(',');
                Root     r    = new Root();
                r.takeTimes = new List <TakeTime>();
                r.p         = int.Parse(data[0]);

                for (int i = 1; i < data.Length; i += 3)
                {
                    TakeTime takeTime = new TakeTime();
                    takeTime.p               = int.Parse(data[i]);
                    takeTime.time            = float.Parse(data[i + 1]);
                    takeTime.rotateDirection = int.Parse(data[i + 2]);

                    r.takeTimes.Add(takeTime);
                }

                laterRoots.Add(r);
            }
        }
    }
コード例 #2
0
ファイル: AudioDownLoadInfo.cs プロジェクト: wj60387/ESkin2
        public int Insert()
        {
            string querySql = "select 1 from AudioDownLoadInfo where GUID={0} and ShareToStetName={1}";

            if (null != Mediator.sqliteHelper.ExecuteScalar(querySql, Guid, ShareToStetName))
            {
                return(0);
            }

            string sql   = "insert into AudioDownLoadInfo select {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16}";
            int    count = Mediator.sqliteHelper.ExecuteNonQuery(sql, Guid, StetSerialNumber, StetName, PatientType, PatientID, PatientName, Posture,
                                                                 Part, RecordTime.ToString("yyyy-MM-dd HH:mm:ss"), TakeTime.ToString(), Remark, DocName, DocDiagnose, ShareStetName, ShareToStetName, ShareTime == DateTime.MinValue ? "" : ShareTime.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            return(count);
        }
コード例 #3
0
ファイル: BossManager.cs プロジェクト: ryohalon/ShootingW
    public void DecideModePoint()
    {
        isActionEnd = false;
        if (nowPointIndex != 3)
        {
            spriteR.sprite = anims[status].sprites[0];
        }

        switch (status)
        {
        case Status.STAY_LEFT:
        case Status.STAY_RIGHT:

            //前半フェイズ : ステイ(STAY_LEFT, STAY_RIGHT)
            //後半フェイズ : ステイ(STAY_LEFT, STAY_RIGHT) or unko(UNKO_BLOW)

            isAnim = false;
            //タワーにつかまっている時間
            stayTime = Random.Range(minStayTime, maxStayTime);

            break;

        case Status.ROOLLING:

            //移動
            isAnim = false;

            List <Root> select = (phase == Phase.FIRST_HALF) ? roots : laterRoots;

            if (nowPointIndex == 3)
            {
                nextPointIndex = 0;
                Vector3 nowPos    = points[nowPointIndex].pos;
                Vector3 nextPos   = points[nextPointIndex].pos;
                float   nowScale  = points[nowPointIndex].scale;
                float   nextScale = points[nextPointIndex].scale;

                //移動イージング
                var  r      = 0;
                bool ttakai = nowPos.y < nextPos.y;
                StartCoroutine(Easing.Tween(3, (t) =>
                {
                    var x = Mathf.Lerp(nowPos.x, nextPos.x, t);
                    var y = ttakai ? nowPos.y + (-nowPos.y + nextPos.y) * curve.Evaluate(t) :
                            nextPos.y + (-nextPos.y + nowPos.y) * curve.Evaluate(1 - t);

                    transform.localPosition = new Vector3(x, y, Mathf.Lerp(nowPos.z, nextPos.z, t));
                    transform.localRotation = Quaternion.Euler(0, 0, (r += 30) * -1);
                    transform.localScale    = Vector3.one * Mathf.Lerp(nowScale, nextScale, t);

                    if (t >= 1.0f)
                    {
                        isActionEnd             = true;
                        transform.localRotation = Quaternion.Euler(0, 0, 0);
                    }
                }));

                break;
            }

            foreach (var root in select)
            {
                if (nowPointIndex != root.p)
                {
                    continue;
                }

                //移動位置を候補からランダムで取得
                int selectIndex = Random.Range(0, root.takeTimes.Count);
                //ポイントID、移動時間を取得
                TakeTime next = root.takeTimes[selectIndex];
                nextPointIndex = next.p;

                Vector3 nowPos    = points[nowPointIndex].pos;
                Vector3 nextPos   = points[nextPointIndex].pos;
                float   nowScale  = points[nowPointIndex].scale;
                float   nextScale = points[nextPointIndex].scale;

                //移動イージング
                var  r      = 0;
                bool ttakai = nowPos.y < nextPos.y;
                StartCoroutine(Easing.Tween(next.time, (t) =>
                {
                    var x = Mathf.Lerp(nowPos.x, nextPos.x, t);
                    var y = ttakai ? nowPos.y + (-nowPos.y + nextPos.y) * curve.Evaluate(t) :
                            nextPos.y + (-nextPos.y + nowPos.y) * curve.Evaluate(1 - t);

                    transform.localPosition = new Vector3(x, y, Mathf.Lerp(nowPos.z, nextPos.z, t));
                    transform.localRotation = Quaternion.Euler(0, 0, (r += 30) * next.rotateDirection);
                    transform.localScale    = Vector3.one * Mathf.Lerp(nowScale, nextScale, t);

                    if (t >= 1.0f)
                    {
                        isActionEnd             = true;
                        transform.localRotation = Quaternion.Euler(0, 0, 0);
                    }
                }));

                break;
            }

            break;

        case Status.CLIMB_SCRATCH:

            //よじ登り引っかきモーション
            //引っかき途中で撃たれた場合怯みモーション移行

            tumeKougekiNum++;
            if (tumeKougekiNum == maxTumekougeki)
            {
                phase = Phase.LATTER_HALF;
            }
            var g = Instantiate(menoaeGorira);
            g.GetComponent <GoriraAppearance>().bossManager = this;

            break;

        case Status.STAGGER:

            //怯みモーション
            break;

        case Status.UNKO_BLOW_LEFT:
        case Status.UNKO_BLOW_RIGHT:

            //unko投げるモーション
            isAnim = true;
            StartCoroutine(Easing.Tween(anims[status].takeTime, (t) =>
            {
                if (animIndex == 1 && isUnko == false)
                {
                    isUnko = true;
                    //unko投げる関数
                    Instantiate(unko);
                }

                if (t >= 1.0f)
                {
                    isActionEnd = true;
                }
            }));

            break;

        case Status.START_ACTION:

            isAnim = true;
            //スタート時のアクション
            break;

        case Status.FHASE_CHANGE_ATION:

            isAnim = true;
            //フェイズ変更時のアクション(ドラミング)
            break;

        case Status.END_ACTION:

            isAnim = true;
            //最後のアクション(なつみを投げる)
            break;
        }
    }