반응형
반응형
유니티 플레이팹 구글 로그인 Sign In with Google 간단 구현구글 로그인 SDK 설치 GitHub - playgameservices/play-games-plugin-for-unity: Google Play Games plugin for UnityGoogle Play Games plugin for Unity. Contribute to playgameservices/play-games-plugin-for-unity development by creating an account on GitHub.github.com 구글 로그인 구현using GooglePlayGames;using GooglePlayGames.BasicApi;using PlayFab;using PlayFab.ClientModels;..
유니티 플레이팹 게스트 로그인 Sign In with Guest 간단 사용법using PlayFab;using PlayFab.ClientModels;using PlayFab.Json;using PlayFab.ProfilesModels;using System;using System.Collections;using System.Collections.Generic;using System.Linq;using UnityEngine;using EntityKey = PlayFab.ProfilesModels.EntityKey;public class PlayfabManager : MonoBehaviour{ private string customId = ""; private string playfabId = "..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Example : MonoBehaviour { public Text versionText; private void Awake() { Application.targetFrameRate = 60; //프레임 조절 Screen.sleepTimeout = SleepTimeout.NeverSleep; //잠들지 않도록 설정 Screen.sleepTimeout = SleepTimeout.SystemSetting; //시스템 설정 사용 versionText.text = Application.version;..
델리게이트 선언 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Example : MonoBehaviour { public delegate void GameEvent(); //이벤트 선언 public static event GameEvent eGameStart, eGamePause, eGameEnd; public delegate void ScoreEvent(int number); //이벤트 선언 public static event ScoreEvent ePlusScore, eMinusScore; private void Start() { eGameStar..
데이터 저장 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { private void SetValue() { PlayerPrefs.SetFloat("Apple", 1.0f); PlayerPrefs.SetInt("Orange", 1); PlayerPrefs.SetString("Banana", "Banana"); } } 데이터 불러오기 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { pri..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Example : MonoBehaviour { public Text timerText; public int timer = 0; private void Start() { StartCoroutine(TimerCoroution()); } IEnumerator TimerCoroution() { timer += 1; timerText.text = (timer / 3600).ToString("D2") + ":" + (timer / 60 % 60).ToString("D2") + ":" + (timer % ..
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Example : MonoBehaviour { public void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Player") { Debug.Log("플레이어와 접촉 시작"); } } public void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Player") { Debug.Log("3D 플레이어와 접촉중"); } } public void OnTriggerExit(Col..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class Example : MonoBehaviour { private void Start() { StartCoroutine(DelayCoroution()); Invoke("Delay", 5); } IEnumerator DelayCoroution() { yield return new WaitForSeconds(5); Debug.Log("5초가 지났습니다."); } void Delay() { Debug.Log("5초가 지났습니다."); } } ..
씬 동기 로드 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class Example : MonoBehaviour { public void LoadScene(int number) { SceneManager.LoadScene(number); } public void LoadScene(string name) { SceneManager.LoadScene(name); } } 씬 비동기 로드 using System.Collections; using System.Collections.Generic; using..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { public int minNumber = 0; public int maxNumber = 10; void Start() { int random = Random.Range(0, 10); Debug.Log(random); int random2 = Random.Range(minNumber, maxNumber); Debug.Log(random2); } } 유니티 Api 참조 https://docs.unity3d.com/kr/530/ScriptReference/Random.Range.html Ra..
파이어베이스 SDK 다운로드 Unity 프로젝트에 Firebase 추가 | Unity용 Firebase 의견 보내기 Unity 프로젝트에 Firebase 추가 Firebase Unity SDK를 활용하여 Unity 게임을 업그레이드 해보세요. Firebase를 Unity 프로젝트에 연결하는 것이 얼마나 간편한지 보여드리기 위해 Google은 MechaHamst firebase.google.com 압축 푼 뒤 dotnet4 / FirebaseAnalytics.unitypackage 설치 코드 작성 using Firebase; using Firebase.Analytics; using System.Collections; using System.Collections.Generic; using UnityEngin..
코드 작성 using System.Collections; using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using UnityEngine; public class NickNameManager : MonoBehaviour { public InputField inputField; public void CheckNickName() { string Check = Regex.Replace(inputField.text, @"[^a-zA-Z0-9가-힣]", "", RegexOptions.Singleline); Check = Regex.Replace(inputField.text, @"[^\w\.@-]", ""..