コード例 #1
0
    void Update()
    {
        GuardMushroom.NowisHit();
        GuardMushroom.GoToPullPush();
        GuardMushroom.QueenisADead();

        Dltime += Time.deltaTime;

        if (Dltime > 0.15f)
        {
            if (GuardMushroom.QueenisAllDead)
            {
                GuardMushroom.SetState(GuardMushroomState.BChase);
                return;
            }

            else if (GuardMushroom.SBombing)
            {
                GuardMushroom.SetState(GuardMushroomState.Sbombing);
                return;
            }

            else
            {
                GuardMushroom.SetState(GuardMushroomState.Return);
                return;
            }
        }
    }
コード例 #2
0
    void Update()
    {
        GuardMushroom.ModeChange();
        Dltime += Time.deltaTime;

        if (Dltime > 1.4f)
        {
            CPlayerManager._instance.isPush = false;
            CPlayerManager._instance.isPull = false;
            GuardMushroom.PPEnding          = true;

            if (GuardMushroom.QueenisAllDead)
            {
                GuardMushroom.SetState(GuardMushroomState.BChase);
                return;
            }

            else if (GuardMushroom.SBombing)
            {
                GuardMushroom.SetState(GuardMushroomState.Sbombing);
                return;
            }

            GuardMushroom.SetState(GuardMushroomState.Return);
            return;
        }
    }
コード例 #3
0
    private void Awake()
    {
        _queen = GameObject.FindGameObjectWithTag("Queen").GetComponent <QueenMushroom>();
        _guard = GameObject.FindGameObjectWithTag("Guard").GetComponent <GuardMushroom>();

        //GuardMushroomInit();
    }
コード例 #4
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.ModeChange();
        GuardMushroom.NowisHit();
        GuardMushroom.PlayerisDead();
        GuardMushroom.QueenisADead();

        GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond);

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance)
        {
            if (GuardMushroom.AttackTimer > GuardMushroom.AttackDelay)
            {
                GuardMushroom.SetState(GuardMushroomState.Attack);
                return;
            }
        }

        if (GuardMushroom.AttackTimer < GuardMushroom.AttackDelay && GuardMushroom.GetDistanceFromPlayer() <= GuardMushroom.MStat.AttackDistance)
        {
            GuardMushroom.SetState(GuardMushroomState.Return);
            return;
        }
    }
コード例 #5
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.NowisHit();
        GuardMushroom.PlayerisDead();
        GuardMushroom.QueenisADead();

        Dltime += Time.deltaTime;

        if (Dltime > 1.5f)
        {
            if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance)
            {
                GuardMushroom.SetState(GuardMushroomState.Chase);
                Dltime = 0;
                GuardMushroom.AttackTimer = 0f;
                return;
            }

            else
            {
                GuardMushroom.SetState(GuardMushroomState.Return);
                Dltime = 0;
                GuardMushroom.AttackTimer = 0f;
                return;
            }
        }
    }
コード例 #6
0
    void Update()
    {
        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance)
        {
            GuardMushroom.SetState(GuardMushroomState.Chase);
            return;
        }


        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance)
        {
            if (GuardMushroom.attackTimer > GuardMushroom.attackDelay)
            {
                GuardMushroom.SetState(GuardMushroomState.Attack);
                return;
            }
        }


        if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.ChaseDistance)
        {
            GuardMushroom.SetState(GuardMushroomState.Gohome);
            return;
        }
    }
コード例 #7
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.NowisHit();

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && (CPlayerManager._instance.isDead == false))
        {
            GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond);
            GuardMushroom.SetState(GuardMushroomState.Chase);
            return;
        }
    }
コード例 #8
0
    public void AttackCheck()
    {
        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance + 2.0f)
        {
            Debug.Log("Hit!");
            GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParams>().SetHp(10.0f);

            if (GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParams>().curHP == 0)
            {
                GuardMushroom.SetState(GuardMushroomState.Idle);
            }
        }
    }
コード例 #9
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.NowisHit();
        GuardMushroom.PlayerisDead();

        GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.BerserkerMoveSpeed, GuardMushroom.rotAnglePerSecond);

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance && GuardMushroom.AttackTimer > GuardMushroom.BerserkerAttackDelay)
        {
            GuardMushroom.SetState(GuardMushroomState.BAttack);
            return;
        }
    }
コード例 #10
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.NowisHit();
        GuardMushroom.PlayerisDead();

        Dltime += Time.deltaTime;

        if (Dltime > 0.78f)
        {
            GuardMushroom.SetState(GuardMushroomState.BChase);
            Dltime = 0;
            return;
        }
    }
コード例 #11
0
    public void AttackCheck()
    {
        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance + 1.5f &&
            GuardMushroom.PlayerisFront)
        {
            if (CPlayerManager._instance._PlayerAni_Contorl._PlayerAni_State_Shild == PlayerAni_State_Shild.Defense_ModeIdle)
            {
                CPlayerManager._instance.PlayerHp(0.2f, 2, GuardMushroom.AttackDamage);
            }

            else
            {
                CPlayerManager._instance.PlayerHp(0.2f, 1, GuardMushroom.AttackDamage);
            }
        }
    }
