public void PursuitState() { curState = MummyState.Pursuit; modelTransform.rotation = Quaternion.Euler(0, 0, 0); agent.enabled = true; agent.SetDestination(target); }
public void RagdollState() { curState = MummyState.Ragdoll; //agent.SetDestination(this.transform.position); agent.enabled = false; GetComponent <RagdollEnabler>().DoRagdoll(true); Destroy(this.gameObject, timeBeforeDisappear); }
public void RagdollState() { curState = MummyState.Ragdoll; agent.enabled = false; modelTransform.rotation = Quaternion.Euler(0, 0, 0); GetComponent <RagdollEnabler>().DoRagdoll(true); KillMummy(); }
private void Move2() { if (transform.position.x < 80 || transform.position.x > 100) { direction *= -1; } sprite.flipX = direction.x > 0; transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, speed * Time.deltaTime); state = MummyState.run; }
protected virtual void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.name == "fonar_trigger") { direction *= -1; } Character user = collider.GetComponent <Character>(); if (user && user is Character) { attack = true; state = MummyState.attack; user.ReciveDamage(); StartCoroutine(Attack()); sprite.flipX = !user.usrSprite.flipX; // turn sprte to the enemy } }
public void PursuitState() { curState = MummyState.Pursuit; agent.enabled = true; agent.SetDestination(target); }