コード例 #1
0
 private void Update()
 {
     if (GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
     {
         _manager.SetState(GoblinState.CHASE);
         return;
     }
     time += Time.deltaTime;
     if (time > idleTime)
     {
         _manager.SetState(GoblinState.PATROL);
     }
 }
コード例 #2
0
 private void Update()
 {
     if (!GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
     {
         _manager.SetState(NPCState.Stand);
         return;
     }
     time += Time.deltaTime;
     if (time > SkillTime)
     {
         _manager.SetState(NPCState.Attack);
     }
 }
コード例 #3
0
 // Update is called once per frame
 void Update()
 {
     elapsedTime += Time.deltaTime;
     if (elapsedTime >= idleTime)
     {
         manager.SetState(SlimeState.PATROL);
         Debug.Log("?");
     }
     if (GameLib.DetectCharacter(manager.sight, manager.PlayerCc))
     {
         manager.SetState(SlimeState.CHASE);
         return;
     }
 }
コード例 #4
0
    void Update()
    {
        if ((manager.playerCC != null) && GameLib.DetectCharacter(manager.sight, manager.playerCC))
        {
            manager.SetState(SlimeState.CHASE);
            return;
        }

        elapsedTime += Time.deltaTime;
        if (elapsedTime >= idleTime)
        {
            manager.SetState(SlimeState.PATROL);
        }
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        Debug.Log("SlimeCHASE");

        if (!GameLib.DetectCharacter(manager.sight, manager.PlayerCc))
        {
            manager.SetState(SlimeState.IDLE);
            return;
        }
        GameLib.JJMove(manager.scc, manager.PlayerCc.transform, manager.stat);
        if (Vector3.Distance(transform.position, manager.PlayerCc.transform.position) < manager.stat.slimeRange)
        {
            manager.SetState(SlimeState.ATTACK);
            return;
        }
    }
コード例 #6
0
    private void Update()
    {
        if (!GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
        {
            _manager.SetState(MonsterState.IDLE);
            return;
        }

        if (Vector3.Distance(_manager.PlayerTransform.position, transform.position) < _manager.Stat.AttackRange)
        {
            _manager.SetState(MonsterState.ATTACK);
            return;
        }

        _manager.CC.CKMove(_manager.PlayerTransform.position, _manager.Stat);
    }
コード例 #7
0
    private void Update()
    {
        if (GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
        {
            _manager.SetState(SlimeState.CHASE);
            return;
        }

        if (Vector3.Distance(destination, transform.position) < 0.1f)
        {
            _manager.SetState(SlimeState.IDLE);
            return;
        }

        _manager.CC.CKMove(destination, _manager.Stat);
    }
コード例 #8
0
    private void Update()
    {
        // 적을 찾았거나, 이미 찾은 상태면 쫒는다
        if (_manager._bOnFound || GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
        {
            _manager._bOnFound = true;
            _manager.SetState(GoblinState.CHASE);
            return;
        }

        if (Vector3.Distance(destination, transform.position) < 0.1f)
        {
            _manager.SetState(GoblinState.IDLE);
            return;
        }

        _manager.CC.CKMove(destination, _manager.Stat);
    }
コード例 #9
0
    private void Update()
    {
        GameLib.Log(this, "MonsterPATROL");

        if (GameLib.DetectCharacter(_manager.sight, _manager.playercc))
        {
            _manager.SetState(MonsterStates.Chase);
            return;
        }

        if ((Vector3.Distance(destination, transform.position) < 0.1f))
        {
            _manager.SetState(MonsterStates.IDLE);
            return;
        }

        _manager.CC.CKMove(destination, _manager.MonsterState);
    }
コード例 #10
0
ファイル: GBIDLE.cs プロジェクト: shi1252/GEPFSMBOSS
    protected override void Update()
    {
        base.Update();
        if (_manager.PlayerTransform)
        {
            if (GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
            {
                _manager.SetState(GBState.CHASE);
                return;
            }
        }

        time += Time.deltaTime;
        if (time > idleTime)
        {
            _manager.SetState(GBState.PATROL);
        }
    }
コード例 #11
0
 private void Update()
 {
     time += Time.deltaTime;
     if (time > idleTime)
     {
         // 일정시간이 지나면 다음 상태로 전이
         if (_manager._bOnFound || GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
         {
             _manager._bOnFound = true;
             _manager.SetState(GoblinState.CHASE);
             return;
         }
         else
         {
             _manager.SetState(GoblinState.PATROL);
         }
     }
 }
コード例 #12
0
    // Update is called once per frame
    void Update()
    {
        if (GameLib.DetectCharacter(manager.sight, manager.PlayerCc))
        {
            manager.SetState(SlimeState.CHASE);
            return;
        }
        Vector3 diff = destination - transform.position;

        diff.y = 0;
        if (diff.magnitude < 0.1f)
        {
            manager.SetState(SlimeState.IDLE);
            return;
        }

        GameLib.JJMove(manager.scc, destination, manager.stat);
    }
コード例 #13
0
    private void Update()
    {
        GameLib.Log(this, "GoblinChase");
        if (!GameLib.DetectCharacter(_manager.sight, _manager.playercc))
        {
            _manager.SetState(MonsterStates.IDLE);
            return;
        }

        if (GameLib.DetectCharacter(_manager.sight, _manager.playercc))
        {
            if ((Vector3.Distance(_manager.playerTran.position, transform.position) < _manager.MonsterState.AttackRange))
            {
                _manager.SetState(MonsterStates.Attack);
                return;
            }
        }
        _manager.CC.CKMove(_manager.playerTran.position, _manager.MonsterState);
    }
コード例 #14
0
ファイル: SlimeCHASE.cs プロジェクト: ideugu/UnityFSMTutorial
    void Update()
    {
        if (!GameLib.DetectCharacter(manager.sight, manager.playerCC))
        {
            manager.SetState(SlimeState.IDLE);
            return;
        }

        if (Vector3.Distance(
                transform.position,
                manager.playerCC.transform.position) <= manager.stat.attackRange)
        {
            manager.SetState(SlimeState.ATTACK);
            return;
        }

        GameLib.JJMove(manager.cc,
                       manager.playerCC.transform,
                       manager.stat);
    }
コード例 #15
0
    private void Update()
    {
        if (GameLib.DetectCharacter(_manager.Sight, _manager.PlayerCC))
        {
            _manager.SetState(NPCState.Run);
            return;
        }

        time += Time.deltaTime;
        if (time > idleTime)
        {
            int rand = Random.Range(1, 2);
            if (rand == 1)
            {
                _manager.SetState(NPCState.Walk);
            }
            else if (rand == 2)
            {
                _manager.SetState(NPCState.Idle);
            }
        }
    }
コード例 #16
0
    protected override void Update()
    {
        base.Update();
        if (!GameLib.DetectCharacter(m_manager.Sight, m_manager.PlayerCC))
        {
            m_manager.SetState(BossState.IDLE);
            return;
        }

        if (Vector3.Distance(m_manager.PlayerTransform.position, transform.position) < m_manager.Stat.AttackRange)
        {
            m_manager.SetState(BossState.ATTACK);
            return;
        }
        if (_slider.value <= 50)
        {
            m_manager.SetState(BossState.ATTACK2);
            transform.position = new Vector3(10, 0, 0);
            return;
        }
        m_manager.CC.CKMove(m_manager.PlayerTransform.position, m_manager.Stat);
    }
コード例 #17
0
    protected override void Update()
    {
        base.Update();
        if (m_manager.PlayerTransform)
        {
            if (GameLib.DetectCharacter(m_manager.Sight, m_manager.PlayerCC))
            {
                m_manager.SetState(BossState.RUN);
                return;
            }
            if (_slider.value <= 0)
            {
                m_manager.SetState(BossState.DEAD);
            }
        }

        //time += Time.deltaTime;
        //if (time > idleTime)
        //{
        //    m_manager.SetState(BossState.RUN);
        //}
    }