void Start() { rb = gameObject.AddComponent <Rigidbody2D>(); rb.isKinematic = true; _state = SMBConstants.EnemyState.Move; //setting up array beliefArray = new string[4]; beliefArrayComplete = false; }
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); }
void Start() { _state = SMBConstants.EnemyState.Move; }