Example #1
0
    void Start()
    {
        rb             = gameObject.AddComponent <Rigidbody2D>();
        rb.isKinematic = true;
        _state         = SMBConstants.EnemyState.Move;

        //setting up array
        beliefArray         = new string[4];
        beliefArrayComplete = false;
    }
Example #2
0
    void Die()
    {
        _body.velocity = Vector2.zero;
        _body.ApplyForce(Vector2.up);
        _body.ApplyForce(Vector2.right * Random.Range(-2f, 2f) * Time.fixedDeltaTime);

        _collider.applyHorizCollision = false;
        _collider.applyVertCollision  = false;

        gameObject.layer = LayerMask.NameToLayer("Ignore Raycast");

        _state = SMBConstants.EnemyState.Dead;
        _animator.SetTrigger("triggerDie");

        Invoke("DestroyEnemy", 4f);
    }
Example #3
0
 void Start()
 {
     _state = SMBConstants.EnemyState.Move;
 }