2018-11-20 20:10:49 +01:00
|
|
|
using Fie.Core;
|
|
|
|
using Fie.Manager;
|
|
|
|
using Fie.Scene;
|
|
|
|
using GameDataEditor;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
namespace Fie.DebugUtility {
|
|
|
|
public class FieDebugGameSceneBoot : MonoBehaviour {
|
|
|
|
[Range(1f, 3f)]
|
|
|
|
[SerializeField]
|
|
|
|
private int playerNum = 1;
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
[SerializeField]
|
|
|
|
private List<FieGameCharacter> _debugCharacters = new List<FieGameCharacter>();
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
[SerializeField]
|
|
|
|
private List<FieGameCharacter.IntelligenceType> _debugCharactersIntelligenceTypes = new List<FieGameCharacter.IntelligenceType>();
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
[SerializeField]
|
|
|
|
private List<string> _debugCharactersNames = new List<string>();
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
[SerializeField]
|
|
|
|
private List<FieConstValues.FieSkill> _debugSkills = new List<FieConstValues.FieSkill>();
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
private void Awake() {
|
|
|
|
if (!FieBootstrap.isBootedFromBootStrap
|
|
|
|
&& _debugCharacters.Count == _debugCharactersIntelligenceTypes.Count
|
|
|
|
&& _debugCharactersIntelligenceTypes.Count == _debugCharactersNames.Count
|
|
|
|
&& _debugCharacters.Count == _debugCharactersNames.Count) {
|
2018-11-20 20:10:49 +01:00
|
|
|
|
2018-11-21 21:16:20 +01:00
|
|
|
PhotonNetwork.offlineMode = true;
|
|
|
|
PhotonNetwork.InstantiateInRoomOnly = false;
|
|
|
|
|
|
|
|
FieManagerFactory.I.currentSceneType = FieSceneType.INGAME;
|
|
|
|
FieManagerBehaviour<FieSceneManager>.I.StartUp();
|
|
|
|
FieManagerBehaviour<FieSaveManager>.I.StartUp();
|
|
|
|
FieManagerBehaviour<FieFaderManager>.I.StartUp();
|
|
|
|
FieManagerBehaviour<FieEnvironmentManager>.I.StartUp();
|
|
|
|
FieManagerBehaviour<FieUserManager>.I.nowPlayerNum = playerNum;
|
|
|
|
FieManagerBehaviour<FieUserManager>.I.StartUp();
|
|
|
|
|
|
|
|
List<GDESkillTreeData> list = FieMasterData<GDESkillTreeData>.FindMasterDataList(delegate (GDESkillTreeData data) {
|
|
|
|
return _debugSkills.Contains((FieConstValues.FieSkill)data.ID);
|
|
|
|
});
|
|
|
|
|
|
|
|
for (int i = 0; i < playerNum; i++) {
|
|
|
|
_debugCharacters[i].intelligenceType = _debugCharactersIntelligenceTypes[i];
|
|
|
|
|
|
|
|
if (list != null && list.Count > 0) {
|
|
|
|
FieSaveManager.debugSkills = list;
|
|
|
|
}
|
|
|
|
|
|
|
|
FieManagerBehaviour<FieUserManager>.I.SetUserName(i, _debugCharactersNames[i]);
|
|
|
|
FieManagerBehaviour<FieUserManager>.I.SetUserCharacterPrefab(i, _debugCharacters[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Start() {
|
|
|
|
FieManagerBehaviour<FieInGameStateManager>.I.StartUp();
|
|
|
|
}
|
|
|
|
}
|
2018-11-20 20:10:49 +01:00
|
|
|
}
|