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
'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 |