コード例 #12
0
    void Update()
    {
        if (GuardMushroom.isDead)
        {
            GuardMushroom.rotAnglePerSecond = 0;
            GuardMushroom.MStat.MoveSpeed   = 0;
            DeadTime += Time.deltaTime;
            GuardMushroom.CharacterisDead = true;

            if (DeadTime >= 1.6f)
            {
                GuardMushroom.OnDead();
                return;
            }
        }
    }
コード例 #13
0
    void Update()
    {
        GuardMushroom.GoToDestination(new Vector3(this.transform.position.x + default_direction.x, this.transform.position.y, this.transform.position.z + default_direction.z), 1.0f, GuardMushroom.rotAnglePerSecond);

        if (Vector3.Distance(this.transform.position, GuardMushroom.HomePosition) > 10.0f)
        {
            GuardMushroom.GoToDestination(GuardMushroom.HomePosition, 1.0f, GuardMushroom.rotAnglePerSecond);
        }

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance)
        {
            GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond);
            GuardMushroom.SetState(GuardMushroomState.Chase);
            return;
        }
    }
コード例 #14
0
    void Update()
    {
        GuardMushroom.GoToPullPush();
        GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.BerserkerMoveSpeed, GuardMushroom.rotAnglePerSecond);

        if (GuardMushroom.GetDistanceFromPlayer() < 1f)
        {
            EffectofSbomb(transform.position);
            GuardMushroom.OnDead();
        }

        if (GuardMushroom.SbombTimer > 6f)
        {
            EffectofSbomb(transform.position);
            GuardMushroom.OnDead();
        }
    }
コード例 #15
0
    public void BAttackCheck()
    {
        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance + 2.0f)
        {
            GuardMushroom.AttackTimer = 0f;

            if (CPlayerManager._instance._PlayerAni_Contorl._PlayerAni_State_Shild == PlayerAni_State_Shild.Defense_ModeIdle)
            {
                CPlayerManager._instance.PlayerHp(0.2f, 2, GuardMushroom.BerserkerAttackDamage);
            }

            else
            {
                CPlayerManager._instance.PlayerHp(0.2f, 1, GuardMushroom.BerserkerAttackDamage);
            }
        }
    }
コード例 #16
0
    void Update()
    {
        Dltime += Time.deltaTime;
        if (Dltime > 1.5f)
        {
            if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance)
            {
                GuardMushroom.SetState(GuardMushroomState.Chase);
                Dltime = 0;
                return;
            }

            else
            {
                GuardMushroom.SetState(GuardMushroomState.Return);
                Dltime = 0;
                return;
            }
        }
    }
コード例 #17
0
    void Update()
    {
        GuardMushroom.TurnToDestination();
        GuardMushroom.GoToPullPush();
        GuardMushroom.NowisHit();
        GuardMushroom.PlayerisDead();
        GuardMushroom.QueenisADead();

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance && GuardMushroom.AttackTimer > GuardMushroom.AttackDelay)
        {
            GuardMushroom.SetState(GuardMushroomState.Attack);
            return;
        }

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance)
        {
            GuardMushroom.SetState(GuardMushroomState.Chase);
            return;
        }
    }
コード例 #18
0
    /*GuardMushroom.MoveToDestination();
     * transform.position = new Vector3(GuardMushroom.GoHomePositionX,GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ);
     *
     * GuardMushroom.MoveToTarget(new Vector3(GuardMushroom.GoHomePositionX,
     * GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ));*/

    void Update()
    {
        if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.ChaseDistance)
        {
            GuardMushroom.GoToDestination(GuardMushroom.HomePosition, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond);

            if (Vector3.Distance(transform.position, new Vector3(GuardMushroom.GoHomePositionX,
                                                                 GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ)) <= 2.0f)
            {
                GuardMushroom.SetState(GuardMushroomState.Idle);
                return;
            }
        }

        else
        {
            GuardMushroom.SetState(GuardMushroomState.Return);
            return;
        }
    }
コード例 #19
0
    void Update()
    {
        Dltime += Time.deltaTime;
        GuardMushroom.GoToDestination(SavePosition, 0, 0);

        if (Dltime > 1.85f)
        {
            GuardMushroom.ifEndBerserker = true;
            if (GuardMushroom.QueenisAllDead)
            {
                GuardMushroom.SetState(GuardMushroomState.BChase);
                return;
            }

            else
            {
                GuardMushroom.SetState(GuardMushroomState.Sbombing);
                return;
            }
        }
    }
コード例 #20
0
    void Update()
    {
        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance)
        {
            GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond);
        }

        if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance)
        {
            if (GuardMushroom.attackTimer > GuardMushroom.attackDelay)
            {
                GuardMushroom.SetState(GuardMushroomState.Attack);
                return;
            }
        }

        else
        {
            GuardMushroom.SetState(GuardMushroomState.Return);
            return;
        }
    }
コード例 #21
0
 private void Awake()
 {
     _GuardMushroom = transform.GetComponent <GuardMushroom>();
     _QueenMushroom = transform.GetComponent <QueenMushroom>();
 }
コード例 #22
0
 private void Awake()
 {
     _GuardMushroom = GetComponent <GuardMushroom>();
 }