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); } }
// 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); } }
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); } }
// 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; } }
// 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); }
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); }