반응형
반응형
Appbar centerTitle : 텍스트 가운데 정렬 여부 automaticallyImplyLeading : 뒤로가기 버튼 제거 여부 elevation : 그림자 제거 backgroundColor : 배경 색 title : 제목 leading : 왼쪽 아이콘 버튼 actions : 오른쪽 아이콘 버튼 예시 코드 Widget build(BuildContext context) { return Scaffold( appBar: AppBar( centerTitle: true, automaticallyImplyLeading: true, elevation: 0, backgroundColor: Colors.white, title: Text("제목"), leading: IconButton( icon: Icon(Ico..
패키지 정보 assets_audio_player | Flutter Package Play music/audio stored in assets files directly from Flutter & Network, Radio, LiveStream, Local files. Compatible with Android, iOS, web and macOS. pub.dev 터미널 설치 flutter pub add assets_audio_player pubspec.yaml 설정 flutter: assets: - assets/audios/ 코드 작성 import 'package:assets_audio_player/assets_audio_player.dart'; import 'package:flutter/material...
코드 작성using UnityEngine;public class Example : MonoBehaviour{ // Rigidbody 컴포넌트 Rigidbody rb; // 힘의 크기를 조절하는 변수 public float forceAmount = 10.0f; void Start() { // Rigidbody 컴포넌트 가져오기 rb = GetComponent(); } void Update() { // "스페이스바" 키를 누르면 힘을 적용 if (Input.GetKeyDown(KeyCode.Space)) { // Rigidbody에 지속적인 힘을 가함 rb.A..
유니티 C# 일정거리 범위 안에 목표물 체크 Vector3.Distance코드 작성using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class Example : MonoBehaviour{ public Transform target; float dist; void Update() { dist = Vector3.Distance(target.transform.position, transform.position); if(dist 다른 기능 구현 유니티 C# 플레이어 추적하는 Monster AI 간단 구현코드 작성using Unit..
코드 작성 캐릭터 피격 후 무적 시간 애니메이션으로 사용할 수 있습니다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Flicker : MonoBehaviour { private SpriteRenderer spriteRenderer; public float delay = 0.5f; //딜레이 public int repeat = 4; //반복 횟수 int value = 0; private void Awake() { spriteRenderer = GetComponent(); } public void Hit() { value = repeat; StartCoroutine(FlickerCorou..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class FollowLine : MonoBehaviour { public Transform[] Points; public IEnumerator GetPathEnumerator() { if (Points == null || Points.Length < 1) yield break; var direction = 1; var index = 0; while (true) { yield return Points[index]; if (index = Points.Length - 1) direction = -1; index = index + direction..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraController : MonoBehaviour { public float offsetX = 10; public float offsetY = 10; public float offsetZ = 10; void LateUpdate() { transform.position = new Vector3( Mathf.Clamp(Camera.main.transform.position.x, -offsetX, offsetX), Mathf.Clamp(Camera.main.transform.position.y, -offsetY, offsetY)..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class FollowCamera : MonoBehaviour { public GameObject target; public float offsetX = 0.0f; public float offsetY = 0.0f; public float offsetZ = 0.0f; Vector3 targetPos; void FixedUpdate() { targetPos = new Vector3(target.transform.position.x + offsetX,target.transform.position.y + offsetY,target.transform..
코드 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class MoveCamera : MonoBehaviour { public Transform targetPosition; public float smoothTime = 0.3f; private Vector3 velocity = Vector3.zero; public bool isActive = false; private void Start() { isActive = true; } private void Update() { if (isActive) { Camera.main.transform.position = Vector3.SmoothDamp(C..
코드 작성using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class Example : MonoBehaviour{ public Text nickNameText; void Start() { nickNameText.text = "" + "닉네임" + ""; //파란색으로 변경 nickNameText.text = "" + "닉네임" + ""; //초록색으로 변경 }}
플러터 Flutter 설치 https://docs.flutter.dev/get-started/install Install Install Flutter and get started. Downloads available for Windows, macOS, Linux, and Chrome OS operating systems. docs.flutter.dev Visual Stuido Code 설치 https://code.visualstudio.com/ Visual Studio Code - Code Editing. Redefined Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and ..
코드 작성 using System; using System.Collections; using UnityEngine; using Photon.Pun; using Photon.Realtime; using UnityEngine.UI; public class NetworkManager : MonoBehaviourPunCallbacks { int hp = 100; public Text hpText; public PhotonView PV; private void Start() { StartTimer(); } void StartTimer() { if(PhotonNetwork.IsMasterClient) { hp = 100; StartCoroutine(TimerCoroution()); } } IEnumerator Ti..