Let us say I have two scripts: A and B.
I want to be able to use a class or struct between them, for example:
class C
{
// some definition
int val;
}
file A.cs
public class A : MonoBehaviour
{
public DoSomething(C inC)
{
// do something
}
}
file B.cs
public class B : MonoBehaviour
{
public A a;
public Update()
{
C c;
c.val = 3;
a.DoSomething(c);
}
}
So my questions are: where should I define C? what should I do so that A and B will be able to use it? would I have to do anything different if I define C as a struct?