namespaceで名前空間を定義します。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace FolderA{
public class A : MonoBehaviour{
void Start(){
}
void Update(){
}
}
}
名前空間を入れ子にすることも可能です。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace FolderA{
namespace FolderB{
public class A : MonoBehaviour{
void Start(){
}
void Update(){
}
}
}
}
作成した名前空間にアクセスします。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FolderA;
public class A : MonoBehaviour{
void Start(){
A a = GetComponent<A>();
}
void Update(){
}
}