コード例 #1
0
    void Update()
    {
        GameLib.JJMove(manager.cc, manager.target, manager.stat);

        Vector3 diff = manager.target.position - transform.position;

        diff.y = 0.0f;
        if (diff.magnitude < manager.stat.attackRange)
        {
            manager.SetState(PlayerState.ATTACK);
        }
    }
コード例 #2
0
    // Update is called once per frame
    // A-B=AB>
    void Update()
    {
        Debug.Log("RUN");
        GameLib.JJMove(manager.cc, manager.marker, manager.stat);
        Vector3 diff = manager.marker.position - transform.position;

        diff.y = 0.0f;
        if (diff.magnitude < 0.1f)
        {
            manager.SetState(PlayerState.IDLE);
        }
    }
コード例 #3
0
    void Update()
    {
        GameLib.JJMove(manager.cc, manager.marker, manager.stat);

        //if (Vector3.Distance(transform.position, manager.marker.position) < 0.1f)
        Vector3 diff = manager.marker.position - transform.position;

        diff.y = 0.0f;

        if (diff.magnitude < 0.1f)
        {
            manager.SetState(PlayerState.IDLE);
        }
    }
コード例 #4
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;
        }
    }
コード例 #5
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);
    }
コード例 #6
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);
    }