Creating classes that function between js and c#

I need to be able to pass arbitrary data between components in my scene, the best way to do this it seems is to create a class.

The problem is that I seem unable to pass my custom class between js and c#.

Is this possible, if so how?

The way I’m trying to use this info is when the player does damage to an enemy and I want to broadcast quite a bit of info to that enemy (amount of damage, direction of damage, force of damage, a pointer back to the player, etc.)

I hope you guys understand what I’m getting at.

Thanks for any help.

Yes, there are several ways. You can use GetComponent(scriptName) with a type or string (probably a string if you are using js and c#) Then you can access vars and methods by going cachedScript.method/variable. You can only change variables if the protection level allows it of course. Or, if you are doing damage related tasks, the most common way is to go enemyWeHit.BroadCastMessage("ApplyDamage", damageVariable) this searches through all the scripts of the enemy object for a function called ApplyDamage and passes DamageVariable as an argument.[/i]