65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class GameScene : BaseScene
|
|
{
|
|
protected override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
_sceneType = Define.Scene.Game;
|
|
Manager.UI.UIList = new List<string> { "ExpBar" , "JoyStick"};
|
|
var onList = new[] {"ExpBar", "JoyStick"};
|
|
foreach (var list in onList)
|
|
{
|
|
Manager.UI.SwitchOnObject(list, true);
|
|
}
|
|
Manager.UI.ExclusiveExpBar();
|
|
// CreateJoyStick();
|
|
CreateButtons();
|
|
CreateSpawner();
|
|
}
|
|
void CreateJoyStick()
|
|
{
|
|
// GameObject joystick = Manager.Resource.Instantiate("Prefabs/UI/VirtualJoyStick", GameObject.Find("@Canvas").transform);
|
|
// joystick.AddComponent<VirtualJoystick>();
|
|
}
|
|
|
|
void CreateButtons()
|
|
{
|
|
Button_Action buttons = _canvas.AddComponent<Button_Action>();
|
|
|
|
// 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()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|