728x90
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour
{
int intValue;
float floatValue = 10.5f;
float floatValue2 = 20.1f;
// void 함수의 처리 결과에 아무런 반환값이 없을 때 사용
void FloatToint(float parameter, float parameter2, string stringParm = "디폴트"){//stringParm의 값이 없으면 디폴트가 입력
intValue = (int)parameter// 강제 형 변환을 일으켜줌
print(intValue);
print(stringParm);
}
int FloatToInt(float parameter, float parameter2){
return (int)(parameter + parameter2)
}
// Start is called before the first frame update
void Start()//게임이 시작될 때 최초 1회 진행되는 아이
{
FloatToint(floatValue, floatValue2, "테스트");
print(FloatToInt(floatValue, floatValue2));
}
// Update is called once per frame
void Update()
{
}
}
728x90