+ 주인공 스킬(검의 왈츠)가 추가되었습니다. ㄴ 검의 왈츠 애니메이션이 추가되었습니다. ㄴ 스킬에 맞게 UI를 표시합니다. + 주인공이 더 이상 공격 중에 이동할 수 없습니다. + 새로운 스킬 시스템으로 변경하였습니다. + Combat씬에서 사용할 Camera, Ui를 추가하였습니다. + Input Action이 변경 되었습니다. (UseSkill => ActivateMainSkill) + Idamameable 인터페이스에 GetCurrentHp() 기능이 추가되었습니다. ㄴ 변경에 따라 기존 스크립트들에 추가되었습니다.
100 lines
3.2 KiB
C#
100 lines
3.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
[DefaultExecutionOrder(-1)]
|
|
public class GameManager : Singleton<GameManager>
|
|
{
|
|
// 섬 안의 플레이어 모드 선택
|
|
[field: Title("InIsland Data")]
|
|
[field: SerializeField] public GlobalValue.InIslandPlayerMode IslandPlayerMode { get; private set; }
|
|
[field: Required("Viking Prefab을 넣어주세요.")]
|
|
[field: SerializeField] public GameObject InIslandPlayerPrefab { get; private set; }
|
|
[field: SerializeField] public List<Crewmate> CrewmatePrefabList { get; private set; }
|
|
[field: SerializeField] public List<Crewmate> CurrentCrewmateList { get; set; }
|
|
public IInIslandPlayer CurrentInIslandPlayer { get; set; }
|
|
|
|
[Title("Tycoon")]
|
|
public TycoonPlayer TycoonPlayer { get; private set; }
|
|
public bool IsBuildMode { get; set; }
|
|
|
|
// Game Data
|
|
[Title("Game Data")]
|
|
[Range(0f, 1f)]
|
|
[SerializeField] private float slowSpeed = 0.1f;
|
|
|
|
private const string IN_ISLAND_PLAYER_NAME = "InIslandPlayer";
|
|
|
|
private void Init()
|
|
{
|
|
TycoonPlayer = FindAnyObjectByType<TycoonPlayer>();
|
|
}
|
|
protected override void OnAwake()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
Cursor.lockState = CursorLockMode.Confined;
|
|
}
|
|
|
|
public IEnumerator ApplySlowMotion(float targetTimeScale, float duration)
|
|
{
|
|
var startScale = Time.timeScale;
|
|
var time = 0f;
|
|
|
|
while (time < duration)
|
|
{
|
|
Time.timeScale = Mathf.Lerp(startScale, targetTimeScale, time / duration);
|
|
Time.fixedDeltaTime = 0.02f * Time.timeScale;
|
|
time += Time.unscaledDeltaTime;
|
|
yield return null;
|
|
}
|
|
|
|
Time.timeScale = targetTimeScale;
|
|
}
|
|
|
|
public void SlowSpeedMode()
|
|
{
|
|
Time.timeScale = slowSpeed;
|
|
Time.fixedDeltaTime = 0.02f * Time.timeScale;
|
|
}
|
|
|
|
public void DefaultSpeedMode()
|
|
{
|
|
Time.timeScale = 1f;
|
|
Time.fixedDeltaTime = 0.02f;
|
|
}
|
|
|
|
public void SetCurrentInIslandPlayer(IInIslandPlayer inIslandPlayer)
|
|
{
|
|
// PlayerInput currentPlayerInput;
|
|
//
|
|
// if (CurrentInIslandPlayer != null)
|
|
// {
|
|
// currentPlayerInput = CurrentInIslandPlayer.Transform.GetComponent<PlayerInput>();
|
|
// if (currentPlayerInput != null)
|
|
// {
|
|
// currentPlayerInput.enabled = false;
|
|
// }
|
|
// }
|
|
//
|
|
// CurrentInIslandPlayer = inIslandPlayer;
|
|
// InIslandCamera.Inst.SetTarget(inIslandPlayer.Transform);
|
|
//
|
|
// currentPlayerInput = CurrentInIslandPlayer.Transform.GetComponent<PlayerInput>();
|
|
// if (currentPlayerInput != null)
|
|
// {
|
|
// currentPlayerInput.enabled = true;
|
|
// }
|
|
}
|
|
}
|
|
}
|