OK, got it working both ways. I will post the updated script here in a little bit. And I'll update the document tomorrow.
using UnityEngine;
using EmeraldAI;
using Opsive.Shared.Events;
namespace Magique
{
public class OpsiveBridge : MonoBehaviour
{
private EmeraldAISystem _emeraldAI;
private void Awake()
{
_emeraldAI = GetComponent<EmeraldAISystem>();
EventHandler.RegisterEvent<float, Vector3, Vector3, GameObject, object, Collider>(gameObject, "OnObjectImpact", OnObjectImpact);
}
private void OnObjectImpact(float amount, Vector3 position, Vector3 forceDirection, GameObject attacker, object attackerObject, Collider hitCollider)
{
if (_emeraldAI != null)
{
_emeraldAI.Damage((int)amount, EmeraldAISystem.TargetType.Player, attacker.transform);
Debug.Log(name + " impacted by " + attacker + " on collider " + hitCollider + ".");
}
}
public void OnDestroy()
{
EventHandler.UnregisterEvent<float, Vector3, Vector3, GameObject, object, Collider>(gameObject, "OnObjectImpact", OnObjectImpact);
}
}
}
I would talk to BHS. This is beyond the scope of what I'm working on.
Here is the updated integration document.
Sorry, but I don't have the time to make a video for this. Is there something you are having trouble with?Hello, can you make a little video how i must install it ?
OK. I have problem with the OpsiveBridge script . Is this an extra cs-file ? Like OpsiveBridge.csSorry, but I don't have the time to make a video for this. Is there something you are having trouble with?
Now, it works. Cool....Yes, the OpsiveBridge script is separate. You have to create a script with that name and paste the code provided in the instructions into that script. Then you attach that script to the EmeraldAI agent.