i’m new to Unity and C# but i’m use to develop on C++. So Right now on my script i define one Class for structure and one other class to match the unity behaviour. :
For example
using UnityEngine;
using System.Collections;
public class A
{
public float A_var;
...
}
public class B: MonoBehaviour {
// Use this for initialization
void Start () {
A a = new A();
}
}
So i was wondering what i m suppose to do to define the Code of the Class A somewhere else (on an other file.cs) .
I guess on the script where is define my B behaviour i’m suppose to include the script where is definie A.
How can i do that ?
For instance :
Code : A.cs
using UnityEngine;
using System.Collections;
public class A
{
public float A_var;
...
}
And Code : B.cs :
using UnityEngine;
using System.Collections;
using A ?????
public class B: MonoBehaviour {
// Use this for initialization
void Start () {
A a = new A();
}
}
Thanks