add ckg
plantilla base para movimiento básico
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class armorClothInventoryPrefabCreationSystem : inventoryPrefabCreationSystem
|
||||
{
|
||||
public override void createInventoryPrefabObject ()
|
||||
{
|
||||
armorClothPickup currentArmorClothPickup = GetComponent<armorClothPickup> ();
|
||||
|
||||
inventoryObject currentInventoryObject = GetComponentInChildren<inventoryObject> ();
|
||||
|
||||
string newName = currentInventoryObject.inventoryObjectInfo.Name;
|
||||
|
||||
currentArmorClothPickup.setObjectName (newName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e994598f525f3414887c71d541c04194
|
||||
timeCreated: 1638721666
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothInventoryPrefabCreationSystem.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class armorClothOnInventory : objectOnInventory
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public armorClothPickup mainArmorClothPickup;
|
||||
|
||||
public override void eventOnPickObject (GameObject currentPlayer)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void eventOnDropObject (GameObject currentPlayer)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override bool setObjectEquippedStateOnInventory (GameObject currentPlayer, bool state)
|
||||
{
|
||||
playerComponentsManager mainPlayerComponentsManager = currentPlayer.GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (mainPlayerComponentsManager != null) {
|
||||
inventoryCharacterCustomizationSystem mainInventoryCharacterCustomizationSystem = mainPlayerComponentsManager.getInventoryCharacterCustomizationSystem ();
|
||||
|
||||
if (mainInventoryCharacterCustomizationSystem != null) {
|
||||
bool equipResult = false;
|
||||
|
||||
if (state) {
|
||||
equipResult = mainInventoryCharacterCustomizationSystem.equipObject (mainArmorClothPickup.objectName, mainArmorClothPickup.categoryName);
|
||||
} else {
|
||||
equipResult = mainInventoryCharacterCustomizationSystem.unequipObject (mainArmorClothPickup.objectName, mainArmorClothPickup.categoryName);
|
||||
}
|
||||
|
||||
if (equipResult) {
|
||||
checkRemoteEvents (currentPlayer);
|
||||
|
||||
checkRemoteEventsOnSetObjectEquipState (currentPlayer, state);
|
||||
|
||||
checkIfEnableAbilitiesOnEquipInventoryObject (currentPlayer, state);
|
||||
}
|
||||
|
||||
return equipResult;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4762ac26c7da614f82e4c7f3b60d366
|
||||
timeCreated: 1638718844
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothOnInventory.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class armorClothPickup : pickupType
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public string objectName;
|
||||
public string categoryName;
|
||||
|
||||
bool storePickedObjectOnInventory;
|
||||
|
||||
public override bool checkIfCanBePicked ()
|
||||
{
|
||||
if (finderIsPlayer) {
|
||||
if (mainPickupObject.inventoryObjectManager != null) {
|
||||
bool storeObjectOnInventory = false;
|
||||
|
||||
playerComponentsManager mainPlayerComponentsManager = player.GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (mainPlayerComponentsManager != null) {
|
||||
inventoryCharacterCustomizationSystem mainInventoryCharacterCustomizationSystem = mainPlayerComponentsManager.getInventoryCharacterCustomizationSystem ();
|
||||
|
||||
if (mainInventoryCharacterCustomizationSystem != null) {
|
||||
storeObjectOnInventory = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (storeObjectOnInventory) {
|
||||
canPickCurrentObject = mainPickupObject.tryToPickUpObject ();
|
||||
} else {
|
||||
canPickCurrentObject = true;
|
||||
}
|
||||
|
||||
storePickedObjectOnInventory = true;
|
||||
|
||||
amountTaken = mainPickupObject.amount;
|
||||
}
|
||||
}
|
||||
|
||||
if (finderIsCharacter) {
|
||||
findObjectivesSystem currentfindObjectivesSystem = npc.GetComponent<findObjectivesSystem> ();
|
||||
|
||||
if (currentfindObjectivesSystem != null) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return canPickCurrentObject;
|
||||
}
|
||||
|
||||
public override void confirmTakePickup ()
|
||||
{
|
||||
bool objectPickedCorrectly = false;
|
||||
|
||||
if (finderIsPlayer) {
|
||||
if (storePickedObjectOnInventory) {
|
||||
objectPickedCorrectly = true;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (finderIsCharacter) {
|
||||
|
||||
}
|
||||
|
||||
if (!objectPickedCorrectly) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (useCustomPickupMessage) {
|
||||
showPickupTakenMessage (amountTaken);
|
||||
} else {
|
||||
showPickupTakenMessage (objectName + " Picked");
|
||||
}
|
||||
|
||||
mainPickupObject.playPickupSound ();
|
||||
|
||||
mainPickupObject.removePickupFromLevel ();
|
||||
}
|
||||
|
||||
public void setObjectName (string newName)
|
||||
{
|
||||
objectName = newName;
|
||||
}
|
||||
|
||||
public override void renameObject (string newName)
|
||||
{
|
||||
setObjectName (newName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0364eff903d235458ec1914f25e7dbf
|
||||
timeCreated: 1638720020
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothPickup.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Armor-Cloth piece Template", menuName = "GKC/Create Armor-Cloth Piece Template", order = 51)]
|
||||
public class armorClothPieceTemplate : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public string fullSetName;
|
||||
|
||||
public int ID = 0;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public List<armorClothStatsInfo> armorClothStatsInfoList = new List<armorClothStatsInfo> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a68c656751c73074397bf57bcf8b9a4a
|
||||
timeCreated: 1638744167
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothPieceTemplate.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Armor-Cloth piece Template List", menuName = "GKC/Create Armor-Cloth Piece Template List", order = 51)]
|
||||
public class armorClothPieceTemplateData : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public int ID = 0;
|
||||
|
||||
public List<armorClothPieceTemplate> armorClothPieceTemplateList = new List<armorClothPieceTemplate> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93095073769254041a1c5c3d67de14d7
|
||||
timeCreated: 1659829429
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothPieceTemplateData.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class armorClothStatsInfo
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public string Name;
|
||||
|
||||
public bool statIsAmount = true;
|
||||
|
||||
[Space]
|
||||
[Header ("Stats Settings")]
|
||||
[Space]
|
||||
|
||||
public float statAmount;
|
||||
|
||||
public bool useStatMultiplier;
|
||||
|
||||
public bool useRandomRange;
|
||||
public Vector2 randomRange;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool newBoolState;
|
||||
|
||||
[Space]
|
||||
[Header ("Abilities Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useAbilitiesListToEnable;
|
||||
|
||||
public List<string> abilitiesListToEnable = new List<string> ();
|
||||
|
||||
[Space]
|
||||
|
||||
public bool activateAbility;
|
||||
public string abilityToActivateName;
|
||||
|
||||
[Space]
|
||||
[Header ("Skills Settings")]
|
||||
[Space]
|
||||
|
||||
public bool unlockSkill;
|
||||
public string skillNameToUnlock;
|
||||
|
||||
[Space]
|
||||
[Header ("Damage Type-Resistances Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setDamageTypeState;
|
||||
public string damageTypeName;
|
||||
public bool damageTypeState;
|
||||
|
||||
public bool increaseDamageType;
|
||||
public float extraDamageType;
|
||||
|
||||
public bool setObtainHealthOnDamageType;
|
||||
public bool obtainHealthOnDamageType;
|
||||
|
||||
[Space]
|
||||
[Header ("Remote Events Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useRemoteEvent;
|
||||
|
||||
public List<string> remoteEventNameListOnEquip = new List<string> ();
|
||||
|
||||
public List<string> remoteEventNameListOnUnequip = new List<string> ();
|
||||
|
||||
|
||||
public armorClothStatsInfo ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d174280d97d70240ae94e06bd425a06
|
||||
timeCreated: 1638742268
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/armorClothStatsInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Aspect Template", menuName = "GKC/Create Character Aspect Template", order = 51)]
|
||||
public class characterAspectCustomizationTemplate : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
public int characterAspectTemplateID = 0;
|
||||
|
||||
[Space]
|
||||
|
||||
public List<characterCustomizationTypeInfo> characterCustomizationTypeInfoList = new List<characterCustomizationTypeInfo> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 423c10762c42b2848909602381470d43
|
||||
timeCreated: 1637207077
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterAspectCustomizationTemplate.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Aspect Template List", menuName = "GKC/Create Character Aspect Template List", order = 51)]
|
||||
public class characterAspectCustomizationTemplateData : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public int ID = 0;
|
||||
|
||||
public List<characterAspectCustomizationTemplate> characterAspectCustomizationTemplateList = new List<characterAspectCustomizationTemplate> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e662bfee0e7a5a4aafc5cdfc06b76c7
|
||||
timeCreated: 1660340325
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterAspectCustomizationTemplateData.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,831 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class characterAspectCustomizationUISystem : ingameMenuPanel
|
||||
{
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setNewAnimatorIdle;
|
||||
|
||||
public int animatorIdle;
|
||||
|
||||
public bool setUnscaledTimeOnAnimator;
|
||||
|
||||
[Space]
|
||||
[Header ("Template Settings")]
|
||||
[Space]
|
||||
|
||||
public characterAspectCustomizationTemplateData mainCharacterAspectCustomizationTemplateData;
|
||||
|
||||
[Space]
|
||||
[Header ("Customization Settings")]
|
||||
[Space]
|
||||
|
||||
public List<characterCustomizationTypeButtonInfo> characterCustomizationTypeButtonInfoList = new List<characterCustomizationTypeButtonInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("UI Panel Settings")]
|
||||
[Space]
|
||||
|
||||
public List<panelCategoryInfo> panelCategoryInfoList = new List<panelCategoryInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Rotate Character Settings")]
|
||||
[Space]
|
||||
|
||||
public bool rotateCharacterEnabled = true;
|
||||
|
||||
public float characterRotationSpeed = 10;
|
||||
|
||||
[Space]
|
||||
[Header ("Initial Armor/Cloth Set Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setInitialClass;
|
||||
public string initialClassName;
|
||||
public string initialArmorClothName;
|
||||
public bool setInitialClassJustFirstTimeMenuOpened;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
public bool characterCustomizationManagerAssigned;
|
||||
|
||||
public bool menuOpened;
|
||||
|
||||
public bool keepAllCharacterMeshesDisabledActive;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public characterCustomizationManager currentCharacterCustomizationManager;
|
||||
|
||||
public mouseCursorController mainMouseCursorController;
|
||||
|
||||
public Transform mainCameraTransform;
|
||||
|
||||
public Transform mainCharacterTransform;
|
||||
|
||||
public Transform mainPlayerControllerTransform;
|
||||
|
||||
|
||||
Transform mainPlayerCameraTransform;
|
||||
|
||||
playerController mainPlayerController;
|
||||
|
||||
bool mainPlayerControllerLocated;
|
||||
|
||||
headTrack mainHeadTrack;
|
||||
|
||||
Transform originalCameraParent;
|
||||
|
||||
bool componentsAssigned;
|
||||
|
||||
float previousIdleID = -1;
|
||||
|
||||
GameObject currentButtonObjectPressed;
|
||||
|
||||
Coroutine menuCoroutine;
|
||||
|
||||
bool rotationInputActive;
|
||||
|
||||
Vector2 axisValues;
|
||||
|
||||
bool mouseCursorControllerManagerLocated;
|
||||
|
||||
bool setInitialClassChecked;
|
||||
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
characterCustomizationManagerAssigned = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void checkSetInitialClass ()
|
||||
{
|
||||
int categoryIndex = characterCustomizationTypeButtonInfoList.FindIndex (s => s.Name.Equals (initialClassName));
|
||||
|
||||
if (categoryIndex > -1) {
|
||||
|
||||
characterCustomizationTypeButtonInfo currentCategoryButton = characterCustomizationTypeButtonInfoList [categoryIndex];
|
||||
|
||||
int currentIndex = currentCategoryButton.characterCustomizationButtonInfoList.FindIndex (s => s.Name.Equals (initialArmorClothName));
|
||||
|
||||
if (currentIndex != -1) {
|
||||
characterCustomizationButtonInfo currentInfo = currentCategoryButton.characterCustomizationButtonInfoList [currentIndex];
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("setting initial class");
|
||||
}
|
||||
|
||||
checkButtonPressed (currentInfo.buttonObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stopMenuCoroutineUpdate ()
|
||||
{
|
||||
if (menuCoroutine != null) {
|
||||
StopCoroutine (menuCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
public void inputSetRotationInputActive (bool state)
|
||||
{
|
||||
if (menuOpened) {
|
||||
rotationInputActive = state;
|
||||
}
|
||||
}
|
||||
|
||||
public void inputToggleRotationInputActive ()
|
||||
{
|
||||
inputSetRotationInputActive (!rotationInputActive);
|
||||
}
|
||||
|
||||
IEnumerator menuCoroutineUpdate ()
|
||||
{
|
||||
var waitTime = new WaitForSecondsRealtime (0.0001f);
|
||||
|
||||
while (true) {
|
||||
yield return waitTime;
|
||||
|
||||
if (rotateCharacterEnabled) {
|
||||
if (rotationInputActive) {
|
||||
if (mouseCursorControllerManagerLocated) {
|
||||
axisValues = mainMouseCursorController.getMouseAxis ();
|
||||
}
|
||||
|
||||
//mainCharacterTransform.Rotate (mainCharacterTransform.up, -Mathf.Deg2Rad * characterRotationSpeed * axisValues.x, Space.World);
|
||||
if (mainPlayerControllerLocated && mainPlayerController.isFullBodyAwarenessActive ()) {
|
||||
mainPlayerCameraTransform.Rotate (mainPlayerCameraTransform.up, -Mathf.Deg2Rad * characterRotationSpeed * axisValues.x, Space.World);
|
||||
} else {
|
||||
if (mainPlayerControllerTransform != null) {
|
||||
mainPlayerControllerTransform.Rotate (mainPlayerControllerTransform.up, -Mathf.Deg2Rad * characterRotationSpeed * axisValues.x, Space.World);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkButtonPressedWithoutCheckIfPreviouslyPressed (GameObject buttonObject)
|
||||
{
|
||||
checkButton (buttonObject);
|
||||
}
|
||||
|
||||
public void checkButtonPressed (GameObject buttonObject)
|
||||
{
|
||||
if (showDebugPrint) {
|
||||
print (buttonObject.name);
|
||||
}
|
||||
|
||||
if (currentButtonObjectPressed != null && buttonObject == currentButtonObjectPressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
checkButton (buttonObject);
|
||||
}
|
||||
|
||||
void checkButton (GameObject buttonObject)
|
||||
{
|
||||
currentButtonObjectPressed = buttonObject;
|
||||
|
||||
for (int i = 0; i < characterCustomizationTypeButtonInfoList.Count; i++) {
|
||||
for (int j = 0; j < characterCustomizationTypeButtonInfoList [i].characterCustomizationButtonInfoList.Count; j++) {
|
||||
|
||||
characterCustomizationButtonInfo currentInfo = characterCustomizationTypeButtonInfoList [i].characterCustomizationButtonInfoList [j];
|
||||
|
||||
if (currentInfo.buttonObject == buttonObject) {
|
||||
|
||||
if (currentInfo.canBePressedMultipleTimes) {
|
||||
currentButtonObjectPressed = null;
|
||||
}
|
||||
|
||||
bool isToggle = currentInfo.isToggle;
|
||||
|
||||
bool disableOtherObjects = currentInfo.disableOtherObjects;
|
||||
|
||||
string categoryOfObjectsToDisable = currentInfo.categoryOfObjectsToDisable;
|
||||
|
||||
string optionName = currentInfo.Name;
|
||||
|
||||
bool boolValue = false;
|
||||
|
||||
if (isToggle) {
|
||||
Toggle currentToggle = buttonObject.GetComponent<Toggle> ();
|
||||
|
||||
if (currentToggle != null) {
|
||||
boolValue = currentToggle.isOn;
|
||||
}
|
||||
|
||||
optionName = currentInfo.toggleName;
|
||||
}
|
||||
|
||||
bool setObjectActiveState = currentInfo.setObjectActiveState;
|
||||
|
||||
if (setObjectActiveState) {
|
||||
boolValue = currentInfo.setObjectActive;
|
||||
}
|
||||
|
||||
float floatValue = 0;
|
||||
|
||||
string sliderName = currentInfo.sliderName;
|
||||
|
||||
bool isSlider = currentInfo.isSlider;
|
||||
|
||||
float sliderMaxValue = 0;
|
||||
|
||||
if (isSlider) {
|
||||
Slider currenSlider = buttonObject.GetComponent<Slider> ();
|
||||
|
||||
floatValue = currenSlider.value;
|
||||
|
||||
sliderMaxValue = currenSlider.maxValue;
|
||||
}
|
||||
|
||||
bool useRandomFloatValue = currentInfo.useRandomFloatValue;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print (optionName + " " + floatValue + " " + boolValue + " " + sliderName + " " + isSlider + " " + useRandomFloatValue);
|
||||
}
|
||||
|
||||
bool isFullSet = currentInfo.isFullSet;
|
||||
|
||||
setCustomizationOnCharacterFromOption (optionName, floatValue, boolValue, setObjectActiveState,
|
||||
sliderName, isSlider,
|
||||
useRandomFloatValue, sliderMaxValue, isToggle,
|
||||
disableOtherObjects, categoryOfObjectsToDisable, isFullSet);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setCustomizationOnCharacterFromOption (string optionName, float floatValue, bool boolValue, bool setObjectActiveState,
|
||||
string sliderName, bool isSlider,
|
||||
bool useRandomFloatValue, float sliderMaxValue, bool isToggle,
|
||||
bool disableOtherObjects, string categoryOfObjectsToDisable, bool isFullSet)
|
||||
{
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSlider) {
|
||||
if (showDebugPrint) {
|
||||
print ("sending blendshape value " + sliderName + " " + floatValue + " " + useRandomFloatValue + " " + sliderMaxValue);
|
||||
}
|
||||
|
||||
currentCharacterCustomizationManager.setBlendShapeValue (sliderName, floatValue, useRandomFloatValue, sliderMaxValue);
|
||||
} else if (isToggle) {
|
||||
if (showDebugPrint) {
|
||||
print ("sending toggle value " + optionName + " " + boolValue);
|
||||
}
|
||||
|
||||
currentCharacterCustomizationManager.setObjectState (boolValue, optionName, disableOtherObjects, categoryOfObjectsToDisable, false);
|
||||
} else if (setObjectActiveState) {
|
||||
if (showDebugPrint) {
|
||||
print ("sending set object active state " + optionName + " " + boolValue);
|
||||
}
|
||||
|
||||
currentCharacterCustomizationManager.setObjectState (boolValue, optionName, disableOtherObjects, categoryOfObjectsToDisable, false);
|
||||
} else {
|
||||
if (showDebugPrint) {
|
||||
print ("sending full aspect " + optionName);
|
||||
}
|
||||
|
||||
int mainCharacterAspectCustomizationTemplateDataCount = mainCharacterAspectCustomizationTemplateData.characterAspectCustomizationTemplateList.Count;
|
||||
|
||||
for (int i = 0; i < mainCharacterAspectCustomizationTemplateDataCount; i++) {
|
||||
characterAspectCustomizationTemplate currentTemplate = mainCharacterAspectCustomizationTemplateData.characterAspectCustomizationTemplateList [i];
|
||||
|
||||
if (currentTemplate.Name.Equals (optionName)) {
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("aspect found " + optionName);
|
||||
}
|
||||
|
||||
currentCharacterCustomizationManager.setCustomizationFromTemplate (currentTemplate, isFullSet);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void openPanelInfo (GameObject buttonObject)
|
||||
{
|
||||
int panelCategoryIndex = -1;
|
||||
int panelIndex = -1;
|
||||
|
||||
for (int i = 0; i < panelCategoryInfoList.Count; i++) {
|
||||
for (int j = 0; j < panelCategoryInfoList [i].panelInfoList.Count; j++) {
|
||||
if (panelCategoryInfoList [i].panelInfoList [j].panelButton == buttonObject) {
|
||||
|
||||
if (panelCategoryInfoList [i].panelInfoList [j].isCurrentPanel) {
|
||||
return;
|
||||
}
|
||||
|
||||
panelIndex = j;
|
||||
|
||||
panelCategoryIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (panelIndex == -1 || panelCategoryIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
closeAllPanelInfo ();
|
||||
|
||||
panelInfo currentPanelInfo = panelCategoryInfoList [panelCategoryIndex].panelInfoList [panelIndex];
|
||||
|
||||
|
||||
if (currentPanelInfo.panelObject.activeSelf != true) {
|
||||
currentPanelInfo.panelObject.SetActive (true);
|
||||
}
|
||||
|
||||
if (currentPanelInfo.useEventsOnSelectPanel) {
|
||||
currentPanelInfo.eventOnSelectPanel.Invoke ();
|
||||
}
|
||||
|
||||
if (currentPanelInfo.setCameraPositionOnPanel) {
|
||||
if (mainCharacterTransform != null) {
|
||||
mainCameraTransform.SetParent (mainCharacterTransform);
|
||||
}
|
||||
|
||||
mainCameraTransform.localEulerAngles = currentPanelInfo.cameraEulerOffset;
|
||||
|
||||
mainCameraTransform.localPosition = currentPanelInfo.cameraPositionOffset;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print (currentPanelInfo.cameraPositionOffset + " " + currentPanelInfo.cameraEulerOffset);
|
||||
}
|
||||
|
||||
mainCameraTransform.SetParent (originalCameraParent);
|
||||
}
|
||||
|
||||
setSliderValuesFromBlendShapes ();
|
||||
|
||||
currentPanelInfo.isCurrentPanel = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void setSliderValuesFromBlendShapes ()
|
||||
{
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < characterCustomizationTypeButtonInfoList.Count; i++) {
|
||||
for (int j = 0; j < characterCustomizationTypeButtonInfoList [i].characterCustomizationButtonInfoList.Count; j++) {
|
||||
characterCustomizationButtonInfo currentInfo = characterCustomizationTypeButtonInfoList [i].characterCustomizationButtonInfoList [j];
|
||||
|
||||
if (currentInfo.isSlider && currentInfo.setInitialValueFromBlendshape) {
|
||||
Slider currenSlider = currentInfo.buttonObject.GetComponent<Slider> ();
|
||||
|
||||
float newValue = currentCharacterCustomizationManager.getBlendShapeValue (currentInfo.sliderName, currenSlider.maxValue);
|
||||
|
||||
if (newValue > -1) {
|
||||
currenSlider.value = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void closeAllPanelInfo ()
|
||||
{
|
||||
for (int i = 0; i < panelCategoryInfoList.Count; i++) {
|
||||
for (int j = 0; j < panelCategoryInfoList [i].panelInfoList.Count; j++) {
|
||||
if (panelCategoryInfoList [i].panelInfoList [j].panelObject.activeSelf != false) {
|
||||
panelCategoryInfoList [i].panelInfoList [j].panelObject.SetActive (false);
|
||||
}
|
||||
|
||||
panelCategoryInfoList [i].panelInfoList [j].isCurrentPanel = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void initializeMenuPanel ()
|
||||
{
|
||||
characterCustomizationManagerAssigned = currentCharacterCustomizationManager != null;
|
||||
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
currentCharacterCustomizationManager = pauseManager.getPlayerControllerGameObject ().GetComponentInChildren<characterCustomizationManager> ();
|
||||
|
||||
characterCustomizationManagerAssigned = currentCharacterCustomizationManager != null;
|
||||
|
||||
checkCharacterComponents ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void checkCharacterComponents ()
|
||||
{
|
||||
if (!componentsAssigned) {
|
||||
if (pauseManager != null) {
|
||||
playerComponentsManager currentPlayerComponentsManager = pauseManager.getPlayerControllerGameObject ().GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (currentPlayerComponentsManager != null) {
|
||||
|
||||
mainPlayerController = currentPlayerComponentsManager.getPlayerController ();
|
||||
|
||||
mainPlayerControllerLocated = mainPlayerController != null;
|
||||
|
||||
mainHeadTrack = currentPlayerComponentsManager.getHeadTrack ();
|
||||
|
||||
mainPlayerControllerTransform = mainPlayerController.transform;
|
||||
|
||||
mainPlayerCameraTransform = mainPlayerController.getPlayerCameraGameObject ().transform;
|
||||
}
|
||||
|
||||
if (mainCameraTransform == null) {
|
||||
mainCameraTransform = pauseManager.getMainCameraTransform ();
|
||||
}
|
||||
|
||||
if (mainCharacterTransform == null) {
|
||||
if (characterCustomizationManagerAssigned) {
|
||||
mainCharacterTransform = currentCharacterCustomizationManager.transform;
|
||||
} else {
|
||||
mainCharacterTransform = pauseManager.getPlayerControllerGameObject ().transform;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
componentsAssigned = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void enableOrDisableHeadTemporaly (bool state)
|
||||
{
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
currentCharacterCustomizationManager.enableOrDisableHeadTemporaly (state);
|
||||
}
|
||||
}
|
||||
|
||||
public override void openOrCloseMenuPanel (bool state)
|
||||
{
|
||||
if (state) {
|
||||
if (pauseManager != null) {
|
||||
if (!pauseManager.checkIfMenuCanBeUsedByName (menuPanelName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.openOrCloseMenuPanel (state);
|
||||
|
||||
menuOpened = state;
|
||||
|
||||
checkCharacterComponents ();
|
||||
|
||||
stopMenuCoroutineUpdate ();
|
||||
|
||||
if (state) {
|
||||
if (originalCameraParent == null) {
|
||||
originalCameraParent = mainCameraTransform.parent;
|
||||
}
|
||||
} else {
|
||||
if (originalCameraParent != null) {
|
||||
mainCameraTransform.SetParent (originalCameraParent);
|
||||
|
||||
originalCameraParent = null;
|
||||
}
|
||||
|
||||
mainCameraTransform.localPosition = Vector3.zero;
|
||||
mainCameraTransform.localEulerAngles = Vector3.zero;
|
||||
}
|
||||
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
currentCharacterCustomizationManager.setEditActiveState (state);
|
||||
}
|
||||
|
||||
if (state) {
|
||||
for (int i = 0; i < panelCategoryInfoList.Count; i++) {
|
||||
for (int j = 0; j < panelCategoryInfoList [i].panelInfoList.Count; j++) {
|
||||
bool panelButtonEnabled = panelCategoryInfoList [i].panelInfoList [j].panelButtonEnabled;
|
||||
|
||||
if (showDebugPrint) {
|
||||
print (panelButtonEnabled + " " + panelCategoryInfoList [i].panelInfoList [j].Name);
|
||||
}
|
||||
|
||||
if (panelCategoryInfoList [i].panelInfoList [j].panelButton.activeSelf != panelButtonEnabled) {
|
||||
panelCategoryInfoList [i].panelInfoList [j].panelButton.SetActive (panelButtonEnabled);
|
||||
}
|
||||
|
||||
panelCategoryInfoList [i].panelInfoList [j].isCurrentPanel = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
closeAllPanelInfo ();
|
||||
|
||||
currentButtonObjectPressed = null;
|
||||
|
||||
enableOrDisableHeadTemporaly (false);
|
||||
}
|
||||
|
||||
if (state) {
|
||||
if (setNewAnimatorIdle) {
|
||||
if (previousIdleID == -1) {
|
||||
previousIdleID = mainPlayerController.getCurrentIdleID ();
|
||||
}
|
||||
|
||||
mainPlayerController.setCurrentIdleIDValue (animatorIdle);
|
||||
|
||||
mainPlayerController.updateIdleIDOnAnimator ();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (previousIdleID != -1) {
|
||||
mainPlayerController.setCurrentIdleIDValueFloat (previousIdleID);
|
||||
|
||||
mainPlayerController.updateIdleIDOnAnimator ();
|
||||
|
||||
previousIdleID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (setUnscaledTimeOnAnimator) {
|
||||
mainPlayerController.setAnimatorUnscaledTimeState (state);
|
||||
}
|
||||
|
||||
if (mainHeadTrack != null) {
|
||||
if (state) {
|
||||
mainHeadTrack.setExternalHeadTrackPauseActiveState (true);
|
||||
} else {
|
||||
mainHeadTrack.setExternalHeadTrackPauseActiveState (false);
|
||||
}
|
||||
}
|
||||
|
||||
if (state) {
|
||||
menuCoroutine = StartCoroutine (menuCoroutineUpdate ());
|
||||
}
|
||||
|
||||
rotationInputActive = false;
|
||||
|
||||
axisValues = Vector3.zero;
|
||||
|
||||
if (!mouseCursorControllerManagerLocated) {
|
||||
mouseCursorControllerManagerLocated = mainMouseCursorController != null;
|
||||
|
||||
if (!mouseCursorControllerManagerLocated) {
|
||||
mainMouseCursorController = mouseCursorController.Instance;
|
||||
|
||||
mouseCursorControllerManagerLocated = mainMouseCursorController != null;
|
||||
}
|
||||
|
||||
if (!mouseCursorControllerManagerLocated) {
|
||||
mainMouseCursorController = FindObjectOfType<mouseCursorController> ();
|
||||
|
||||
mainMouseCursorController.getComponentInstanceOnApplicationPlaying ();
|
||||
|
||||
mouseCursorControllerManagerLocated = mainMouseCursorController != null;
|
||||
}
|
||||
}
|
||||
|
||||
if (mainPlayerController != null) {
|
||||
if (mainPlayerController.isPlayerOnFirstPerson ()) {
|
||||
if (state) {
|
||||
previousKeepAllCharacterMeshesDisabledActiveValue = keepAllCharacterMeshesDisabledActive;
|
||||
|
||||
if (previousKeepAllCharacterMeshesDisabledActiveValue) {
|
||||
checkCameraViewToFirstOrThirdPerson (false);
|
||||
|
||||
mainPlayerController.setPausePlayerRotateToCameraDirectionOnFirstPersonActiveState (true);
|
||||
}
|
||||
} else {
|
||||
if (previousKeepAllCharacterMeshesDisabledActiveValue) {
|
||||
checkCameraViewToFirstOrThirdPerson (true);
|
||||
|
||||
mainPlayerController.setPausePlayerRotateToCameraDirectionOnFirstPersonActiveState (false);
|
||||
|
||||
previousKeepAllCharacterMeshesDisabledActiveValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
mainPlayerController.setAnimatorState (menuOpened);
|
||||
|
||||
mainCharacterTransform.localRotation = Quaternion.identity;
|
||||
} else {
|
||||
previousKeepAllCharacterMeshesDisabledActiveValue = false;
|
||||
|
||||
if (!state) {
|
||||
mainCharacterTransform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state) {
|
||||
bool panelFound = false;
|
||||
|
||||
for (int i = 0; i < panelCategoryInfoList.Count; i++) {
|
||||
for (int j = 0; j < panelCategoryInfoList [i].panelInfoList.Count; j++) {
|
||||
if (!panelFound) {
|
||||
if (panelCategoryInfoList [i].panelInfoList [j].panelButtonEnabled) {
|
||||
openPanelInfo (panelCategoryInfoList [i].panelInfoList [j].panelButton);
|
||||
|
||||
panelFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state) {
|
||||
if (setInitialClass) {
|
||||
if (!setInitialClassJustFirstTimeMenuOpened || !setInitialClassChecked) {
|
||||
checkSetInitialClass ();
|
||||
|
||||
setInitialClassChecked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool previousKeepAllCharacterMeshesDisabledActiveValue;
|
||||
|
||||
public bool equipOrUnequipObject (bool state, string objectName, string categoryName)
|
||||
{
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
initializeMenuPanel ();
|
||||
|
||||
if (!characterCustomizationManagerAssigned) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool result = currentCharacterCustomizationManager.setObjectState (state, objectName, true, categoryName, true);
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("equipOrUnequipObject result " + result);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
currentCharacterCustomizationManager.checkEquippedStateOnObject (state, objectName, categoryName);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void checkCameraViewToFirstOrThirdPerson (bool state)
|
||||
{
|
||||
if (characterCustomizationManagerAssigned) {
|
||||
keepAllCharacterMeshesDisabledActive = state;
|
||||
|
||||
currentCharacterCustomizationManager.checkCameraViewToFirstOrThirdPerson (state);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkCameraViewToFirstOrThirdPersonOnEditor (bool state)
|
||||
{
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
keepAllCharacterMeshesDisabledActive = state;
|
||||
|
||||
currentCharacterCustomizationManager.checkCameraViewToFirstOrThirdPersonOnEditor (state);
|
||||
}
|
||||
}
|
||||
|
||||
public bool checkIfObjectAlreadyOnCurrentPiecesList (string pieceName)
|
||||
{
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
return currentCharacterCustomizationManager.checkIfObjectAlreadyOnCurrentPiecesList (pieceName);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public string getArmorClothPieceByName (string categoryName)
|
||||
{
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
return currentCharacterCustomizationManager.getArmorClothPieceByName (categoryName);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public string getArmorClothCategoryByName (string categoryName)
|
||||
{
|
||||
if (currentCharacterCustomizationManager != null) {
|
||||
return currentCharacterCustomizationManager.getArmorClothCategoryByName (categoryName);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class characterCustomizationButtonInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public GameObject buttonObject;
|
||||
|
||||
public bool canBePressedMultipleTimes;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool setObjectActiveState;
|
||||
|
||||
public bool setObjectActive;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool isToggle;
|
||||
|
||||
public string toggleName;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool disableOtherObjects;
|
||||
|
||||
public string categoryOfObjectsToDisable;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool isSlider;
|
||||
|
||||
public string sliderName;
|
||||
|
||||
public bool useRandomFloatValue;
|
||||
|
||||
public bool setInitialValueFromBlendshape;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool isFullSet;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class characterCustomizationTypeButtonInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
[Space]
|
||||
|
||||
public List<characterCustomizationButtonInfo> characterCustomizationButtonInfoList = new List<characterCustomizationButtonInfo> ();
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class panelCategoryInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
[Space]
|
||||
|
||||
public List<panelInfo> panelInfoList = new List<panelInfo> ();
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class panelInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public bool panelButtonEnabled = true;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public GameObject panelButton;
|
||||
|
||||
public GameObject panelObject;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool setCameraPositionOnPanel;
|
||||
|
||||
public Vector3 cameraPositionOffset;
|
||||
public Vector3 cameraEulerOffset;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool isCurrentPanel;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool useEventsOnSelectPanel;
|
||||
public UnityEvent eventOnSelectPanel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f49811f51128aec44b307c8cdef41041
|
||||
timeCreated: 1637206772
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterAspectCustomizationUISystem.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class characterCustomizationBlendshapesHelper : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public GameObject playerGameObject;
|
||||
|
||||
public characterCustomizationManager mainCharacterCustomizationManager;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug Temporal BlendShapes")]
|
||||
[Space]
|
||||
|
||||
public List<characterCustomizationManager.temporalBlendshapeInfo> temporalBlendshapeInfoList = new List<characterCustomizationManager.temporalBlendshapeInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Debug Temporal Accessories")]
|
||||
[Space]
|
||||
|
||||
public List<string> temporalCurrentAccessoriesList = new List<string> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool componentLocated;
|
||||
|
||||
|
||||
public void storeBlendshapesCustomization ()
|
||||
{
|
||||
if (!componentLocated) {
|
||||
checkMainCHaracterCustomizatationManager ();
|
||||
}
|
||||
|
||||
if (componentLocated) {
|
||||
temporalBlendshapeInfoList = mainCharacterCustomizationManager.getTemporalBlendshapeInfoList ();
|
||||
|
||||
temporalCurrentAccessoriesList = mainCharacterCustomizationManager.getCurrentAccessoriesList ();
|
||||
}
|
||||
}
|
||||
|
||||
public void setBlendshapeList ()
|
||||
{
|
||||
if (!componentLocated) {
|
||||
checkMainCHaracterCustomizatationManager ();
|
||||
}
|
||||
|
||||
if (componentLocated) {
|
||||
mainCharacterCustomizationManager.setBlendshapeList (temporalBlendshapeInfoList);
|
||||
|
||||
mainCharacterCustomizationManager.setCurrentAccessoriesList (temporalCurrentAccessoriesList);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkMainCHaracterCustomizatationManager ()
|
||||
{
|
||||
if (!componentLocated) {
|
||||
if (mainCharacterCustomizationManager == null && playerGameObject != null) {
|
||||
mainCharacterCustomizationManager = playerGameObject.GetComponentInChildren<characterCustomizationManager> ();
|
||||
}
|
||||
|
||||
componentLocated = mainCharacterCustomizationManager != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cc6b2f2b7993ee4cb3b5f3a9cf61943
|
||||
timeCreated: 1640457489
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterCustomizationBlendshapesHelper.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class characterCustomizationInfo
|
||||
{
|
||||
public string Name;
|
||||
public string typeName;
|
||||
|
||||
public string categoryName;
|
||||
|
||||
public int ID;
|
||||
|
||||
[Space]
|
||||
|
||||
public float floatValue;
|
||||
public bool useRandomFloatValue;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool boolValue;
|
||||
public bool useRandomBoolValue;
|
||||
public bool useRandomObjectFromCategoryName;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool multipleElements;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class characterCustomizationTypeInfo
|
||||
{
|
||||
public string Name;
|
||||
public List<characterCustomizationInfo> characterCustomizationInfoList = new List<characterCustomizationInfo> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f05738297b22ada4a98ffad896e9b0fd
|
||||
timeCreated: 1637202608
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterCustomizationInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,128 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using static initialinventoryListData;
|
||||
|
||||
public class characterCustomizationInventoryHelper : inventoryManagerInfo
|
||||
{
|
||||
[Space]
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public bool setCharacterElementsEquipped = true;
|
||||
|
||||
public int amountOnElements = 1;
|
||||
|
||||
[Space]
|
||||
[Header ("Extra Inventory Objects")]
|
||||
[Space]
|
||||
|
||||
public bool useExtraInventoryObjectsForArmorSet;
|
||||
|
||||
public List<extraInventoryInfo> extraInventoryInfoList = new List<extraInventoryInfo> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool showDebugPrint;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public characterCustomizationManager mainCharacterCustomizationManager;
|
||||
|
||||
public inventoryListManager mainInventoryListManager;
|
||||
|
||||
public fullArmorClothTemplateData mainFullArmorClothTemplateData;
|
||||
|
||||
|
||||
public void storeCustomizationElementsAsInventory ()
|
||||
{
|
||||
inventoryList.Clear ();
|
||||
|
||||
List<string> currentPiecesList = mainCharacterCustomizationManager.getCurrentPiecesList ();
|
||||
|
||||
for (int i = 0; i < currentPiecesList.Count; i++) {
|
||||
|
||||
inventoryInfo newInventoryInfo = mainInventoryListManager.getInventoryInfoFromName (currentPiecesList [i]);
|
||||
|
||||
if (newInventoryInfo != null) {
|
||||
newInventoryInfo.amount = amountOnElements;
|
||||
newInventoryInfo.isEquipped = setCharacterElementsEquipped;
|
||||
|
||||
inventoryList.Add (newInventoryInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//check if the pieces list have a complete set of armor, obtain its name and get the list of extra inventory objects for it
|
||||
|
||||
if (useExtraInventoryObjectsForArmorSet) {
|
||||
bool isFullArmorCompleteResult = false;
|
||||
|
||||
string fullArmorClothName = GKC_Utils.checkFullArmorClothState (mainFullArmorClothTemplateData, currentPiecesList, showDebugPrint);
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("checking for extra inventory, and if armor set complete ");
|
||||
}
|
||||
|
||||
if (fullArmorClothName == null || fullArmorClothName == "") {
|
||||
isFullArmorCompleteResult = false;
|
||||
} else {
|
||||
isFullArmorCompleteResult = true;
|
||||
}
|
||||
|
||||
if (!isFullArmorCompleteResult) {
|
||||
if (showDebugPrint) {
|
||||
print ("armor full not found, cancelling");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("armor full found " + fullArmorClothName);
|
||||
}
|
||||
|
||||
int newIndex = extraInventoryInfoList.FindIndex (s => s.armorSetToUseName.Equals (fullArmorClothName));
|
||||
|
||||
if (newIndex <= -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
extraInventoryInfo currentExtraInventoryInfo = extraInventoryInfoList [newIndex];
|
||||
|
||||
initialinventoryListData mainInitialinventoryListData = currentExtraInventoryInfo.mainInitialinventoryListData;
|
||||
|
||||
int extraObjectsCount = mainInitialinventoryListData.initialInventoryObjectInfoList.Count;
|
||||
|
||||
for (int i = 0; i < extraObjectsCount; i++) {
|
||||
|
||||
initialInventoryObjectInfo currentExtraObject = mainInitialinventoryListData.initialInventoryObjectInfoList [i];
|
||||
|
||||
if (currentExtraObject.addInventoryObject) {
|
||||
inventoryInfo newInventoryInfo = mainInventoryListManager.getInventoryInfoFromName (currentExtraObject.Name);
|
||||
|
||||
if (newInventoryInfo != null) {
|
||||
newInventoryInfo.amount = currentExtraObject.amount;
|
||||
newInventoryInfo.isEquipped = currentExtraObject.isEquipped;
|
||||
|
||||
inventoryList.Add (newInventoryInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class extraInventoryInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public string armorSetToUseName;
|
||||
|
||||
public initialinventoryListData mainInitialinventoryListData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1f08f2315a49ca4bb337853dda4381a
|
||||
timeCreated: 1640437079
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterCustomizationInventoryHelper.cs
|
||||
uploadId: 814740
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b60c777abf859741820a4a9cd53cfd2
|
||||
timeCreated: 1637209512
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/characterCustomizationManager.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Full Armor-Cloth Template", menuName = "GKC/Create Full Armor-Cloth Template", order = 51)]
|
||||
public class fullArmorClothTemplate : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public int ID = 0;
|
||||
|
||||
[Space]
|
||||
|
||||
public List<string> fullArmorPiecesList = new List<string> ();
|
||||
|
||||
[Space]
|
||||
|
||||
public List<armorClothStatsInfo> armorClothStatsInfoList = new List<armorClothStatsInfo> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62aa90d06e00cd947b14fbc90646b560
|
||||
timeCreated: 1638744564
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/fullArmorClothTemplate.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu (fileName = "Character Full Armor-Cloth Template List", menuName = "GKC/Create Full Armor-Cloth Piece Template List", order = 51)]
|
||||
public class fullArmorClothTemplateData : ScriptableObject
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public int ID = 0;
|
||||
|
||||
public List<fullArmorClothTemplate> fullArmorClothTemplateList = new List<fullArmorClothTemplate> ();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43c84f0e78da1d04281821566f0b940b
|
||||
timeCreated: 1659828631
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Character Aspect Customization System/fullArmorClothTemplateData.cs
|
||||
uploadId: 814740
|
||||
Reference in New Issue
Block a user