example.cs
========================================================
using UnityEngine;
using System.Collections;
namespace exampleNS{
public class example : MonoBehaviour{
public static bool DoSomething(int abc){
bool somebool = false;
if(abc == 1){
somebool = true;
}
return somebool;
}
}
public class example2 : MonoBehaviour{
public static bool DoSomthing2(int abb){
// do something....
}
}
}
========================================================
sample.cs
========================================================
using UnityEngine;
using System.Collections;
using exampleNS;
public class sample: MonoBehaviour{
int somesome = 3;
void Start(){
if(example.DoSomething(somesome)){
Debug.Log("true");
}else{
Debug.Log("false");
}
}
}
https://funfunhanblog.tistory.com/80
C#) 네임스페이스 / 유니티 네임스페이스
C#) 네임스페이스 가끔 "네임스페이스에 형식또는 네임스페이스 이름이 없습니다."라는 문구를 볼때가 있다. 네임스페이스를 알아보기 전에 작업 하다가 생긴 오류를 살펴보자 Define클래스 인터페이스나 enum같..
funfunhanblog.tistory.com
'Unity' 카테고리의 다른 글
[Unity] Make Button Toggle a GameObject On and Off (0) | 2019.11.01 |
---|---|
[Unity] Material, Shader, Texture, Light (0) | 2019.11.01 |
[Unity] 유용한 단축키 정리하기 :D (0) | 2019.10.31 |
[Unity] transform Component 사용 (0) | 2019.10.30 |
[Unity] Json을 이용한 저장/불러오기 방법 (0) | 2019.10.30 |