add some extra assets FX and SFX
This commit is contained in:
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveDialogInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveElementsOnSceneInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveGameInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveInventoryBankInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveMeleeWeaponsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveMissionsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -7,311 +7,332 @@ using System;
|
||||
|
||||
public class savePlayerBlendshapesInfo : saveGameInfo
|
||||
{
|
||||
public characterCustomizationBlendshapesHelper mainCharacterCustomizationBlendshapesHelper;
|
||||
public characterCustomizationBlendshapesHelper mainCharacterCustomizationBlendshapesHelper;
|
||||
|
||||
List<persistanceBlendshapesInfo> persistanceInfoList;
|
||||
List<persistanceBlendshapesInfo> persistanceInfoList;
|
||||
|
||||
List<string> accessoriesList = new List<string> ();
|
||||
List<string> accessoriesList = new List<string> ();
|
||||
|
||||
public override void saveGame (int saveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
saveGameContent (saveNumber, playerID, currentSaveDataPath, showDebugInfo, savingGameToChangeScene);
|
||||
}
|
||||
int characterModelID;
|
||||
|
||||
public override void loadGame (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
loadGameContent (saveNumberToLoad, playerID, currentSaveDataPath, showDebugInfo);
|
||||
}
|
||||
|
||||
public override void initializeValuesOnComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
}
|
||||
bool loadInfoFound;
|
||||
|
||||
public void saveGameContent (int currentSaveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
if (mainCharacterCustomizationBlendshapesHelper == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
public override void saveGame (int saveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
saveGameContent (saveNumber, playerID, currentSaveDataPath, showDebugInfo, savingGameToChangeScene);
|
||||
}
|
||||
|
||||
print ("Saving player blendshapes");
|
||||
}
|
||||
|
||||
bool saveLocated = false;
|
||||
bool playerLocated = false;
|
||||
|
||||
int saveSlotIndex = -1;
|
||||
int listIndex = -1;
|
||||
public override void loadGame (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
loadGameContent (saveNumberToLoad, playerID, currentSaveDataPath, showDebugInfo);
|
||||
}
|
||||
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file;
|
||||
public override void initializeValuesOnComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
}
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.storeBlendshapesCustomization ();
|
||||
public void saveGameContent (int currentSaveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
if (mainCharacterCustomizationBlendshapesHelper == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
persistancePlayerBlendshapesInfo blendShapeListToSave = getPersistanceList (playerID, showDebugInfo);
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
persistanceBlendshapesListBySaveSlotInfo newPersistanceListBySaveSlotInfo = new persistanceBlendshapesListBySaveSlotInfo ();
|
||||
|
||||
List<persistanceBlendshapesListBySaveSlotInfo> infoListToSave = new List<persistanceBlendshapesListBySaveSlotInfo> ();
|
||||
print ("Saving player blendshapes");
|
||||
}
|
||||
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToSave = currentData as List<persistanceBlendshapesListBySaveSlotInfo>;
|
||||
bool saveLocated = false;
|
||||
bool playerLocated = false;
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
int saveSlotIndex = -1;
|
||||
int listIndex = -1;
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("Number of save list for player blendshapes " + infoListToSave.Count);
|
||||
}
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file;
|
||||
|
||||
int infoListToSaveCount = infoListToSave.Count;
|
||||
mainCharacterCustomizationBlendshapesHelper.storeBlendshapesCustomization ();
|
||||
|
||||
for (int j = 0; j < infoListToSaveCount; j++) {
|
||||
if (saveSlotIndex == -1) {
|
||||
persistanceBlendshapesListBySaveSlotInfo currentSlot = infoListToSave [j];
|
||||
persistancePlayerBlendshapesInfo blendShapeListToSave = getPersistanceList (playerID, showDebugInfo);
|
||||
|
||||
if (ignoreSaveNumberOnSaveLoadInfo || currentSlot.saveNumber == currentSaveNumber) {
|
||||
newPersistanceListBySaveSlotInfo = currentSlot;
|
||||
saveLocated = true;
|
||||
saveSlotIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
persistanceBlendshapesListBySaveSlotInfo newPersistanceListBySaveSlotInfo = new persistanceBlendshapesListBySaveSlotInfo ();
|
||||
|
||||
if (saveLocated) {
|
||||
int listCount = newPersistanceListBySaveSlotInfo.playerBlendshapesList.Count;
|
||||
List<persistanceBlendshapesListBySaveSlotInfo> infoListToSave = new List<persistanceBlendshapesListBySaveSlotInfo> ();
|
||||
|
||||
int playerIDToSearch = blendShapeListToSave.playerID;
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToSave = currentData as List<persistanceBlendshapesListBySaveSlotInfo>;
|
||||
|
||||
for (int j = 0; j < listCount; j++) {
|
||||
if (listIndex == -1) {
|
||||
if (ignorePlayerIDOnSaveLoadInfo ||
|
||||
newPersistanceListBySaveSlotInfo.playerBlendshapesList [j].playerID == playerIDToSearch) {
|
||||
playerLocated = true;
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
if (showDebugInfo) {
|
||||
print ("Number of save list for player blendshapes " + infoListToSave.Count);
|
||||
}
|
||||
|
||||
print ("EXTRA INFO\n");
|
||||
print ("PLAYER BLENDSHAPES");
|
||||
print ("Number of blendshpaes: " + blendShapeListToSave.blendshapesList.Count);
|
||||
print ("Current Save Number " + currentSaveNumber);
|
||||
print ("Save Located " + saveLocated);
|
||||
print ("Player Located " + playerLocated);
|
||||
int infoListToSaveCount = infoListToSave.Count;
|
||||
|
||||
print ("Save List Index " + listIndex);
|
||||
}
|
||||
for (int j = 0; j < infoListToSaveCount; j++) {
|
||||
if (saveSlotIndex == -1) {
|
||||
persistanceBlendshapesListBySaveSlotInfo currentSlot = infoListToSave [j];
|
||||
|
||||
//if the save is located, check if the player id exists
|
||||
if (saveLocated) {
|
||||
//if player id exists, overwrite it
|
||||
if (playerLocated) {
|
||||
infoListToSave [saveSlotIndex].playerBlendshapesList [listIndex] = blendShapeListToSave;
|
||||
} else {
|
||||
infoListToSave [saveSlotIndex].playerBlendshapesList.Add (blendShapeListToSave);
|
||||
}
|
||||
} else {
|
||||
newPersistanceListBySaveSlotInfo.saveNumber = currentSaveNumber;
|
||||
newPersistanceListBySaveSlotInfo.playerBlendshapesList.Add (blendShapeListToSave);
|
||||
if (ignoreSaveNumberOnSaveLoadInfo || currentSlot.saveNumber == currentSaveNumber) {
|
||||
newPersistanceListBySaveSlotInfo = currentSlot;
|
||||
saveLocated = true;
|
||||
saveSlotIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
infoListToSave.Add (newPersistanceListBySaveSlotInfo);
|
||||
}
|
||||
if (saveLocated) {
|
||||
int listCount = newPersistanceListBySaveSlotInfo.playerBlendshapesList.Count;
|
||||
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.OpenOrCreate);
|
||||
bf.Serialize (file, infoListToSave);
|
||||
int playerIDToSearch = blendShapeListToSave.playerID;
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
for (int j = 0; j < listCount; j++) {
|
||||
if (listIndex == -1) {
|
||||
if (ignorePlayerIDOnSaveLoadInfo ||
|
||||
newPersistanceListBySaveSlotInfo.playerBlendshapesList [j].playerID == playerIDToSearch) {
|
||||
playerLocated = true;
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadGameContent (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
if (mainCharacterCustomizationBlendshapesHelper == null) {
|
||||
return;
|
||||
}
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
print ("EXTRA INFO\n");
|
||||
print ("PLAYER BLENDSHAPES");
|
||||
print ("Number of blendshpaes: " + blendShapeListToSave.blendshapesList.Count);
|
||||
print ("Current Save Number " + currentSaveNumber);
|
||||
print ("Save Located " + saveLocated);
|
||||
print ("Player Located " + playerLocated);
|
||||
|
||||
print ("Loading player blendshapes with PLAYER ID " + playerID);
|
||||
}
|
||||
|
||||
persistanceInfoList = new List<persistanceBlendshapesInfo> ();
|
||||
print ("Save List Index " + listIndex);
|
||||
}
|
||||
|
||||
List<persistanceBlendshapesListBySaveSlotInfo> infoListToLoad = new List<persistanceBlendshapesListBySaveSlotInfo> ();
|
||||
//if the save is located, check if the player id exists
|
||||
if (saveLocated) {
|
||||
//if player id exists, overwrite it
|
||||
if (playerLocated) {
|
||||
infoListToSave [saveSlotIndex].playerBlendshapesList [listIndex] = blendShapeListToSave;
|
||||
} else {
|
||||
infoListToSave [saveSlotIndex].playerBlendshapesList.Add (blendShapeListToSave);
|
||||
}
|
||||
} else {
|
||||
newPersistanceListBySaveSlotInfo.saveNumber = currentSaveNumber;
|
||||
newPersistanceListBySaveSlotInfo.playerBlendshapesList.Add (blendShapeListToSave);
|
||||
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToLoad = currentData as List<persistanceBlendshapesListBySaveSlotInfo>;
|
||||
infoListToSave.Add (newPersistanceListBySaveSlotInfo);
|
||||
}
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.OpenOrCreate);
|
||||
bf.Serialize (file, infoListToSave);
|
||||
|
||||
if (saveNumberToLoad > -1) {
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
if (showDebugInfo) {
|
||||
print (infoListToLoad.Count);
|
||||
}
|
||||
public void loadGameContent (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
if (mainCharacterCustomizationBlendshapesHelper == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
persistanceBlendshapesListBySaveSlotInfo newPersistanceListBySaveSlotInfo = new persistanceBlendshapesListBySaveSlotInfo ();
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
int infoListToLoadCount = infoListToLoad.Count;
|
||||
print ("Loading player blendshapes with PLAYER ID " + playerID);
|
||||
}
|
||||
|
||||
bool slotLocated = false;
|
||||
persistanceInfoList = new List<persistanceBlendshapesInfo> ();
|
||||
|
||||
for (int j = 0; j < infoListToLoadCount; j++) {
|
||||
if (!slotLocated) {
|
||||
persistanceBlendshapesListBySaveSlotInfo currentSlot = infoListToLoad [j];
|
||||
List<persistanceBlendshapesListBySaveSlotInfo> infoListToLoad = new List<persistanceBlendshapesListBySaveSlotInfo> ();
|
||||
|
||||
bool checkSlot = false;
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToLoad = currentData as List<persistanceBlendshapesListBySaveSlotInfo>;
|
||||
|
||||
if (ignoreSaveNumberOnSaveLoadInfo) {
|
||||
checkSlot = true;
|
||||
}
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
if (saveNumberToIgnoreSaveLoadInfo == saveNumberToLoad && saveNumberToIgnoreSaveLoadInfo > -1) {
|
||||
checkSlot = true;
|
||||
}
|
||||
loadInfoFound = false;
|
||||
|
||||
if (currentSlot.saveNumber == saveNumberToLoad) {
|
||||
checkSlot = true;
|
||||
}
|
||||
if (saveNumberToLoad > -1) {
|
||||
|
||||
if (checkSlot) {
|
||||
newPersistanceListBySaveSlotInfo = currentSlot;
|
||||
if (showDebugInfo) {
|
||||
print (infoListToLoad.Count);
|
||||
}
|
||||
|
||||
slotLocated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
persistanceBlendshapesListBySaveSlotInfo newPersistanceListBySaveSlotInfo = new persistanceBlendshapesListBySaveSlotInfo ();
|
||||
|
||||
int listIndex = -1;
|
||||
int infoListToLoadCount = infoListToLoad.Count;
|
||||
|
||||
int listCount = newPersistanceListBySaveSlotInfo.playerBlendshapesList.Count;
|
||||
bool slotLocated = false;
|
||||
|
||||
for (int j = 0; j < listCount; j++) {
|
||||
if (listIndex == -1) {
|
||||
bool checkSlot = false;
|
||||
for (int j = 0; j < infoListToLoadCount; j++) {
|
||||
if (!slotLocated) {
|
||||
persistanceBlendshapesListBySaveSlotInfo currentSlot = infoListToLoad [j];
|
||||
|
||||
if (ignorePlayerIDOnSaveLoadInfo) {
|
||||
checkSlot = true;
|
||||
}
|
||||
bool checkSlot = false;
|
||||
|
||||
if (saveNumberToIgnoreSaveLoadInfo == saveNumberToLoad && saveNumberToIgnoreSaveLoadInfo > -1) {
|
||||
checkSlot = true;
|
||||
}
|
||||
if (ignoreSaveNumberOnSaveLoadInfo) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
if (newPersistanceListBySaveSlotInfo.playerBlendshapesList [j].playerID == playerID) {
|
||||
checkSlot = true;
|
||||
}
|
||||
if (saveNumberToIgnoreSaveLoadInfo == saveNumberToLoad && saveNumberToIgnoreSaveLoadInfo > -1) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
if (checkSlot) {
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentSlot.saveNumber == saveNumberToLoad) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
if (listIndex > -1) {
|
||||
persistancePlayerBlendshapesInfo blendshapeListToLoad = newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex];
|
||||
if (checkSlot) {
|
||||
newPersistanceListBySaveSlotInfo = currentSlot;
|
||||
|
||||
persistanceInfoList.AddRange (newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex].blendshapesList);
|
||||
slotLocated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
accessoriesList.AddRange (newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex].accessoriesList);
|
||||
}
|
||||
}
|
||||
int listIndex = -1;
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
int listCount = newPersistanceListBySaveSlotInfo.playerBlendshapesList.Count;
|
||||
|
||||
print ("PLAYER BLENDSHAPES");
|
||||
for (int j = 0; j < listCount; j++) {
|
||||
if (listIndex == -1) {
|
||||
bool checkSlot = false;
|
||||
|
||||
print ("Blendshapes Loaded in Save Number " + saveNumberToLoad);
|
||||
print ("Number of objects: " + persistanceInfoList.Count);
|
||||
if (ignorePlayerIDOnSaveLoadInfo) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
for (int j = 0; j < persistanceInfoList.Count; j++) {
|
||||
persistanceBlendshapesInfo currentPersistanceBlendshapesInfo = persistanceInfoList [j];
|
||||
if (saveNumberToIgnoreSaveLoadInfo == saveNumberToLoad && saveNumberToIgnoreSaveLoadInfo > -1) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
print (currentPersistanceBlendshapesInfo.Name + " " + currentPersistanceBlendshapesInfo.blendShapeValue);
|
||||
}
|
||||
}
|
||||
if (newPersistanceListBySaveSlotInfo.playerBlendshapesList [j].playerID == playerID) {
|
||||
checkSlot = true;
|
||||
}
|
||||
|
||||
loadInfoOnMainComponent ();
|
||||
}
|
||||
if (checkSlot) {
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (listIndex > -1) {
|
||||
persistancePlayerBlendshapesInfo blendshapeListToLoad = newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex];
|
||||
|
||||
public persistancePlayerBlendshapesInfo getPersistanceList (int playerID, bool showDebugInfo)
|
||||
{
|
||||
persistancePlayerBlendshapesInfo newPersistancePlayerBlendshapesInfo = new persistancePlayerBlendshapesInfo ();
|
||||
persistanceInfoList.AddRange (newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex].blendshapesList);
|
||||
|
||||
newPersistancePlayerBlendshapesInfo.playerID = playerID;
|
||||
accessoriesList.AddRange (newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex].accessoriesList);
|
||||
|
||||
List<persistanceBlendshapesInfo> newPersistanceBlendshapesInfoList = new List<persistanceBlendshapesInfo> ();
|
||||
characterModelID = newPersistanceListBySaveSlotInfo.playerBlendshapesList [listIndex].characterModelID;
|
||||
|
||||
List<characterCustomizationManager.temporalBlendshapeInfo> temporalBlendshapeInfoList = mainCharacterCustomizationBlendshapesHelper.temporalBlendshapeInfoList;
|
||||
loadInfoFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
int temporalBlendshapeInfoListCount = temporalBlendshapeInfoList.Count;
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
for (int k = 0; k < temporalBlendshapeInfoListCount; k++) {
|
||||
persistanceBlendshapesInfo newPersistanceBlendshapesInfo = new persistanceBlendshapesInfo ();
|
||||
print ("PLAYER BLENDSHAPES");
|
||||
|
||||
characterCustomizationManager.temporalBlendshapeInfo currentBlendshape = temporalBlendshapeInfoList [k];
|
||||
print ("Blendshapes Loaded in Save Number " + saveNumberToLoad);
|
||||
print ("Number of objects: " + persistanceInfoList.Count);
|
||||
|
||||
newPersistanceBlendshapesInfo.Name = currentBlendshape.Name;
|
||||
print ("Character Model ID " + characterModelID);
|
||||
|
||||
newPersistanceBlendshapesInfo.blendShapeValue = currentBlendshape.blendShapeValue;
|
||||
for (int j = 0; j < persistanceInfoList.Count; j++) {
|
||||
persistanceBlendshapesInfo currentPersistanceBlendshapesInfo = persistanceInfoList [j];
|
||||
|
||||
newPersistanceBlendshapesInfoList.Add (newPersistanceBlendshapesInfo);
|
||||
}
|
||||
print (currentPersistanceBlendshapesInfo.Name + " " + currentPersistanceBlendshapesInfo.blendShapeValue);
|
||||
}
|
||||
}
|
||||
|
||||
newPersistancePlayerBlendshapesInfo.blendshapesList = newPersistanceBlendshapesInfoList;
|
||||
loadInfoOnMainComponent ();
|
||||
}
|
||||
|
||||
newPersistancePlayerBlendshapesInfo.accessoriesList = mainCharacterCustomizationBlendshapesHelper.temporalCurrentAccessoriesList;
|
||||
|
||||
return newPersistancePlayerBlendshapesInfo;
|
||||
}
|
||||
public persistancePlayerBlendshapesInfo getPersistanceList (int playerID, bool showDebugInfo)
|
||||
{
|
||||
persistancePlayerBlendshapesInfo newPersistancePlayerBlendshapesInfo = new persistancePlayerBlendshapesInfo ();
|
||||
|
||||
newPersistancePlayerBlendshapesInfo.playerID = playerID;
|
||||
|
||||
void loadInfoOnMainComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
List<persistanceBlendshapesInfo> newPersistanceBlendshapesInfoList = new List<persistanceBlendshapesInfo> ();
|
||||
|
||||
if (persistanceInfoList != null && persistanceInfoList.Count > 0) {
|
||||
List<characterCustomizationManager.temporalBlendshapeInfo> temporalBlendshapeInfoList = mainCharacterCustomizationBlendshapesHelper.temporalBlendshapeInfoList;
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
int temporalBlendshapeInfoListCount = temporalBlendshapeInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
for (int k = 0; k < temporalBlendshapeInfoListCount; k++) {
|
||||
persistanceBlendshapesInfo newPersistanceBlendshapesInfo = new persistanceBlendshapesInfo ();
|
||||
|
||||
persistanceBlendshapesInfo currentPersistanceBlendshapesInfo = persistanceInfoList [i];
|
||||
characterCustomizationManager.temporalBlendshapeInfo currentBlendshape = temporalBlendshapeInfoList [k];
|
||||
|
||||
characterCustomizationManager.temporalBlendshapeInfo newBlendshape = new characterCustomizationManager.temporalBlendshapeInfo ();
|
||||
newPersistanceBlendshapesInfo.Name = currentBlendshape.Name;
|
||||
|
||||
newBlendshape.Name = currentPersistanceBlendshapesInfo.Name;
|
||||
newBlendshape.blendShapeValue = currentPersistanceBlendshapesInfo.blendShapeValue;
|
||||
newPersistanceBlendshapesInfo.blendShapeValue = currentBlendshape.blendShapeValue;
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.temporalBlendshapeInfoList.Add (newBlendshape);
|
||||
}
|
||||
newPersistanceBlendshapesInfoList.Add (newPersistanceBlendshapesInfo);
|
||||
}
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.temporalCurrentAccessoriesList.AddRange (accessoriesList);
|
||||
newPersistancePlayerBlendshapesInfo.blendshapesList = newPersistanceBlendshapesInfoList;
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.setBlendshapeList ();
|
||||
}
|
||||
}
|
||||
newPersistancePlayerBlendshapesInfo.accessoriesList = mainCharacterCustomizationBlendshapesHelper.temporalCurrentAccessoriesList;
|
||||
|
||||
void initializeValues ()
|
||||
{
|
||||
mainCharacterCustomizationBlendshapesHelper.checkMainCHaracterCustomizatationManager ();
|
||||
}
|
||||
newPersistancePlayerBlendshapesInfo.characterModelID = mainCharacterCustomizationBlendshapesHelper.getCurrentCharacterModelID ();
|
||||
|
||||
|
||||
return newPersistancePlayerBlendshapesInfo;
|
||||
}
|
||||
|
||||
|
||||
void loadInfoOnMainComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
|
||||
if (loadInfoFound) {
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.setCurrentCharacterModelID (characterModelID);
|
||||
|
||||
if (persistanceInfoList != null && persistanceInfoList.Count > 0) {
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
|
||||
persistanceBlendshapesInfo currentPersistanceBlendshapesInfo = persistanceInfoList [i];
|
||||
|
||||
characterCustomizationManager.temporalBlendshapeInfo newBlendshape = new characterCustomizationManager.temporalBlendshapeInfo ();
|
||||
|
||||
newBlendshape.Name = currentPersistanceBlendshapesInfo.Name;
|
||||
newBlendshape.blendShapeValue = currentPersistanceBlendshapesInfo.blendShapeValue;
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.temporalBlendshapeInfoList.Add (newBlendshape);
|
||||
}
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.temporalCurrentAccessoriesList.AddRange (accessoriesList);
|
||||
|
||||
mainCharacterCustomizationBlendshapesHelper.setBlendshapeList ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initializeValues ()
|
||||
{
|
||||
mainCharacterCustomizationBlendshapesHelper.checkMainCHaracterCustomizatationManager ();
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/savePlayerBlendshapesInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/savePlayerInventoryInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/savePlayerOptionsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -7,328 +7,328 @@ using System;
|
||||
|
||||
public class savePlayerWeaponsInfo : saveGameInfo
|
||||
{
|
||||
public playerWeaponsManager mainPlayerWeaponsManager;
|
||||
|
||||
List<persistanceWeaponInfo> persistanceInfoList;
|
||||
|
||||
|
||||
public override void saveGame (int saveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
saveGameContent (saveNumber, playerID, currentSaveDataPath, showDebugInfo, savingGameToChangeScene);
|
||||
}
|
||||
|
||||
public override void loadGame (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
loadGameContent (saveNumberToLoad, playerID, currentSaveDataPath, showDebugInfo);
|
||||
}
|
||||
|
||||
public override void initializeValuesOnComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
}
|
||||
|
||||
public void saveGameContent (int currentSaveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
if (mainPlayerWeaponsManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mainPlayerWeaponsManager.saveCurrentPlayerWeaponsToSaveFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
print ("Saving player weapons");
|
||||
}
|
||||
|
||||
bool saveLocated = false;
|
||||
bool playerLocated = false;
|
||||
|
||||
int saveSlotIndex = -1;
|
||||
int listIndex = -1;
|
||||
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file;
|
||||
|
||||
persistanceWeaponListByPlayerInfo weaponsToSave = getPersistanceList (playerID, showDebugInfo);
|
||||
public playerWeaponsManager mainPlayerWeaponsManager;
|
||||
|
||||
List<persistanceWeaponInfo> persistanceInfoList;
|
||||
|
||||
persistanceWeaponListBySaveSlotInfo newPersistanceWeaponListBySaveSlotInfo = new persistanceWeaponListBySaveSlotInfo ();
|
||||
|
||||
List<persistanceWeaponListBySaveSlotInfo> infoListToSave = new List<persistanceWeaponListBySaveSlotInfo> ();
|
||||
public override void saveGame (int saveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
saveGameContent (saveNumber, playerID, currentSaveDataPath, showDebugInfo, savingGameToChangeScene);
|
||||
}
|
||||
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToSave = currentData as List<persistanceWeaponListBySaveSlotInfo>;
|
||||
public override void loadGame (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
loadGameContent (saveNumberToLoad, playerID, currentSaveDataPath, showDebugInfo);
|
||||
}
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
public override void initializeValuesOnComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
}
|
||||
|
||||
public void saveGameContent (int currentSaveNumber, int playerID, string currentSaveDataPath, bool showDebugInfo, bool savingGameToChangeScene)
|
||||
{
|
||||
if (mainPlayerWeaponsManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int infoListToSaveCount = infoListToSave.Count;
|
||||
if (!mainPlayerWeaponsManager.saveCurrentPlayerWeaponsToSaveFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < infoListToSaveCount; j++) {
|
||||
if (infoListToSave [j].saveNumber == currentSaveNumber) {
|
||||
newPersistanceWeaponListBySaveSlotInfo = infoListToSave [j];
|
||||
saveLocated = true;
|
||||
saveSlotIndex = j;
|
||||
}
|
||||
}
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
if (saveLocated) {
|
||||
int playerWeaponListCount = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Count;
|
||||
print ("Saving player weapons");
|
||||
}
|
||||
|
||||
for (int j = 0; j < playerWeaponListCount; j++) {
|
||||
if (newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [j].playerID == weaponsToSave.playerID) {
|
||||
playerLocated = true;
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
bool saveLocated = false;
|
||||
bool playerLocated = false;
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
int saveSlotIndex = -1;
|
||||
int listIndex = -1;
|
||||
|
||||
print ("Number of weapons: " + weaponsToSave.weaponList.Count);
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file;
|
||||
|
||||
print ("Current Save Number " + currentSaveNumber);
|
||||
print ("Save Located " + saveLocated);
|
||||
print ("Player Located " + playerLocated);
|
||||
}
|
||||
persistanceWeaponListByPlayerInfo weaponsToSave = getPersistanceList (playerID, showDebugInfo);
|
||||
|
||||
//if the save is located, check if the player id exists
|
||||
if (saveLocated) {
|
||||
//if player id exists, overwrite it
|
||||
if (playerLocated) {
|
||||
infoListToSave [saveSlotIndex].playerWeaponList [listIndex].weaponList = weaponsToSave.weaponList;
|
||||
} else {
|
||||
infoListToSave [saveSlotIndex].playerWeaponList.Add (weaponsToSave);
|
||||
}
|
||||
} else {
|
||||
newPersistanceWeaponListBySaveSlotInfo.saveNumber = currentSaveNumber;
|
||||
newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Add (weaponsToSave);
|
||||
infoListToSave.Add (newPersistanceWeaponListBySaveSlotInfo);
|
||||
}
|
||||
persistanceWeaponListBySaveSlotInfo newPersistanceWeaponListBySaveSlotInfo = new persistanceWeaponListBySaveSlotInfo ();
|
||||
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.OpenOrCreate);
|
||||
bf.Serialize (file, infoListToSave);
|
||||
List<persistanceWeaponListBySaveSlotInfo> infoListToSave = new List<persistanceWeaponListBySaveSlotInfo> ();
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToSave = currentData as List<persistanceWeaponListBySaveSlotInfo>;
|
||||
|
||||
public void loadGameContent (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
if (mainPlayerWeaponsManager == null) {
|
||||
return;
|
||||
}
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
if (!mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
initializeValues ();
|
||||
int infoListToSaveCount = infoListToSave.Count;
|
||||
|
||||
return;
|
||||
}
|
||||
for (int j = 0; j < infoListToSaveCount; j++) {
|
||||
if (infoListToSave [j].saveNumber == currentSaveNumber) {
|
||||
newPersistanceWeaponListBySaveSlotInfo = infoListToSave [j];
|
||||
saveLocated = true;
|
||||
saveSlotIndex = j;
|
||||
}
|
||||
}
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
if (saveLocated) {
|
||||
int playerWeaponListCount = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Count;
|
||||
|
||||
print ("Loading player weapons");
|
||||
}
|
||||
|
||||
persistanceInfoList = new List<persistanceWeaponInfo> ();
|
||||
for (int j = 0; j < playerWeaponListCount; j++) {
|
||||
if (newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [j].playerID == weaponsToSave.playerID) {
|
||||
playerLocated = true;
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<persistanceWeaponListBySaveSlotInfo> infoListToLoad = new List<persistanceWeaponListBySaveSlotInfo> ();
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToLoad = currentData as List<persistanceWeaponListBySaveSlotInfo>;
|
||||
print ("Number of weapons: " + weaponsToSave.weaponList.Count);
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
print ("Current Save Number " + currentSaveNumber);
|
||||
print ("Save Located " + saveLocated);
|
||||
print ("Player Located " + playerLocated);
|
||||
}
|
||||
|
||||
if (saveNumberToLoad > -1) {
|
||||
persistanceWeaponListBySaveSlotInfo newPersistanceWeaponListBySaveSlotInfo = new persistanceWeaponListBySaveSlotInfo ();
|
||||
//if the save is located, check if the player id exists
|
||||
if (saveLocated) {
|
||||
//if player id exists, overwrite it
|
||||
if (playerLocated) {
|
||||
infoListToSave [saveSlotIndex].playerWeaponList [listIndex].weaponList = weaponsToSave.weaponList;
|
||||
} else {
|
||||
infoListToSave [saveSlotIndex].playerWeaponList.Add (weaponsToSave);
|
||||
}
|
||||
} else {
|
||||
newPersistanceWeaponListBySaveSlotInfo.saveNumber = currentSaveNumber;
|
||||
newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Add (weaponsToSave);
|
||||
infoListToSave.Add (newPersistanceWeaponListBySaveSlotInfo);
|
||||
}
|
||||
|
||||
int infoListToLoadCount = infoListToLoad.Count;
|
||||
bf = new BinaryFormatter ();
|
||||
file = File.Open (currentSaveDataPath, FileMode.OpenOrCreate);
|
||||
bf.Serialize (file, infoListToSave);
|
||||
|
||||
for (int j = 0; j < infoListToLoadCount; j++) {
|
||||
if (infoListToLoad [j].saveNumber == saveNumberToLoad) {
|
||||
newPersistanceWeaponListBySaveSlotInfo = infoListToLoad [j];
|
||||
}
|
||||
}
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
int listIndex = -1;
|
||||
public void loadGameContent (int saveNumberToLoad, int playerID, string currentSaveDataPath, bool showDebugInfo)
|
||||
{
|
||||
if (mainPlayerWeaponsManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int playerWeaponListCount = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Count;
|
||||
if (!mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
initializeValues ();
|
||||
|
||||
for (int j = 0; j < playerWeaponListCount; j++) {
|
||||
if (newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [j].playerID == playerID) {
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (listIndex > -1) {
|
||||
persistanceInfoList = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [listIndex].weaponList;
|
||||
}
|
||||
}
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
print ("Loading player weapons");
|
||||
}
|
||||
|
||||
print ("Weapons Loaded in Save Number " + saveNumberToLoad);
|
||||
print ("Weapons amount: " + persistanceInfoList.Count);
|
||||
persistanceInfoList = new List<persistanceWeaponInfo> ();
|
||||
|
||||
for (int j = 0; j < persistanceInfoList.Count; j++) {
|
||||
print ("Weapon Name: " + persistanceInfoList [j].Name + " Is Enabled: " + persistanceInfoList [j].isWeaponEnabled +
|
||||
"Is Current Weapon: " + persistanceInfoList [j].isCurrentWeapon + " Remain Ammo: " + persistanceInfoList [j].remainingAmmo);
|
||||
}
|
||||
}
|
||||
List<persistanceWeaponListBySaveSlotInfo> infoListToLoad = new List<persistanceWeaponListBySaveSlotInfo> ();
|
||||
|
||||
loadInfoOnMainComponent ();
|
||||
}
|
||||
if (File.Exists (currentSaveDataPath)) {
|
||||
BinaryFormatter bf = new BinaryFormatter ();
|
||||
FileStream file = File.Open (currentSaveDataPath, FileMode.Open);
|
||||
object currentData = bf.Deserialize (file);
|
||||
infoListToLoad = currentData as List<persistanceWeaponListBySaveSlotInfo>;
|
||||
|
||||
file.Close ();
|
||||
}
|
||||
|
||||
public persistanceWeaponListByPlayerInfo getPersistanceList (int playerID, bool showDebugInfo)
|
||||
{
|
||||
persistanceWeaponListByPlayerInfo newPersistanceWeaponListByPlayerInfo = new persistanceWeaponListByPlayerInfo ();
|
||||
if (saveNumberToLoad > -1) {
|
||||
persistanceWeaponListBySaveSlotInfo newPersistanceWeaponListBySaveSlotInfo = new persistanceWeaponListBySaveSlotInfo ();
|
||||
|
||||
newPersistanceWeaponListByPlayerInfo.playerID = playerID;
|
||||
int infoListToLoadCount = infoListToLoad.Count;
|
||||
|
||||
List<persistanceWeaponInfo> newPersistanceWeaponInfoList = new List<persistanceWeaponInfo> ();
|
||||
for (int j = 0; j < infoListToLoadCount; j++) {
|
||||
if (infoListToLoad [j].saveNumber == saveNumberToLoad) {
|
||||
newPersistanceWeaponListBySaveSlotInfo = infoListToLoad [j];
|
||||
}
|
||||
}
|
||||
|
||||
List<IKWeaponSystem> weaponsList = mainPlayerWeaponsManager.weaponsList;
|
||||
int listIndex = -1;
|
||||
|
||||
int weaponsListCount = weaponsList.Count;
|
||||
int playerWeaponListCount = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList.Count;
|
||||
|
||||
for (int k = 0; k < weaponsListCount; k++) {
|
||||
persistanceWeaponInfo newPersistanceWeaponInfo = new persistanceWeaponInfo ();
|
||||
for (int j = 0; j < playerWeaponListCount; j++) {
|
||||
if (newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [j].playerID == playerID) {
|
||||
listIndex = j;
|
||||
}
|
||||
}
|
||||
|
||||
IKWeaponSystem currentWeapon = weaponsList [k];
|
||||
if (listIndex > -1) {
|
||||
persistanceInfoList = newPersistanceWeaponListBySaveSlotInfo.playerWeaponList [listIndex].weaponList;
|
||||
}
|
||||
}
|
||||
|
||||
newPersistanceWeaponInfo.Name = currentWeapon.getWeaponSystemName ();
|
||||
newPersistanceWeaponInfo.index = k;
|
||||
newPersistanceWeaponInfo.isWeaponEnabled = currentWeapon.isWeaponEnabled ();
|
||||
newPersistanceWeaponInfo.isCurrentWeapon = currentWeapon.isCurrentWeapon ();
|
||||
newPersistanceWeaponInfo.remainingAmmo = currentWeapon.getWeaponSystemManager ().weaponSettings.remainAmmo + currentWeapon.getWeaponSystemManager ().getWeaponClipSize ();
|
||||
if (showDebugInfo) {
|
||||
print ("\n\n");
|
||||
|
||||
if (mainPlayerWeaponsManager.saveWeaponAttachmentsInfoToSaveFile) {
|
||||
if (currentWeapon.weaponUsesAttachment) {
|
||||
newPersistanceWeaponInfo.weaponUsesAttachment = true;
|
||||
print ("Weapons Loaded in Save Number " + saveNumberToLoad);
|
||||
print ("Weapons amount: " + persistanceInfoList.Count);
|
||||
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentWeapon.getWeaponAttachmentSystem ();
|
||||
for (int j = 0; j < persistanceInfoList.Count; j++) {
|
||||
print ("Weapon Name: " + persistanceInfoList [j].Name + " Is Enabled: " + persistanceInfoList [j].isWeaponEnabled +
|
||||
"Is Current Weapon: " + persistanceInfoList [j].isCurrentWeapon + " Remain Ammo: " + persistanceInfoList [j].remainingAmmo);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
newPersistanceWeaponInfo.weaponAttachmentPlaceList = currentWeaponAttachmentSystem.getPersistanceAttachmentWeaponInfoList ();
|
||||
}
|
||||
}
|
||||
loadInfoOnMainComponent ();
|
||||
}
|
||||
|
||||
newPersistanceWeaponInfoList.Add (newPersistanceWeaponInfo);
|
||||
}
|
||||
}
|
||||
|
||||
newPersistanceWeaponListByPlayerInfo.weaponList = newPersistanceWeaponInfoList;
|
||||
|
||||
return newPersistanceWeaponListByPlayerInfo;
|
||||
}
|
||||
|
||||
|
||||
void loadInfoOnMainComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
|
||||
if (persistanceInfoList != null && persistanceInfoList.Count > 0) {
|
||||
|
||||
List<IKWeaponSystem> weaponsList = mainPlayerWeaponsManager.weaponsList;
|
||||
|
||||
if (mainPlayerWeaponsManager.storePickedWeaponsOnInventory) {
|
||||
public persistanceWeaponListByPlayerInfo getPersistanceList (int playerID, bool showDebugInfo)
|
||||
{
|
||||
persistanceWeaponListByPlayerInfo newPersistanceWeaponListByPlayerInfo = new persistanceWeaponListByPlayerInfo ();
|
||||
|
||||
if (mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
if (mainPlayerWeaponsManager.loadCurrentPlayerWeaponsFromSaveFile) {
|
||||
newPersistanceWeaponListByPlayerInfo.playerID = playerID;
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
List<persistanceWeaponInfo> newPersistanceWeaponInfoList = new List<persistanceWeaponInfo> ();
|
||||
|
||||
persistanceWeaponInfo currentPersistanceWeaponInfo = persistanceInfoList [i];
|
||||
|
||||
int currentIndex = currentPersistanceWeaponInfo.index;
|
||||
|
||||
if (weaponsList.Count > currentIndex && currentIndex > -1) {
|
||||
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [currentIndex];
|
||||
|
||||
if (currentPersistanceWeaponInfo.weaponUsesAttachment) {
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentIKWeaponToCheck.getWeaponAttachmentSystem ();
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
currentWeaponAttachmentSystem.initializeAttachmentValues (currentPersistanceWeaponInfo.weaponAttachmentPlaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (mainPlayerWeaponsManager.loadCurrentPlayerWeaponsFromSaveFile) {
|
||||
bool thereIsCurrentWeapon = false;
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
persistanceWeaponInfo currentPersistanceWeaponInfo = persistanceInfoList [i];
|
||||
|
||||
int currentIndex = currentPersistanceWeaponInfo.index;
|
||||
|
||||
if (weaponsList.Count > currentIndex && currentIndex > -1) {
|
||||
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [currentIndex];
|
||||
|
||||
currentIKWeaponToCheck.setWeaponEnabledState (currentPersistanceWeaponInfo.isWeaponEnabled);
|
||||
currentIKWeaponToCheck.setCurrentWeaponState (currentPersistanceWeaponInfo.isCurrentWeapon);
|
||||
currentIKWeaponToCheck.weaponSystemManager.weaponSettings.remainAmmo = currentPersistanceWeaponInfo.remainingAmmo
|
||||
- currentIKWeaponToCheck.weaponSystemManager.getWeaponClipSize ();
|
||||
|
||||
if (currentIKWeaponToCheck.isCurrentWeapon ()) {
|
||||
thereIsCurrentWeapon = true;
|
||||
}
|
||||
|
||||
if (mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
if (currentPersistanceWeaponInfo.weaponUsesAttachment) {
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentIKWeaponToCheck.getWeaponAttachmentSystem ();
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
currentWeaponAttachmentSystem.initializeAttachmentValues (currentPersistanceWeaponInfo.weaponAttachmentPlaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!thereIsCurrentWeapon) {
|
||||
int weaponsListCount = weaponsList.Count;
|
||||
|
||||
for (int k = 0; k < weaponsListCount; k++) {
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [k];
|
||||
|
||||
if (!thereIsCurrentWeapon && currentIKWeaponToCheck.isWeaponEnabled ()) {
|
||||
currentIKWeaponToCheck.setCurrentWeaponState (true);
|
||||
thereIsCurrentWeapon = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initializeValues ()
|
||||
{
|
||||
mainPlayerWeaponsManager.initializePlayerWeaponsValues ();
|
||||
}
|
||||
List<IKWeaponSystem> weaponsList = mainPlayerWeaponsManager.weaponsList;
|
||||
|
||||
int weaponsListCount = weaponsList.Count;
|
||||
|
||||
for (int k = 0; k < weaponsListCount; k++) {
|
||||
persistanceWeaponInfo newPersistanceWeaponInfo = new persistanceWeaponInfo ();
|
||||
|
||||
IKWeaponSystem currentWeapon = weaponsList [k];
|
||||
|
||||
newPersistanceWeaponInfo.Name = currentWeapon.getWeaponSystemName ();
|
||||
newPersistanceWeaponInfo.index = k;
|
||||
newPersistanceWeaponInfo.isWeaponEnabled = currentWeapon.isWeaponEnabled ();
|
||||
newPersistanceWeaponInfo.isCurrentWeapon = currentWeapon.isCurrentWeapon ();
|
||||
newPersistanceWeaponInfo.remainingAmmo = currentWeapon.getWeaponSystemManager ().weaponSettings.remainAmmo + currentWeapon.getWeaponSystemManager ().getWeaponClipSize ();
|
||||
|
||||
if (mainPlayerWeaponsManager.saveWeaponAttachmentsInfoToSaveFile) {
|
||||
if (currentWeapon.checkIfWeaponUsesAttachment ()) {
|
||||
newPersistanceWeaponInfo.weaponUsesAttachment = true;
|
||||
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentWeapon.getWeaponAttachmentSystem ();
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
newPersistanceWeaponInfo.weaponAttachmentPlaceList = currentWeaponAttachmentSystem.getPersistanceAttachmentWeaponInfoList ();
|
||||
}
|
||||
}
|
||||
|
||||
newPersistanceWeaponInfoList.Add (newPersistanceWeaponInfo);
|
||||
}
|
||||
}
|
||||
|
||||
newPersistanceWeaponListByPlayerInfo.weaponList = newPersistanceWeaponInfoList;
|
||||
|
||||
return newPersistanceWeaponListByPlayerInfo;
|
||||
}
|
||||
|
||||
|
||||
void loadInfoOnMainComponent ()
|
||||
{
|
||||
initializeValues ();
|
||||
|
||||
if (persistanceInfoList != null && persistanceInfoList.Count > 0) {
|
||||
|
||||
List<IKWeaponSystem> weaponsList = mainPlayerWeaponsManager.weaponsList;
|
||||
|
||||
if (mainPlayerWeaponsManager.storePickedWeaponsOnInventory) {
|
||||
|
||||
if (mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
if (mainPlayerWeaponsManager.loadCurrentPlayerWeaponsFromSaveFile) {
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
|
||||
persistanceWeaponInfo currentPersistanceWeaponInfo = persistanceInfoList [i];
|
||||
|
||||
int currentIndex = currentPersistanceWeaponInfo.index;
|
||||
|
||||
if (weaponsList.Count > currentIndex && currentIndex > -1) {
|
||||
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [currentIndex];
|
||||
|
||||
if (currentPersistanceWeaponInfo.weaponUsesAttachment) {
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentIKWeaponToCheck.getWeaponAttachmentSystem ();
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
currentWeaponAttachmentSystem.initializeAttachmentValues (currentPersistanceWeaponInfo.weaponAttachmentPlaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (mainPlayerWeaponsManager.loadCurrentPlayerWeaponsFromSaveFile) {
|
||||
bool thereIsCurrentWeapon = false;
|
||||
|
||||
int persistanceInfoListCount = persistanceInfoList.Count;
|
||||
|
||||
for (int i = 0; i < persistanceInfoListCount; i++) {
|
||||
persistanceWeaponInfo currentPersistanceWeaponInfo = persistanceInfoList [i];
|
||||
|
||||
int currentIndex = currentPersistanceWeaponInfo.index;
|
||||
|
||||
if (weaponsList.Count > currentIndex && currentIndex > -1) {
|
||||
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [currentIndex];
|
||||
|
||||
currentIKWeaponToCheck.setWeaponEnabledState (currentPersistanceWeaponInfo.isWeaponEnabled);
|
||||
currentIKWeaponToCheck.setCurrentWeaponState (currentPersistanceWeaponInfo.isCurrentWeapon);
|
||||
currentIKWeaponToCheck.weaponSystemManager.weaponSettings.remainAmmo = currentPersistanceWeaponInfo.remainingAmmo
|
||||
- currentIKWeaponToCheck.weaponSystemManager.getWeaponClipSize ();
|
||||
|
||||
if (currentIKWeaponToCheck.isCurrentWeapon ()) {
|
||||
thereIsCurrentWeapon = true;
|
||||
}
|
||||
|
||||
if (mainPlayerWeaponsManager.loadWeaponAttachmentsInfoFromSaveFile) {
|
||||
if (currentPersistanceWeaponInfo.weaponUsesAttachment) {
|
||||
weaponAttachmentSystem currentWeaponAttachmentSystem = currentIKWeaponToCheck.getWeaponAttachmentSystem ();
|
||||
|
||||
if (currentWeaponAttachmentSystem != null) {
|
||||
currentWeaponAttachmentSystem.initializeAttachmentValues (currentPersistanceWeaponInfo.weaponAttachmentPlaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!thereIsCurrentWeapon) {
|
||||
int weaponsListCount = weaponsList.Count;
|
||||
|
||||
for (int k = 0; k < weaponsListCount; k++) {
|
||||
IKWeaponSystem currentIKWeaponToCheck = weaponsList [k];
|
||||
|
||||
if (!thereIsCurrentWeapon && currentIKWeaponToCheck.isWeaponEnabled ()) {
|
||||
currentIKWeaponToCheck.setCurrentWeaponState (true);
|
||||
thereIsCurrentWeapon = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initializeValues ()
|
||||
{
|
||||
mainPlayerWeaponsManager.initializePlayerWeaponsValues ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/savePlayerWeaponsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveSkillsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveStatsInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveTravelStationInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Save System/Custom Class To Save/saveVendorInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user