Пример #1
0
 public void PursuitState()
 {
     curState = MummyState.Pursuit;
     modelTransform.rotation = Quaternion.Euler(0, 0, 0);
     agent.enabled           = true;
     agent.SetDestination(target);
 }
Пример #2
0
 public void RagdollState()
 {
     curState = MummyState.Ragdoll;
     //agent.SetDestination(this.transform.position);
     agent.enabled = false;
     GetComponent <RagdollEnabler>().DoRagdoll(true);
     Destroy(this.gameObject, timeBeforeDisappear);
 }
Пример #3
0
 public void RagdollState()
 {
     curState                = MummyState.Ragdoll;
     agent.enabled           = false;
     modelTransform.rotation = Quaternion.Euler(0, 0, 0);
     GetComponent <RagdollEnabler>().DoRagdoll(true);
     KillMummy();
 }
Пример #4
0
 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;
 }
Пример #5
0
    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
        }
    }
Пример #6
0
 public void PursuitState()
 {
     curState      = MummyState.Pursuit;
     agent.enabled = true;
     agent.SetDestination(target);
 }