Practice_Unity/Assets/Scripts/Scenes/GameScene.cs
Seonkyu.kim 488c0858ad 작업
1. UI 버튼 작업 했음
2. 칼, 방패 따로 붙이는 작업 헀음
3. 공격 모션에 이제 버튼 연동함

Todo
1. 공격시 화면 이상하게 흔들리는거 수정할 차례
2. 히트 박스 해서 몬스터 공격하는거 연동하기
2025-09-29 17:59:40 +09:00

57 lines
1.5 KiB
C#

using System;
using Unity.VisualScripting;
using UnityEngine;
public class GameScene : BaseScene
{
protected override void Init()
{
base.Init();
_sceneType = Define.Scene.Game;
CreateJoyStick();
CreateButtons();
CreateSpawner();
}
void CreateJoyStick()
{
GameObject joystick = Manager.Resource.Instantiate("Prefabs/UI/VirtualJoyStick", GameObject.Find("@Canvas").transform);
joystick.AddComponent<VirtualJoystick>();
}
void CreateButtons()
{
VirtualButtons buttons = _canvas.AddComponent<VirtualButtons>();
// if (buttons != null)
// {
// buttons.SetSkillButtonEvent(0, () => Debug.Log("Skill 1 Button Clicked"));
// buttons.SetSkillButtonEvent(1, () => Debug.Log("Skill 2 Button Clicked"));
// buttons.SetSkillButtonEvent(2, () => Debug.Log("Skill 3 Button Clicked"));
// // buttons.SetSkillButtonEvent(3, () => Debug.Log("Skill 4 Button Clicked"));
// }
}
void CreateSpawner()
{
GameObject spawner = Manager.Resource.Instantiate("Prefabs/UI/Spawner", GameObject.Find("@Scene").transform);
var spawn = spawner.AddComponent<SpawnController>();
spawn.EnemyPrefabPath = "Prefabs/Characters/Test_Enemy";
spawn.EnemyDataPath = "Data/E_Test1";
}
private void Update()
{
}
public override void Clear()
{
}
}