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/Grab Objects/checkObjectOnTrigger.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/Grab Objects/grabObjectEventSystem.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/Grab Objects/grabObjectGenericModeMountPointSystem.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/Grab Objects/grabObjectParent.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/Grab Objects/grabObjectProperties.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -52,6 +52,8 @@ public class grabObjects : MonoBehaviour
|
||||
public bool grabObjectsEnabled;
|
||||
public Shader pickableShader;
|
||||
|
||||
bool pickableShaderFound;
|
||||
|
||||
public string defaultShaderName = "Legacy Shaders/Transparent/Diffuse";
|
||||
|
||||
public float headTrackBodyWeightOnAim = 1;
|
||||
@@ -1123,11 +1125,19 @@ public class grabObjects : MonoBehaviour
|
||||
outlineObjectSystem currentOutlineObjectSystem = objectHeld.GetComponentInChildren<outlineObjectSystem> ();
|
||||
|
||||
if (currentOutlineObjectSystem != null) {
|
||||
if (pickableShader == null) {
|
||||
pickableShader = Shader.Find (defaultShaderName);
|
||||
if (!pickableShaderFound) {
|
||||
pickableShaderFound = pickableShader != null;
|
||||
|
||||
if (!pickableShaderFound) {
|
||||
pickableShader = Shader.Find (defaultShaderName);
|
||||
|
||||
pickableShaderFound = pickableShader != null;
|
||||
}
|
||||
}
|
||||
|
||||
currentOutlineObjectSystem.setTransparencyState (true, pickableShader, alphaTransparency);
|
||||
if (pickableShaderFound) {
|
||||
currentOutlineObjectSystem.setTransparencyState (true, pickableShader, alphaTransparency);
|
||||
}
|
||||
|
||||
currentObjectUsingTransparency = true;
|
||||
}
|
||||
@@ -1286,11 +1296,19 @@ public class grabObjects : MonoBehaviour
|
||||
outlineObjectSystem currentOutlineObjectSystem = objectHeld.GetComponentInChildren<outlineObjectSystem> ();
|
||||
|
||||
if (currentOutlineObjectSystem != null) {
|
||||
if (pickableShader == null) {
|
||||
pickableShader = Shader.Find (defaultShaderName);
|
||||
if (!pickableShaderFound) {
|
||||
pickableShaderFound = pickableShader != null;
|
||||
|
||||
if (!pickableShaderFound) {
|
||||
pickableShader = Shader.Find (defaultShaderName);
|
||||
|
||||
pickableShaderFound = pickableShader != null;
|
||||
}
|
||||
}
|
||||
|
||||
currentOutlineObjectSystem.setTransparencyState (true, pickableShader, alphaTransparency);
|
||||
if (pickableShaderFound) {
|
||||
currentOutlineObjectSystem.setTransparencyState (true, pickableShader, alphaTransparency);
|
||||
}
|
||||
|
||||
currentObjectUsingTransparency = true;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,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/Grab Objects/grabObjects.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -126,11 +126,12 @@ public class grabObjectsPowerSystem : MonoBehaviour
|
||||
|
||||
float lastTimeObjectsGrabbed;
|
||||
|
||||
|
||||
void FixedUpdate ()
|
||||
{
|
||||
playerCurrentlyBusy = mainOtherPowers.playerIsBusy ();
|
||||
|
||||
canMove = mainOtherPowers.canMove;
|
||||
canMove = mainOtherPowers.canPlayerMove ();
|
||||
|
||||
if (carryingObjects) {
|
||||
if (grabbedObjectList.Count > 0) {
|
||||
@@ -482,7 +483,7 @@ public class grabObjectsPowerSystem : MonoBehaviour
|
||||
currentLaunchedObjects.setOnTriggerInfoCheckState (checkOnTriggerEnterEnabled, layermaskToCheckOnTriggerEnter);
|
||||
}
|
||||
|
||||
if (setUseCustomDamageAmountState){
|
||||
if (setUseCustomDamageAmountState) {
|
||||
currentLaunchedObjects.setUseCustomDamageAmountValues (useCustomDamageAmount, customDamageAmount);
|
||||
}
|
||||
|
||||
|
||||
@@ -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/Grab Objects/grabObjectsPowerSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -9,7 +9,8 @@ DefaultImporter:
|
||||
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/Grab Objects/grabPhysicalObjectMeleeAttackSystem.cs.bak
|
||||
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/Grab Objects/grabPhysicalObjectMeleeAttackSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -200,6 +200,11 @@ public class grabPhysicalObjectSystem : MonoBehaviour
|
||||
public UnityEvent eventOnGrab;
|
||||
public UnityEvent eventOnDrop;
|
||||
|
||||
[Space]
|
||||
|
||||
public bool useEventToSendPlayer;
|
||||
public eventParameters.eventToCallWithGameObject eventToSendPlayer;
|
||||
|
||||
[Space]
|
||||
[Header ("Remote Event Settings")]
|
||||
[Space]
|
||||
@@ -390,6 +395,12 @@ public class grabPhysicalObjectSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (useEventToSendPlayer) {
|
||||
if (currentPlayer != null) {
|
||||
eventToSendPlayer.Invoke (currentPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
checkEventsOnGrabDrop (true);
|
||||
|
||||
checkRemoteEvents (true);
|
||||
|
||||
@@ -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/Grab Objects/grabPhysicalObjectSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -93,6 +93,9 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
public string cancelBlockReactionStateName = "Disable Has Exit Time State";
|
||||
|
||||
public bool ignoreDeflectProjectilesOnAttackOnAllWeapons;
|
||||
public bool ignoreDeflectProjectilesOnBlockOnAllWeapons;
|
||||
|
||||
// [Space]
|
||||
// [Header ("Shield Settings")]
|
||||
// [Space]
|
||||
@@ -286,11 +289,30 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
public playerInputManager playerInput;
|
||||
|
||||
public Transform parentToPlaceTriggerInFrontOfCharacter;
|
||||
public Transform parentToPlaceTriggerInFrontOfCharacterFBA;
|
||||
|
||||
public meleeCombatThrowReturnWeaponSystem mainMeleeCombatThrowReturnWeaponSystem;
|
||||
|
||||
public meleeUISystem mainMeleeUISystem;
|
||||
|
||||
public bool useAttackInputStack;
|
||||
public int maxAmountOfAttackInputStack;
|
||||
|
||||
|
||||
public bool extraTriggerMultiplierScaleOnAllMeleeAttacksActive;
|
||||
public float extraTriggerMultiplierScaleOnAllMeleeAttacksAmount;
|
||||
|
||||
|
||||
bool attackInputStackComplete;
|
||||
|
||||
List<string> attackInputStackList = new List<string> ();
|
||||
|
||||
bool attackInputStackActive;
|
||||
|
||||
bool ignoreAddAttackInputToStackActive;
|
||||
|
||||
|
||||
Transform newParentToPlaceTrigger;
|
||||
|
||||
Transform objectRotationPoint;
|
||||
|
||||
@@ -399,6 +421,9 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
string customSurfaceInfoOnMeleeAttackNameForSwingOnAir;
|
||||
|
||||
Coroutine updateCoroutine;
|
||||
|
||||
|
||||
private void InitializeAudioElements ()
|
||||
{
|
||||
bool mainAudioSourceLocated = mainAudioSource != null;
|
||||
@@ -434,6 +459,74 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
originalUseMatchTargetSystemOnAttack = useMatchTargetSystemOnAttack;
|
||||
}
|
||||
|
||||
|
||||
public void stopUpdateCoroutine ()
|
||||
{
|
||||
if (updateCoroutine != null) {
|
||||
StopCoroutine (updateCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator updateSystemCoroutine ()
|
||||
{
|
||||
var waitTime = new WaitForFixedUpdate ();
|
||||
|
||||
while (true) {
|
||||
updateSystem ();
|
||||
|
||||
yield return waitTime;
|
||||
}
|
||||
}
|
||||
|
||||
void updateSystem ()
|
||||
{
|
||||
if (useAttackInputStack && attackInputStackActive) {
|
||||
if (attackInputStackList.Count > 0 && !attackInProcess && canUseWeaponsInput ()) {
|
||||
ignoreAddAttackInputToStackActive = true;
|
||||
|
||||
attackInputStackComplete = false;
|
||||
|
||||
activateGrabbedObjectMeleeAttack (attackInputStackList [0]);
|
||||
|
||||
attackInputStackList.RemoveAt (0);
|
||||
|
||||
ignoreAddAttackInputToStackActive = false;
|
||||
|
||||
if (attackInputStackList.Count == 0) {
|
||||
attackInputStackActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ((isActionActive () && !attackInProcess) ||
|
||||
objectThrown ||
|
||||
cuttingModeActive ||
|
||||
blockActive ||
|
||||
(useThrowReturnMeleeWeaponSystemEnabled &&
|
||||
(mainMeleeCombatThrowReturnWeaponSystem.isReturningThrownObject ()))) {
|
||||
|
||||
resetAttackInputStack ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void checkIfAddAttackToStack (string attackType)
|
||||
{
|
||||
if (useAttackInputStack && !attackInputStackComplete) {
|
||||
|
||||
if (!ignoreAddAttackInputToStackActive) {
|
||||
if (attackInputStackList.Count < maxAmountOfAttackInputStack) {
|
||||
attackInputStackList.Add (attackType);
|
||||
|
||||
attackInputStackActive = true;
|
||||
}
|
||||
|
||||
if (attackInputStackList.Count >= maxAmountOfAttackInputStack) {
|
||||
attackInputStackComplete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool isGrabbedObjectMeleeAttackEnabled ()
|
||||
{
|
||||
return grabbedObjectMeleeAttackEnabled;
|
||||
@@ -874,9 +967,9 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
mainDualWieldMeleeWeaponObjectSystem.enableDualWieldMeleeweapobObject (this, currentGrabbedWeaponInfo.useEventsOnDamageDetected);
|
||||
}
|
||||
|
||||
deflectProjectilesEnabled = currentMeleeWeapon.deflectProjectilesEnabled;
|
||||
deflectProjectilesEnabled = currentMeleeWeapon.deflectProjectilesEnabled && !ignoreDeflectProjectilesOnAttackOnAllWeapons;
|
||||
|
||||
deflectProjectilesOnBlockEnabled = currentMeleeWeapon.deflectProjectilesOnBlockEnabled;
|
||||
deflectProjectilesOnBlockEnabled = currentMeleeWeapon.deflectProjectilesOnBlockEnabled && !ignoreDeflectProjectilesOnBlockOnAllWeapons;
|
||||
|
||||
if (deflectProjectilesEnabled || deflectProjectilesOnBlockEnabled) {
|
||||
currentMeleeWeapon.mainArmoreSurfaceSystem.gameObject.SetActive (true);
|
||||
@@ -927,9 +1020,21 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
if (mainMeleeUISystem != null) {
|
||||
mainMeleeUISystem.enableOrDisableMeleeUI (true);
|
||||
|
||||
mainMeleeUISystem.setCurrentMeleeWeaponName (currentMeleeWeapon.getWeaponName ());
|
||||
string meleeWeaponNameForUI = currentMeleeWeapon.getWeaponName ();
|
||||
|
||||
mainMeleeUISystem.setCurrrentMeleeWeaponIcon (GKC_Utils.getInventoryObjectIconByName (currentMeleeWeapon.getWeaponName ()));
|
||||
if (currentGrabbedWeaponInfo.isEmptyWeaponToUseOnlyShield) {
|
||||
meleeWeaponNameForUI = mainMeleeWeaponsGrabbedManager.getCurrentShieldName ();
|
||||
}
|
||||
|
||||
mainMeleeUISystem.setCurrentMeleeWeaponName (meleeWeaponNameForUI);
|
||||
|
||||
mainMeleeUISystem.setCurrrentMeleeWeaponIcon (GKC_Utils.getInventoryObjectIconByName (meleeWeaponNameForUI));
|
||||
}
|
||||
|
||||
if (useAttackInputStack) {
|
||||
stopUpdateCoroutine ();
|
||||
|
||||
updateCoroutine = StartCoroutine (updateSystemCoroutine ());
|
||||
}
|
||||
} else {
|
||||
removeGrabPhysicalObjectMeleeAttackSystem ();
|
||||
@@ -959,6 +1064,10 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if (useAttackInputStack) {
|
||||
stopUpdateCoroutine ();
|
||||
}
|
||||
|
||||
mainPlayerController.setPlayerUsingMeleeWeaponsState (false);
|
||||
|
||||
if (currentMeleeWeapon != null) {
|
||||
@@ -1142,21 +1251,21 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
public void drawOrKeepMeleeWeapon ()
|
||||
{
|
||||
if (mainMeleeWeaponsGrabbedManager.meleeWeaponsGrabbedManagerActive) {
|
||||
if (mainMeleeWeaponsGrabbedManager.isMeleeWeaponsGrabbedManagerActive ()) {
|
||||
mainMeleeWeaponsGrabbedManager.inputDrawOrKeepMeleeWeapon ();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawOrKeepMeleeWeaponWithoutCheckingInputActive ()
|
||||
{
|
||||
if (mainMeleeWeaponsGrabbedManager.meleeWeaponsGrabbedManagerActive) {
|
||||
if (mainMeleeWeaponsGrabbedManager.isMeleeWeaponsGrabbedManagerActive ()) {
|
||||
mainMeleeWeaponsGrabbedManager.drawOrKeepMeleeWeaponWithoutCheckingInputActive ();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawMeleeWeaponGrabbedCheckingAnimationDelay ()
|
||||
{
|
||||
if (mainMeleeWeaponsGrabbedManager.meleeWeaponsGrabbedManagerActive) {
|
||||
if (mainMeleeWeaponsGrabbedManager.isMeleeWeaponsGrabbedManagerActive ()) {
|
||||
mainMeleeWeaponsGrabbedManager.drawMeleeWeaponGrabbedCheckingAnimationDelay ();
|
||||
}
|
||||
}
|
||||
@@ -1173,7 +1282,7 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
public void checkIfDropThrownWeaponWhenUsingDevice ()
|
||||
{
|
||||
if (mainMeleeWeaponsGrabbedManager.meleeWeaponsGrabbedManagerActive) {
|
||||
if (mainMeleeWeaponsGrabbedManager.isMeleeWeaponsGrabbedManagerActive ()) {
|
||||
mainMeleeWeaponsGrabbedManager.checkIfDropThrownWeaponWhenUsingDevice ();
|
||||
}
|
||||
}
|
||||
@@ -1237,19 +1346,39 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
if (currentAttackInfo != null && currentAttackInfo.attackType != "") {
|
||||
ignoreTimeToPlayNextAttackActive = true;
|
||||
|
||||
//ignoreAddAttackInputToStackActive = true;
|
||||
ignoreAddAttackInputToStackActive = true;
|
||||
|
||||
activateGrabbedObjectMeleeAttack (currentAttackInfo.attackType);
|
||||
|
||||
ignoreTimeToPlayNextAttackActive = false;
|
||||
|
||||
//ignoreAddAttackInputToStackActive = false;
|
||||
ignoreAddAttackInputToStackActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkResetAttackInputStack ()
|
||||
{
|
||||
if (useAttackInputStack && attackInputStackActive) {
|
||||
resetAttackInputStack ();
|
||||
}
|
||||
}
|
||||
|
||||
public void resetAttackInputStack ()
|
||||
{
|
||||
if (attackInputStackActive) {
|
||||
attackInputStackList.Clear ();
|
||||
|
||||
attackInputStackActive = false;
|
||||
|
||||
attackInputStackComplete = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool drawMeleeWeaponIfAttackInputPressedEnabled;
|
||||
|
||||
public bool useQuickDrawIfAttackInputPressed;
|
||||
|
||||
bool ignoreTimeToPlayNextAttackActive;
|
||||
|
||||
public void activateGrabbedObjectMeleeAttack (string attackType)
|
||||
@@ -1296,10 +1425,26 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
if (useAttackInputStack && attackInputStackActive) {
|
||||
if (attackInputStackComplete) {
|
||||
//print ("stack complete, cancelling input");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (drawMeleeWeaponIfAttackInputPressedEnabled) {
|
||||
if (!carryingObject) {
|
||||
if (useQuickDrawIfAttackInputPressed) {
|
||||
setIgnoreUseDrawKeepWeaponAnimationState (true);
|
||||
}
|
||||
|
||||
drawOrKeepMeleeWeapon ();
|
||||
|
||||
if (useQuickDrawIfAttackInputPressed) {
|
||||
setOriginalIgnoreUseDrawKeepWeaponAnimationState ();
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("draw weapon by attack input");
|
||||
}
|
||||
@@ -1385,6 +1530,8 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
currentWaitTimeToNextAttack = 0;
|
||||
|
||||
checkIfAddAttackToStack (attackType);
|
||||
|
||||
return;
|
||||
} else {
|
||||
currentWaitTimeToNextAttack = currentAttackInfo.minDelayBeforeNextAttack;
|
||||
@@ -1462,6 +1609,10 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
if (cancelAttack) {
|
||||
print ("cancel attack");
|
||||
|
||||
checkIfAddAttackToStack (attackType);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2189,21 +2340,33 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (extraTriggerMultiplierScaleOnAllMeleeAttacksActive) {
|
||||
if (enableMainHitCombat) {
|
||||
setHitCombatScaleMultiplier (extraTriggerMultiplierScaleOnAllMeleeAttacksAmount);
|
||||
} else {
|
||||
mainDualWieldMeleeWeaponObjectSystem.setHitCombatScaleMultiplier (extraTriggerMultiplierScaleOnAllMeleeAttacksAmount);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentdamageTriggerActiveInfo.changeDamageTriggerToLimb || placeTriggerInFrontOfCharacterOnAllAttacksResult) {
|
||||
Transform newParent = null;
|
||||
newParentToPlaceTrigger = null;
|
||||
|
||||
if (currentdamageTriggerActiveInfo.placeTriggerInFrontOfCharacter || placeTriggerInFrontOfCharacterOnAllAttacksResult) {
|
||||
newParent = parentToPlaceTriggerInFrontOfCharacter;
|
||||
if (mainPlayerController.isFullBodyAwarenessActive ()) {
|
||||
newParentToPlaceTrigger = parentToPlaceTriggerInFrontOfCharacterFBA;
|
||||
} else {
|
||||
newParentToPlaceTrigger = parentToPlaceTriggerInFrontOfCharacter;
|
||||
}
|
||||
|
||||
if (newParent == null) {
|
||||
newParent = playerControllerGameObject.transform;
|
||||
if (newParentToPlaceTrigger == null) {
|
||||
newParentToPlaceTrigger = playerControllerGameObject.transform;
|
||||
}
|
||||
} else {
|
||||
newParent = getCharacterHumanBone (currentdamageTriggerActiveInfo.limbToPlaceTrigger);
|
||||
newParentToPlaceTrigger = getCharacterHumanBone (currentdamageTriggerActiveInfo.limbToPlaceTrigger);
|
||||
}
|
||||
|
||||
if (newParent != null) {
|
||||
attackHitCombat.transform.SetParent (newParent);
|
||||
if (newParentToPlaceTrigger != null) {
|
||||
attackHitCombat.transform.SetParent (newParentToPlaceTrigger);
|
||||
attackHitCombat.transform.localPosition = Vector3.zero;
|
||||
attackHitCombat.transform.localRotation = Quaternion.identity;
|
||||
|
||||
@@ -2894,7 +3057,7 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
{
|
||||
shieldActive = state;
|
||||
|
||||
// print ("shield state " + shieldActive + " " + carryingObject);
|
||||
//print ("shield state " + shieldActive + " " + carryingObject);
|
||||
|
||||
if (!carryingObject) {
|
||||
if (mainMeleeWeaponsGrabbedManager.isCurrentMeleeWeaponSheathedOrCarried ()) {
|
||||
@@ -2915,7 +3078,13 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
eventToActivateMeleeModeWhenUsingShieldWithoutMeleeWeapon.Invoke ();
|
||||
}
|
||||
|
||||
mainMeleeWeaponsGrabbedManager.checkMeleeWeaponToUse (grabbedWeaponInfoList [i].Name, false);
|
||||
if (mainMeleeWeaponsGrabbedManager.isUseEquipShieldCheckWhenActivatingShieldActive ()) {
|
||||
mainMeleeWeaponsGrabbedManager.equipMeleeWeapon (grabbedWeaponInfoList [i].Name, false, true);
|
||||
|
||||
mainMeleeWeaponsGrabbedManager.setUseEquipShieldCheckWhenActivatingShieldState (false);
|
||||
} else {
|
||||
mainMeleeWeaponsGrabbedManager.checkMeleeWeaponToUse (grabbedWeaponInfoList [i].Name, false);
|
||||
}
|
||||
|
||||
emptyMeleeWeaponForShieldFound = true;
|
||||
}
|
||||
@@ -3052,6 +3221,8 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
currentShieldGameObject.transform.localPosition = currentShieldBackMountPointTransformReference.localPosition;
|
||||
currentShieldGameObject.transform.localRotation = currentShieldBackMountPointTransformReference.localRotation;
|
||||
}
|
||||
|
||||
//print ("setShieldParentState " + state + " " + currentShieldGameObject.name);
|
||||
}
|
||||
|
||||
bool checkingSetShieldActiveIfCarryingShield;
|
||||
@@ -3196,6 +3367,13 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void setHitCombatScaleMultiplier (float newMultiplier)
|
||||
{
|
||||
if (currentHitCombatBoxCollider != null) {
|
||||
currentHitCombatBoxCollider.size *= newMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
void setHitCombatOffset (Vector3 newValue)
|
||||
{
|
||||
if (currentHitCombatBoxCollider != null) {
|
||||
@@ -3367,6 +3545,15 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
|
||||
void setAttackInfoTemplateByIndex (int newIndex)
|
||||
{
|
||||
if (currentGrabbedWeaponInfo.meleeWeaponAttackInfoList.Count == 0 ||
|
||||
newIndex >= currentGrabbedWeaponInfo.meleeWeaponAttackInfoList.Count) {
|
||||
|
||||
print ("setAttackInfoTemplateByIndex trying to use an index higher than" +
|
||||
" the amount of attack template list elements, cancelling");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
currentAttackIndex = 0;
|
||||
|
||||
currentAttackInfoTemplateIndex = newIndex;
|
||||
@@ -5075,6 +5262,24 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
setUseMatchTargetSystemOnAttackState (originalUseMatchTargetSystemOnAttack);
|
||||
}
|
||||
|
||||
public void enableOrDisableUseAttackInputStack (bool state)
|
||||
{
|
||||
useAttackInputStack = state;
|
||||
}
|
||||
|
||||
public void setPlaceTriggerInFrontOfCharacterOnAllAttacksState (bool state)
|
||||
{
|
||||
placeTriggerInFrontOfCharacterOnAllAttacks = state;
|
||||
}
|
||||
|
||||
public void setExtraTriggerMultiplierScaleOnAllMeleeAttacksActiveState (bool state, float value)
|
||||
{
|
||||
extraTriggerMultiplierScaleOnAllMeleeAttacksActive = state;
|
||||
|
||||
extraTriggerMultiplierScaleOnAllMeleeAttacksAmount = value;
|
||||
}
|
||||
|
||||
|
||||
//EDITOR FUNCTIONS
|
||||
public void setCheckDurabilityOnAttackEnabledStateFromEditor (bool state)
|
||||
{
|
||||
@@ -5138,6 +5343,13 @@ public class grabbedObjectMeleeAttackSystem : MonoBehaviour
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void enableOrDisableUseAttackInputStackFromEditor (bool state)
|
||||
{
|
||||
enableOrDisableUseAttackInputStack (state);
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void updateGrabbedWeaponReferenceValuesOnAllWeaponInfoList ()
|
||||
{
|
||||
int grabbedWeaponInfoListCount = grabbedWeaponInfoList.Count;
|
||||
|
||||
@@ -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/Grab Objects/grabbedObjectMeleeAttackSystem.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/Grab Objects/grabbedObjectState.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/Grab Objects/objectDistributorSystem.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/Grab Objects/objectToPlaceSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -1,413 +1,454 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class outlineObjectSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useOutlineEnabled = true;
|
||||
public bool useOutlineEnabled = true;
|
||||
|
||||
public string shaderOutlineWidthName = "_Outline";
|
||||
public string shaderOutlineColorName = "_OutlineColor";
|
||||
public string shaderOutlineWidthName = "_Outline";
|
||||
public string shaderOutlineColorName = "_OutlineColor";
|
||||
|
||||
[Space]
|
||||
[Header ("Custom Outline Settings")]
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool useCustomOutlineValues;
|
||||
public float customOutlineWidth = 0.05f;
|
||||
public Color customOutlineColor = Color.yellow;
|
||||
public bool useCustomShader;
|
||||
public Shader customShader;
|
||||
public bool ignoreShaderOutlineChange;
|
||||
|
||||
public float customActiveDuration = 2;
|
||||
[Space]
|
||||
[Header ("Custom Outline Settings")]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Header ("Transparency Settings")]
|
||||
[Space]
|
||||
public bool useCustomOutlineValues;
|
||||
public float customOutlineWidth = 0.05f;
|
||||
public Color customOutlineColor = Color.yellow;
|
||||
public bool useCustomShader;
|
||||
public Shader customShader;
|
||||
|
||||
public bool useTransparencyActive = true;
|
||||
public bool transparencyActive;
|
||||
public float customActiveDuration = 2;
|
||||
|
||||
public bool useCustomTransparencyValues;
|
||||
public float customAlphaTransparency;
|
||||
[Space]
|
||||
[Header ("Transparency Settings")]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Header ("Others Settings")]
|
||||
[Space]
|
||||
public bool useTransparencyActive = true;
|
||||
public bool transparencyActive;
|
||||
|
||||
public GameObject meshParent;
|
||||
public bool useCustomTransparencyValues;
|
||||
public float customAlphaTransparency;
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
public string transparencyColorName = "_BaseColor";
|
||||
|
||||
public bool ignoreParticles;
|
||||
public bool ignoreLineRenderer;
|
||||
[Space]
|
||||
[Header ("Others Settings")]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
public GameObject meshParent;
|
||||
|
||||
public bool useMeshesToIgnore;
|
||||
public List<Transform> meshesToIgnore = new List<Transform> ();
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Space]
|
||||
public bool ignoreParticles;
|
||||
public bool ignoreLineRenderer;
|
||||
|
||||
public bool useCustomMeshList;
|
||||
public List<Transform> customMeshList = new List<Transform> ();
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
public bool useMeshesToIgnore;
|
||||
public List<Transform> meshesToIgnore = new List<Transform> ();
|
||||
|
||||
public bool showDebugPrint;
|
||||
[Space]
|
||||
[Space]
|
||||
|
||||
public bool renderElementsStored;
|
||||
public bool useCustomMeshList;
|
||||
public List<Transform> customMeshList = new List<Transform> ();
|
||||
|
||||
public bool outlineActive;
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool outlineTemporaryActive;
|
||||
public bool showDebugPrint;
|
||||
|
||||
[Space]
|
||||
[Header ("Render Parts Debug")]
|
||||
[Space]
|
||||
public bool renderElementsStored;
|
||||
|
||||
public List<Renderer> rendererParts = new List<Renderer> ();
|
||||
public bool outlineActive;
|
||||
|
||||
List<Shader> originalShader = new List<Shader> ();
|
||||
public bool outlineTemporaryActive;
|
||||
|
||||
Shader currentOutlineShader;
|
||||
float currentOutlineWidht;
|
||||
Color currentOutlieColor;
|
||||
[Space]
|
||||
[Header ("Render Parts Debug")]
|
||||
[Space]
|
||||
|
||||
List<Transform> objectsToIgnoreChildren = new List<Transform> ();
|
||||
public List<Renderer> rendererParts = new List<Renderer> ();
|
||||
|
||||
List<playerController> playerControllerList = new List<playerController> ();
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
|
||||
bool meshesToIgnoreConfigured;
|
||||
public bool useEventOnOutlineStateChange;
|
||||
public UnityEvent eventOnEnableOutline;
|
||||
public UnityEvent eventOnDisableOutline;
|
||||
|
||||
int shaderOutlineWidthID = -1;
|
||||
int shaderOutlineColorID = -1;
|
||||
|
||||
Coroutine temporalStateCoroutine;
|
||||
List<Shader> originalShader = new List<Shader> ();
|
||||
|
||||
Shader currentOutlineShader;
|
||||
float currentOutlineWidht;
|
||||
Color currentOutlieColor;
|
||||
|
||||
public void enableCustomOutlineStateTemporaly ()
|
||||
{
|
||||
if (gameObject.activeSelf) {
|
||||
stopUpdateTemporalStateCoroutine ();
|
||||
List<Transform> objectsToIgnoreChildren = new List<Transform> ();
|
||||
|
||||
temporalStateCoroutine = StartCoroutine (updateTemporalStateCoroutine ());
|
||||
}
|
||||
}
|
||||
List<playerController> playerControllerList = new List<playerController> ();
|
||||
|
||||
public void stopUpdateTemporalStateCoroutine ()
|
||||
{
|
||||
if (temporalStateCoroutine != null) {
|
||||
StopCoroutine (temporalStateCoroutine);
|
||||
}
|
||||
}
|
||||
bool meshesToIgnoreConfigured;
|
||||
|
||||
IEnumerator updateTemporalStateCoroutine ()
|
||||
{
|
||||
if (!outlineTemporaryActive) {
|
||||
enableCustomOutlineState ();
|
||||
}
|
||||
int shaderOutlineWidthID = -1;
|
||||
int shaderOutlineColorID = -1;
|
||||
|
||||
outlineTemporaryActive = true;
|
||||
Coroutine temporalStateCoroutine;
|
||||
|
||||
yield return new WaitForSecondsRealtime (customActiveDuration);
|
||||
int colorID = -1;
|
||||
|
||||
disableCustomOutlineState ();
|
||||
|
||||
outlineTemporaryActive = false;
|
||||
}
|
||||
public void enableCustomOutlineStateTemporaly ()
|
||||
{
|
||||
if (gameObject.activeSelf) {
|
||||
stopUpdateTemporalStateCoroutine ();
|
||||
|
||||
public void enableCustomOutlineState ()
|
||||
{
|
||||
setOutlineState (true, customShader, customOutlineWidth, customOutlineColor, null);
|
||||
}
|
||||
temporalStateCoroutine = StartCoroutine (updateTemporalStateCoroutine ());
|
||||
}
|
||||
}
|
||||
|
||||
public void disableCustomOutlineState ()
|
||||
{
|
||||
setOutlineState (false, customShader, customOutlineWidth, customOutlineColor, null);
|
||||
}
|
||||
public void stopUpdateTemporalStateCoroutine ()
|
||||
{
|
||||
if (temporalStateCoroutine != null) {
|
||||
StopCoroutine (temporalStateCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
public void setOutlineState (bool state, Shader shaderToApply, float shaderOutlineWidth,
|
||||
Color shaderOutlineColor, playerController newPlayerToCheck)
|
||||
{
|
||||
if (outlineActive == state) {
|
||||
return;
|
||||
}
|
||||
IEnumerator updateTemporalStateCoroutine ()
|
||||
{
|
||||
if (!outlineTemporaryActive) {
|
||||
enableCustomOutlineState ();
|
||||
}
|
||||
|
||||
outlineActive = state;
|
||||
outlineTemporaryActive = true;
|
||||
|
||||
if (!useOutlineEnabled) {
|
||||
return;
|
||||
}
|
||||
yield return new WaitForSecondsRealtime (customActiveDuration);
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("setting outline active state " + outlineActive);
|
||||
}
|
||||
disableCustomOutlineState ();
|
||||
|
||||
if (outlineActive) {
|
||||
if (useCustomShader) {
|
||||
shaderToApply = customShader;
|
||||
}
|
||||
outlineTemporaryActive = false;
|
||||
}
|
||||
|
||||
storeRenderElements ();
|
||||
public void enableCustomOutlineState ()
|
||||
{
|
||||
setOutlineState (true, customShader, customOutlineWidth, customOutlineColor, null);
|
||||
}
|
||||
|
||||
if (shaderOutlineWidthID == -1) {
|
||||
shaderOutlineWidthID = Shader.PropertyToID (shaderOutlineWidthName);
|
||||
}
|
||||
public void disableCustomOutlineState ()
|
||||
{
|
||||
setOutlineState (false, customShader, customOutlineWidth, customOutlineColor, null);
|
||||
}
|
||||
|
||||
if (shaderOutlineColorID == -1) {
|
||||
shaderOutlineColorID = Shader.PropertyToID (shaderOutlineColorName);
|
||||
}
|
||||
public void setOutlineState (bool state, Shader shaderToApply, float shaderOutlineWidth,
|
||||
Color shaderOutlineColor, playerController newPlayerToCheck)
|
||||
{
|
||||
if (outlineActive == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
outlineActive = state;
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
if (!useOutlineEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
if (showDebugPrint) {
|
||||
print ("setting outline active state " + outlineActive);
|
||||
}
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
if (outlineActive) {
|
||||
if (!ignoreShaderOutlineChange) {
|
||||
if (useCustomShader) {
|
||||
shaderToApply = customShader;
|
||||
}
|
||||
|
||||
currentMaterial.shader = shaderToApply;
|
||||
storeRenderElements ();
|
||||
|
||||
if (useCustomOutlineValues) {
|
||||
currentMaterial.SetFloat (shaderOutlineWidthID, customOutlineWidth);
|
||||
currentMaterial.SetColor (shaderOutlineColorID, customOutlineColor);
|
||||
} else {
|
||||
currentMaterial.SetFloat (shaderOutlineWidthID, shaderOutlineWidth);
|
||||
currentMaterial.SetColor (shaderOutlineColorID, shaderOutlineColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shaderOutlineWidthID == -1) {
|
||||
shaderOutlineWidthID = Shader.PropertyToID (shaderOutlineWidthName);
|
||||
}
|
||||
|
||||
currentOutlineShader = shaderToApply;
|
||||
currentOutlineWidht = shaderOutlineWidth;
|
||||
currentOutlieColor = shaderOutlineColor;
|
||||
if (shaderOutlineColorID == -1) {
|
||||
shaderOutlineColorID = Shader.PropertyToID (shaderOutlineColorName);
|
||||
}
|
||||
|
||||
if (newPlayerToCheck != null && !playerControllerList.Contains (newPlayerToCheck)) {
|
||||
playerControllerList.Add (newPlayerToCheck);
|
||||
}
|
||||
} else {
|
||||
if (newPlayerToCheck != null) {
|
||||
if (playerControllerList.Contains (newPlayerToCheck)) {
|
||||
playerControllerList.Remove (newPlayerToCheck);
|
||||
}
|
||||
}
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
if (playerControllerList.Count == 0) {
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
currentMaterial.shader = shaderToApply;
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
if (useCustomOutlineValues) {
|
||||
currentMaterial.SetFloat (shaderOutlineWidthID, customOutlineWidth);
|
||||
currentMaterial.SetColor (shaderOutlineColorID, customOutlineColor);
|
||||
} else {
|
||||
currentMaterial.SetFloat (shaderOutlineWidthID, shaderOutlineWidth);
|
||||
currentMaterial.SetColor (shaderOutlineColorID, shaderOutlineColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
currentOutlineShader = shaderToApply;
|
||||
currentOutlineWidht = shaderOutlineWidth;
|
||||
currentOutlieColor = shaderOutlineColor;
|
||||
}
|
||||
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
if (newPlayerToCheck != null && !playerControllerList.Contains (newPlayerToCheck)) {
|
||||
playerControllerList.Add (newPlayerToCheck);
|
||||
}
|
||||
} else {
|
||||
if (newPlayerToCheck != null) {
|
||||
if (playerControllerList.Contains (newPlayerToCheck)) {
|
||||
playerControllerList.Remove (newPlayerToCheck);
|
||||
}
|
||||
}
|
||||
|
||||
currentMaterial.shader = originalShader [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!ignoreShaderOutlineChange){
|
||||
if (playerControllerList.Count == 0) {
|
||||
|
||||
public bool isOutlineActive ()
|
||||
{
|
||||
return outlineActive;
|
||||
}
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
public GameObject getMeshParent ()
|
||||
{
|
||||
if (meshParent == null) {
|
||||
meshParent = gameObject;
|
||||
}
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
|
||||
return meshParent;
|
||||
}
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
public void storeRenderElements ()
|
||||
{
|
||||
if (meshParent == null) {
|
||||
meshParent = gameObject;
|
||||
}
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
if (useMeshesToIgnore && !meshesToIgnoreConfigured) {
|
||||
int meshesToIgnoreCount = meshesToIgnore.Count;
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
|
||||
for (int i = 0; i < meshesToIgnoreCount; i++) {
|
||||
Transform currentMeshToIgnore = meshesToIgnore [i];
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
|
||||
if (currentMeshToIgnore != null) {
|
||||
Component[] childrens = currentMeshToIgnore.GetComponentsInChildren (typeof(Transform));
|
||||
currentMaterial.shader = originalShader [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int childrensLength = childrens.Length;
|
||||
checkEventsOnOutlineStateChange (state);
|
||||
}
|
||||
|
||||
for (int j = 0; j < childrensLength; j++) {
|
||||
public bool isOutlineActive ()
|
||||
{
|
||||
return outlineActive;
|
||||
}
|
||||
|
||||
Transform child = childrens [j] as Transform;
|
||||
public GameObject getMeshParent ()
|
||||
{
|
||||
if (meshParent == null) {
|
||||
meshParent = gameObject;
|
||||
}
|
||||
|
||||
objectsToIgnoreChildren.Add (child);
|
||||
}
|
||||
}
|
||||
}
|
||||
return meshParent;
|
||||
}
|
||||
|
||||
meshesToIgnoreConfigured = true;
|
||||
}
|
||||
public void storeRenderElements ()
|
||||
{
|
||||
if (meshParent == null) {
|
||||
meshParent = gameObject;
|
||||
}
|
||||
|
||||
if (!renderElementsStored) {
|
||||
renderElementsStored = true;
|
||||
if (useMeshesToIgnore && !meshesToIgnoreConfigured) {
|
||||
int meshesToIgnoreCount = meshesToIgnore.Count;
|
||||
|
||||
Component[] components = meshParent.GetComponentsInChildren (typeof(Renderer));
|
||||
for (int i = 0; i < meshesToIgnoreCount; i++) {
|
||||
Transform currentMeshToIgnore = meshesToIgnore [i];
|
||||
|
||||
int componentsLength = components.Length;
|
||||
if (currentMeshToIgnore != null) {
|
||||
Component [] childrens = currentMeshToIgnore.GetComponentsInChildren (typeof (Transform));
|
||||
|
||||
for (int j = 0; j < componentsLength; j++) {
|
||||
int childrensLength = childrens.Length;
|
||||
|
||||
Renderer child = components [j] as Renderer;
|
||||
for (int j = 0; j < childrensLength; j++) {
|
||||
|
||||
bool addObject = true;
|
||||
Transform child = childrens [j] as Transform;
|
||||
|
||||
if (useCustomMeshList) {
|
||||
if (!customMeshList.Contains (child.transform)) {
|
||||
addObject = false;
|
||||
}
|
||||
}
|
||||
objectsToIgnoreChildren.Add (child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addObject) {
|
||||
if (!ignoreParticles || !child.GetComponent<ParticleSystem> ()) {
|
||||
if (!ignoreLineRenderer || !child.GetComponent<LineRenderer> ()) {
|
||||
|
||||
if (child.material.shader != null) {
|
||||
if (!useMeshesToIgnore || !checkChildsObjectsToIgnore (child.transform)) {
|
||||
rendererParts.Add (child);
|
||||
meshesToIgnoreConfigured = true;
|
||||
}
|
||||
|
||||
int materialsLength = child.materials.Length;
|
||||
if (!renderElementsStored) {
|
||||
renderElementsStored = true;
|
||||
|
||||
for (int i = 0; i < materialsLength; i++) {
|
||||
originalShader.Add (child.materials [i].shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Component [] components = meshParent.GetComponentsInChildren (typeof (Renderer));
|
||||
|
||||
public bool checkChildsObjectsToIgnore (Transform obj)
|
||||
{
|
||||
bool value = false;
|
||||
int componentsLength = components.Length;
|
||||
|
||||
if (meshesToIgnore.Contains (obj) || objectsToIgnoreChildren.Contains (obj)) {
|
||||
value = true;
|
||||
for (int j = 0; j < componentsLength; j++) {
|
||||
|
||||
return value;
|
||||
}
|
||||
Renderer child = components [j] as Renderer;
|
||||
|
||||
return value;
|
||||
}
|
||||
bool addObject = true;
|
||||
|
||||
public void disableOutlineAndRemoveUsers ()
|
||||
{
|
||||
playerControllerList.Clear ();
|
||||
if (useCustomMeshList) {
|
||||
if (!customMeshList.Contains (child.transform)) {
|
||||
addObject = false;
|
||||
}
|
||||
}
|
||||
|
||||
setOutlineState (false, null, 0, Color.white, null);
|
||||
if (addObject) {
|
||||
if (!ignoreParticles || !child.GetComponent<ParticleSystem> ()) {
|
||||
if (!ignoreLineRenderer || !child.GetComponent<LineRenderer> ()) {
|
||||
|
||||
useOutlineEnabled = false;
|
||||
if (child.material.shader != null) {
|
||||
if (!useMeshesToIgnore || !checkChildsObjectsToIgnore (child.transform)) {
|
||||
rendererParts.Add (child);
|
||||
|
||||
outlineActive = false;
|
||||
int materialsLength = child.materials.Length;
|
||||
|
||||
transparencyActive = false;
|
||||
for (int i = 0; i < materialsLength; i++) {
|
||||
originalShader.Add (child.materials [i].shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
useTransparencyActive = false;
|
||||
}
|
||||
public bool checkChildsObjectsToIgnore (Transform obj)
|
||||
{
|
||||
bool value = false;
|
||||
|
||||
public void setTransparencyState (bool state, Shader shaderToApply, float alphaTransparency)
|
||||
{
|
||||
if (state == transparencyActive) {
|
||||
return;
|
||||
}
|
||||
if (meshesToIgnore.Contains (obj) || objectsToIgnoreChildren.Contains (obj)) {
|
||||
value = true;
|
||||
|
||||
transparencyActive = state;
|
||||
return value;
|
||||
}
|
||||
|
||||
if (!useTransparencyActive) {
|
||||
return;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
if (showDebugPrint) {
|
||||
print ("setting transparency active state " + transparencyActive);
|
||||
}
|
||||
public void disableOutlineAndRemoveUsers ()
|
||||
{
|
||||
playerControllerList.Clear ();
|
||||
|
||||
if (transparencyActive) {
|
||||
setOutlineState (false, null, 0, Color.white, null);
|
||||
|
||||
storeRenderElements ();
|
||||
useOutlineEnabled = false;
|
||||
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
outlineActive = false;
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
transparencyActive = false;
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
useTransparencyActive = false;
|
||||
}
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
public void setTransparencyState (bool state, Shader shaderToApply, float alphaTransparency)
|
||||
{
|
||||
if (state == transparencyActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentMaterial.shader = shaderToApply;
|
||||
transparencyActive = state;
|
||||
|
||||
Color alpha = currentMaterial.color;
|
||||
if (!useTransparencyActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (useCustomTransparencyValues) {
|
||||
alpha.a = customAlphaTransparency;
|
||||
} else {
|
||||
alpha.a = alphaTransparency;
|
||||
}
|
||||
if (showDebugPrint) {
|
||||
print ("setting transparency active state " + transparencyActive);
|
||||
}
|
||||
|
||||
currentMaterial.color = alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (outlineActive) {
|
||||
setOutlineState (true, currentOutlineShader, currentOutlineWidht, currentOutlieColor, null);
|
||||
} else {
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
if (colorID == -1) {
|
||||
colorID = Shader.PropertyToID (transparencyColorName);
|
||||
}
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
if (transparencyActive) {
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
storeRenderElements ();
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
currentRenderer.materials [j].shader = originalShader [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
public bool isTransparencyActive ()
|
||||
{
|
||||
return transparencyActive;
|
||||
}
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
|
||||
currentMaterial.shader = shaderToApply;
|
||||
|
||||
if (currentMaterial.HasProperty (colorID)) {
|
||||
Color alpha = currentMaterial.GetColor (colorID);
|
||||
|
||||
if (useCustomTransparencyValues) {
|
||||
alpha.a = customAlphaTransparency;
|
||||
} else {
|
||||
alpha.a = alphaTransparency;
|
||||
}
|
||||
|
||||
currentMaterial.SetColor (colorID, alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (outlineActive) {
|
||||
setOutlineState (true, currentOutlineShader, currentOutlineWidht, currentOutlieColor, null);
|
||||
} else {
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
if (currentRenderer != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
currentRenderer.materials [j].shader = originalShader [i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool isTransparencyActive ()
|
||||
{
|
||||
return transparencyActive;
|
||||
}
|
||||
|
||||
void checkEventsOnOutlineStateChange (bool state)
|
||||
{
|
||||
if (useEventOnOutlineStateChange) {
|
||||
if (state) {
|
||||
eventOnEnableOutline.Invoke ();
|
||||
} else {
|
||||
eventOnDisableOutline.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Grab Objects/outlineObjectSystem.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/Grab Objects/putObjectSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user