private void OnTriggerEnter2D(Collider2D collision) { AiMonster ai = collision.GetComponent <AiMonster>(); if (ai != null) { ai.NormalTarget = next.gameObject; } }
private void Start() { m_aiMonster = GetComponent <AiMonster>(); m_healthHandler = GetComponent <HealthHandler>(); if (m_aiMonster == null || m_healthHandler == null) { Debug.LogError("No health handler and ai monster attached " + this); } if (networkObject == null) { this.enabled = false; return; } }