예제 #1
0
    void Start()
    {
        enemyManager = GetComponent <EnemyManager>();

        topEnemy    = GameObject.Find("Enemy_Top_mixamorig:Hips");
        bottomEnemy = GameObject.Find("Enemy_Bottom_mixamorig:Hips");

        //敵の初期ポジションを格納
        topPos    = topEnemy.transform.position;
        bottomPos = bottomEnemy.transform.position;
        //敵共有クールタイム
        initCoolT = 0;
        //快眠ポイントに応じたステータス
        reAppStatus = ReAppearState.reApp910;

        t    = new float[2];
        t[0] = t[1] = 0;

        Cnt    = new float[2];
        Cnt[0] = Cnt[1] = 0;

        Reappear    = new int[2];
        Reappear[0] = Reappear[1] = 0;

        Parent_handleg1 = new List <GameObject>();  //手足のリスト
        Parent_handleg2 = new List <GameObject>();

        //パーツの追加
        #region
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:LeftArm"));         //0
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:LeftForeArm"));     //1
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:RightArm"));        //2
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:RightForeArm"));    //3
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:LeftUpLeg"));       //4
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:LeftLeg"));         //5
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:RightUpLeg"));      //6
        Parent_handleg1.Add(GameObject.Find("Enemy_Top_mixamorig:RightLeg"));        //7

        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:LeftArm"));      //0
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:LeftForeArm"));  //1
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:RightArm"));     //2
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:RightForeArm")); //3
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:LeftUpLeg"));    //4
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:LeftLeg"));      //5
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:RightUpLeg"));   //6
        Parent_handleg2.Add(GameObject.Find("Enemy_Bottom_mixamorig:RightLeg"));     //7
        #endregion

        m_rotate_min = m_rand_rotate_Min / 360;  //ランダム最小角度
        m_rotate_max = m_rand_rotate_Max / 360;  //ランダム最大角度
        //難易度設定
        ChangeLevel();
    }
예제 #2
0
    void Start()
    {
        //確認用
        topPos    = topEnemy.transform.position;
        bottomPos = bottomEnemy.transform.position;
        //
        initCoolT   = 0;
        reAppStatus = ReAppearState.reApp910;

        t    = new float[2];
        t[0] = t[1] = 0;

        Cnt    = new float[2];
        Cnt[0] = Cnt[1] = 0;

        Reappear    = new int[2];
        Reappear[0] = Reappear[1] = 0;

        Parent_handleg1 = new List <GameObject>();  //手足のリスト
        Parent_handleg2 = new List <GameObject>();

        //パーツの追加
        #region
        Parent_handleg1.Add(GameObject.Find("Enemy_LeftHand1"));     //0
        Parent_handleg1.Add(GameObject.Find("Enemy_LeftHand2"));     //1
        Parent_handleg1.Add(GameObject.Find("Enemy_RightHand1"));    //2
        Parent_handleg1.Add(GameObject.Find("Enemy_RightHand2"));    //3
        Parent_handleg1.Add(GameObject.Find("Enemy_LeftLeg1"));      //4
        Parent_handleg1.Add(GameObject.Find("Enemy_LeftLeg2"));      //5
        Parent_handleg1.Add(GameObject.Find("Enemy_RightLeg1"));     //6
        Parent_handleg1.Add(GameObject.Find("Enemy_RightLeg2"));     //7

        Parent_handleg2.Add(GameObject.Find("Enemy2_LeftHand1"));    //0
        Parent_handleg2.Add(GameObject.Find("Enemy2_LeftHand2"));    //1
        Parent_handleg2.Add(GameObject.Find("Enemy2_RightHand1"));   //2
        Parent_handleg2.Add(GameObject.Find("Enemy2_RightHand2"));   //3
        Parent_handleg2.Add(GameObject.Find("Enemy2_LeftLeg1"));     //4
        Parent_handleg2.Add(GameObject.Find("Enemy2_LeftLeg2"));     //5
        Parent_handleg2.Add(GameObject.Find("Enemy2_RightLeg1"));    //6
        Parent_handleg2.Add(GameObject.Find("Enemy2_RightLeg2"));    //7
        #endregion

        m_rand_rotate_min = 0.0556f;
        m_rand_rotate_max = 0.1667f;
        SetParts_up();
        SetParts_down();
    }
예제 #3
0
    //再出現時の行動判別
    public void ReAppear(GameObject obj)
    {
        //快眠ポイント取得
        int point = GetComponent <SleepGageScript>().sleepPoint;


        if (point >= 1 && point <= 2) //快眠ポイントが1~2のとき
        {
            reAppStatus = ReAppearState.reApp12;
        }
        else if (point >= 3 && point <= 4) //快眠ポイントが3~4のとき
        {
            reAppStatus = ReAppearState.reApp34;
        }
        else if (point >= 5 && point <= 6) //快眠ポイントが5~6のとき
        {
            reAppStatus = ReAppearState.reApp56;
        }
        else if (point >= 7 && point <= 8) //快眠ポイントが7~8のとき
        {
            reAppStatus = ReAppearState.reApp78;
        }
        else if (point <= 10) //快眠ポイントが9~10のとき
        {
            reAppStatus = ReAppearState.reApp910;
        }

        if (obj.name == topEnemy.name) //上エネミ―
        {
            ReAppear_top(obj);
            Reappear[0] = 3;                   //再出現後の行動回数
        }
        else if (obj.name == bottomEnemy.name) //下エネミー
        {
            ReAppear_bottom(obj);
            Reappear[1] = 3;  //再出現後の行動回数
        }
        //一部ジョイントを繋げる
        ConnectedBody(obj, true);
    }
예제 #4
0
    public void ReAppear(GameObject obj) //再出現時の行動判別
    {
        //快眠ポイント取得
        int point = GameObject.Find("ScriptController").GetComponent <SleepGageScript>().sleepPoint;


        if (point >= 1 && point <= 2) //快眠ポイントが1~2のとき
        {
            reAppStatus = ReAppearState.reApp12;
        }
        else if (point >= 3 && point <= 4) //快眠ポイントが3~4のとき
        {
            reAppStatus = ReAppearState.reApp34;
        }
        else if (point >= 5 && point <= 6) //快眠ポイントが5~6のとき
        {
            reAppStatus = ReAppearState.reApp56;
        }
        else if (point >= 7 && point <= 8) //快眠ポイントが7~8のとき
        {
            reAppStatus = ReAppearState.reApp78;
        }
        else if (point <= 10) //快眠ポイントが9~10のとき
        {
            reAppStatus = ReAppearState.reApp910;
        }

        if (obj.name == "Model_enemyTest") //上エネミ―
        {
            ReAppear_top(obj);
            Reappear[0] = 3;
        }
        else if (obj.name == "Model_enemy2Test") //下エネミー
        {
            ReAppear_bottom(obj);
            Reappear[1] = 3;
        }
    }