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/Camera/Camera Effect/cameraEffect.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/Camera/Camera Effect/cameraEffectSystem.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/Camera/Camera Effect/customCameraEffect.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/Camera/Camera Effect/extraCameraEffectSystem.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/Camera/Camera Effect/photoModeSystem.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/Camera/Camera Effect/pixelCameraEffect.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/Camera/Camera Effect/solidCameraEffect.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/Camera/Captures/cameraCaptureSystem.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/Camera/Captures/cameraPerspectiveSystem.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/Camera/Captures/captureSlot.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/Camera/Captures/remoteEventOnCameraCaptureSystem.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/Camera/Cutscene/cameraWaypointSystem.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/Camera/Cutscene/pauseOrResumePlayerControllerAndCameraSystem.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/Camera/Cutscene/simpleShowHideMouseCursor.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/Camera/Others/dynamicSplitScreenSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -4,265 +4,275 @@ using UnityEngine;
|
||||
|
||||
public class playerCullingSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool cullingSystemEnabled = true;
|
||||
public bool cullingSystemEnabled = true;
|
||||
|
||||
public float minDistanceToApplyShader = 1;
|
||||
public float minCullingShaderValue = 0.2f;
|
||||
public float slerpCullingSpeed = 1;
|
||||
public float minDistanceToApplyShader = 1;
|
||||
public float minCullingShaderValue = 0.2f;
|
||||
public float slerpCullingSpeed = 1;
|
||||
|
||||
public float stippleSize;
|
||||
public float stippleSize;
|
||||
|
||||
public string transparentAmountName = "_TransparentAmount";
|
||||
public string transparentAmountName = "_TransparentAmount";
|
||||
|
||||
public bool setStippleSize;
|
||||
public string stippleSizeName = "_StippleSize";
|
||||
public bool setStippleSize;
|
||||
public string stippleSizeName = "_StippleSize";
|
||||
|
||||
[Space]
|
||||
[Header ("Player GameObject List")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Player GameObject List")]
|
||||
[Space]
|
||||
|
||||
public List<GameObject> playerGameObjectList = new List<GameObject> ();
|
||||
public List<GameObject> playerGameObjectWithChildList = new List<GameObject> ();
|
||||
public List<GameObject> playerGameObjectList = new List<GameObject> ();
|
||||
public List<GameObject> playerGameObjectWithChildList = new List<GameObject> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool pauseCullingState;
|
||||
public float cullingAmountToApply;
|
||||
public bool cullingActive;
|
||||
public float currentDistance;
|
||||
public float currentCullingValue;
|
||||
public bool materialsChangedChecked;
|
||||
public bool pauseCullingState;
|
||||
public float cullingAmountToApply;
|
||||
public bool cullingActive;
|
||||
public float currentDistance;
|
||||
public float currentCullingValue;
|
||||
public bool materialsChangedChecked;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public Shader cullingShader;
|
||||
public Transform playerTransform;
|
||||
public Transform cameraTransform;
|
||||
public playerCamera mainPlayerCamera;
|
||||
public Shader cullingShader;
|
||||
public Transform playerTransform;
|
||||
public Transform cameraTransform;
|
||||
public playerCamera mainPlayerCamera;
|
||||
|
||||
public List<Renderer> rendererParts = new List<Renderer> ();
|
||||
public List<Shader> originalShader = new List<Shader> ();
|
||||
public List<Material> materialList = new List<Material> ();
|
||||
public List<Renderer> rendererParts = new List<Renderer> ();
|
||||
public List<Shader> originalShader = new List<Shader> ();
|
||||
public List<Material> materialList = new List<Material> ();
|
||||
|
||||
float previousCullingValue;
|
||||
float previousCullingValue;
|
||||
|
||||
bool materialsStored;
|
||||
bool materialsStored;
|
||||
|
||||
int transparentAmountID;
|
||||
int transparentAmountID;
|
||||
|
||||
int stippleSizeID;
|
||||
int stippleSizeID;
|
||||
|
||||
float previousStippleSize = -1;
|
||||
float previousStippleSize = -1;
|
||||
|
||||
int materialsCount;
|
||||
int materialsCount;
|
||||
|
||||
Material temporalMaterial;
|
||||
Material temporalMaterial;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
if (rendererParts.Count == 0) {
|
||||
storePlayerRenderer ();
|
||||
}
|
||||
void Start ()
|
||||
{
|
||||
if (rendererParts.Count == 0) {
|
||||
storePlayerRenderer ();
|
||||
}
|
||||
|
||||
transparentAmountID = Shader.PropertyToID (transparentAmountName);
|
||||
transparentAmountID = Shader.PropertyToID (transparentAmountName);
|
||||
|
||||
stippleSizeID = Shader.PropertyToID (stippleSizeName);
|
||||
}
|
||||
stippleSizeID = Shader.PropertyToID (stippleSizeName);
|
||||
}
|
||||
|
||||
void FixedUpdate ()
|
||||
{
|
||||
if (!cullingSystemEnabled) {
|
||||
return;
|
||||
}
|
||||
void FixedUpdate ()
|
||||
{
|
||||
if (!cullingSystemEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentDistance = GKC_Utils.distance (playerTransform.position, cameraTransform.position);
|
||||
currentDistance = GKC_Utils.distance (playerTransform.position, cameraTransform.position);
|
||||
|
||||
if (!pauseCullingState && currentDistance < minDistanceToApplyShader) {
|
||||
cullingAmountToApply = currentDistance / minDistanceToApplyShader;
|
||||
if (!pauseCullingState && currentDistance < minDistanceToApplyShader) {
|
||||
cullingAmountToApply = currentDistance / minDistanceToApplyShader;
|
||||
|
||||
cullingActive = true;
|
||||
} else {
|
||||
cullingActive = false;
|
||||
cullingActive = true;
|
||||
} else {
|
||||
cullingActive = false;
|
||||
|
||||
cullingAmountToApply = 1;
|
||||
}
|
||||
cullingAmountToApply = 1;
|
||||
}
|
||||
|
||||
if (cullingActive) {
|
||||
if (mainPlayerCamera.isFirstPersonActive ()) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
if (mainPlayerCamera.isFullBodyAwarenessActive ()) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
bool isCameraTypeFree = mainPlayerCamera.isCameraTypeFree ();
|
||||
if (cullingActive) {
|
||||
if (mainPlayerCamera.isFirstPersonActive ()) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
if (mainPlayerCamera.isFullBodyAwarenessActive ()) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
bool isCameraTypeFree = mainPlayerCamera.isCameraTypeFree ();
|
||||
|
||||
if (!isCameraTypeFree) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
if (mainPlayerCamera.isPlayerAiming ()) {
|
||||
cullingAmountToApply = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (materialsChangedChecked != cullingActive) {
|
||||
materialsChangedChecked = cullingActive;
|
||||
if (!isCameraTypeFree) {
|
||||
cullingActive = false;
|
||||
} else {
|
||||
if (mainPlayerCamera.isPlayerAiming ()) {
|
||||
cullingAmountToApply = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!materialsStored) {
|
||||
getMaterialList ();
|
||||
if (materialsChangedChecked != cullingActive) {
|
||||
materialsChangedChecked = cullingActive;
|
||||
|
||||
materialsStored = true;
|
||||
}
|
||||
if (!materialsStored) {
|
||||
getMaterialList ();
|
||||
|
||||
materialsCount = materialList.Count;
|
||||
materialsStored = true;
|
||||
}
|
||||
|
||||
for (int j = 0; j < materialsCount; j++) {
|
||||
temporalMaterial = materialList [j];
|
||||
|
||||
if (cullingActive) {
|
||||
temporalMaterial.shader = cullingShader;
|
||||
materialsCount = materialList.Count;
|
||||
|
||||
if (setStippleSize) {
|
||||
if (stippleSize != previousStippleSize) {
|
||||
previousStippleSize = stippleSize;
|
||||
for (int j = 0; j < materialsCount; j++) {
|
||||
temporalMaterial = materialList [j];
|
||||
|
||||
temporalMaterial.SetFloat (stippleSizeID, stippleSize);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
temporalMaterial.shader = originalShader [j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentCullingValue = Mathf.Lerp (currentCullingValue, cullingAmountToApply, Time.deltaTime * slerpCullingSpeed);
|
||||
if (cullingActive) {
|
||||
temporalMaterial.shader = cullingShader;
|
||||
|
||||
if (currentCullingValue <= 1) {
|
||||
if (Mathf.Abs (currentCullingValue - previousCullingValue) > 0.01f) {
|
||||
if (setStippleSize) {
|
||||
if (stippleSize != previousStippleSize) {
|
||||
previousStippleSize = stippleSize;
|
||||
|
||||
materialsCount = materialList.Count;
|
||||
temporalMaterial.SetFloat (stippleSizeID, stippleSize);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
temporalMaterial.shader = originalShader [j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < materialsCount; j++) {
|
||||
materialList [j].SetFloat (transparentAmountID, currentCullingValue);
|
||||
}
|
||||
currentCullingValue = Mathf.Lerp (currentCullingValue, cullingAmountToApply, Time.deltaTime * slerpCullingSpeed);
|
||||
|
||||
previousCullingValue = currentCullingValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setPauseCullingState (bool state)
|
||||
{
|
||||
pauseCullingState = state;
|
||||
}
|
||||
|
||||
public void getMaterialList ()
|
||||
{
|
||||
if (materialList.Count == 0) {
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
if (currentRenderer != null) {
|
||||
|
||||
if (currentRenderer.material.shader != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
|
||||
if (currentMaterial != null) {
|
||||
|
||||
materialList.Add (currentMaterial);
|
||||
|
||||
originalShader.Add (currentMaterial.shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clearRendererList ()
|
||||
{
|
||||
rendererParts.Clear ();
|
||||
|
||||
originalShader.Clear ();
|
||||
}
|
||||
|
||||
public void storePlayerRenderer ()
|
||||
{
|
||||
clearRendererList ();
|
||||
|
||||
for (int i = 0; i < playerGameObjectList.Count; i++) {
|
||||
GameObject currentObject = playerGameObjectList [i];
|
||||
|
||||
if (currentObject != null) {
|
||||
Renderer currentRenderer = currentObject.GetComponent<Renderer> ();
|
||||
if (currentCullingValue <= 1) {
|
||||
if (Mathf.Abs (currentCullingValue - previousCullingValue) > 0.01f) {
|
||||
|
||||
rendererParts.Add (currentRenderer);
|
||||
}
|
||||
}
|
||||
materialsCount = materialList.Count;
|
||||
|
||||
for (int i = 0; i < playerGameObjectWithChildList.Count; i++) {
|
||||
GameObject currentObject = playerGameObjectWithChildList [i];
|
||||
for (int j = 0; j < materialsCount; j++) {
|
||||
materialList [j].SetFloat (transparentAmountID, currentCullingValue);
|
||||
}
|
||||
|
||||
if (currentObject != null) {
|
||||
Component[] components = currentObject.GetComponentsInChildren (typeof(Renderer));
|
||||
previousCullingValue = currentCullingValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int componentsLength = components.Length;
|
||||
public void setPauseCullingState (bool state)
|
||||
{
|
||||
pauseCullingState = state;
|
||||
}
|
||||
|
||||
for (int j = 0; j < componentsLength; j++) {
|
||||
rendererParts.Add (components [j] as Renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print ("Total amount of " + rendererParts.Count + " render found");
|
||||
}
|
||||
|
||||
public void storePlayerRendererFromEditor ()
|
||||
{
|
||||
storePlayerRenderer ();
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
public void getMaterialList ()
|
||||
{
|
||||
if (materialList.Count == 0) {
|
||||
int rendererPartsCount = rendererParts.Count;
|
||||
|
||||
public void clearRendererListFromEditor ()
|
||||
{
|
||||
clearRendererList ();
|
||||
for (int i = 0; i < rendererPartsCount; i++) {
|
||||
Renderer currentRenderer = rendererParts [i];
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
if (currentRenderer != null) {
|
||||
|
||||
public void setCullingSystemEnabledState (bool state)
|
||||
{
|
||||
cullingSystemEnabled = state;
|
||||
}
|
||||
if (currentRenderer.material.shader != null) {
|
||||
int materialsLength = currentRenderer.materials.Length;
|
||||
|
||||
public void setCullingSystemEnabledStateFromEditor (bool state)
|
||||
{
|
||||
setCullingSystemEnabledState (state);
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
Material currentMaterial = currentRenderer.materials [j];
|
||||
|
||||
public void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
if (currentMaterial != null) {
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Player Culling System", gameObject);
|
||||
}
|
||||
materialList.Add (currentMaterial);
|
||||
|
||||
originalShader.Add (currentMaterial.shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clearRendererList ()
|
||||
{
|
||||
rendererParts.Clear ();
|
||||
|
||||
originalShader.Clear ();
|
||||
}
|
||||
|
||||
public void setNewPlayerGameObject (GameObject newObject)
|
||||
{
|
||||
playerGameObjectList.Clear ();
|
||||
|
||||
playerGameObjectList.Add (newObject);
|
||||
}
|
||||
|
||||
|
||||
public void storePlayerRenderer ()
|
||||
{
|
||||
clearRendererList ();
|
||||
|
||||
for (int i = 0; i < playerGameObjectList.Count; i++) {
|
||||
GameObject currentObject = playerGameObjectList [i];
|
||||
|
||||
if (currentObject != null) {
|
||||
Renderer currentRenderer = currentObject.GetComponent<Renderer> ();
|
||||
|
||||
rendererParts.Add (currentRenderer);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < playerGameObjectWithChildList.Count; i++) {
|
||||
GameObject currentObject = playerGameObjectWithChildList [i];
|
||||
|
||||
if (currentObject != null) {
|
||||
Component [] components = currentObject.GetComponentsInChildren (typeof (Renderer));
|
||||
|
||||
int componentsLength = components.Length;
|
||||
|
||||
for (int j = 0; j < componentsLength; j++) {
|
||||
rendererParts.Add (components [j] as Renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Application.isPlaying) {
|
||||
print ("Total amount of " + rendererParts.Count + " render found");
|
||||
}
|
||||
}
|
||||
|
||||
public void storePlayerRendererFromEditor ()
|
||||
{
|
||||
storePlayerRenderer ();
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void clearRendererListFromEditor ()
|
||||
{
|
||||
clearRendererList ();
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void setCullingSystemEnabledState (bool state)
|
||||
{
|
||||
cullingSystemEnabled = state;
|
||||
}
|
||||
|
||||
public void setCullingSystemEnabledStateFromEditor (bool state)
|
||||
{
|
||||
setCullingSystemEnabledState (state);
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
public void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Player Culling System", gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Camera/Others/playerCullingSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -5,328 +5,350 @@ using UnityEngine.Events;
|
||||
|
||||
public class setTransparentSurfaces : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool checkSurfaceEnabled = true;
|
||||
public bool checkSurfaceEnabled = true;
|
||||
|
||||
public bool checkSurfaceActiveAtStart;
|
||||
public bool checkSurfaceActiveAtStart;
|
||||
|
||||
public bool checkSurfaceActive;
|
||||
public bool checkSurfaceActive;
|
||||
|
||||
public bool lockedCameraActive;
|
||||
public bool lockedCameraActive;
|
||||
|
||||
public LayerMask layer;
|
||||
public LayerMask layer;
|
||||
|
||||
public float capsuleCastRadius = 0.3f;
|
||||
public float capsuleCastRadius = 0.3f;
|
||||
|
||||
public bool useCustomShader;
|
||||
public Shader customShader;
|
||||
public bool useCustomShader;
|
||||
public Shader customShader;
|
||||
|
||||
public string mainManagerName = "Set Transparent Surfaces Manager";
|
||||
public string mainManagerName = "Set Transparent Surfaces Manager";
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool surfaceFound;
|
||||
public bool surfaceFoundPreviously;
|
||||
public bool playerIsUsingDevices;
|
||||
public bool playerIsUsingDevicesPreviously;
|
||||
public bool surfaceFound;
|
||||
public bool surfaceFoundPreviously;
|
||||
public bool playerIsUsingDevices;
|
||||
public bool playerIsUsingDevicesPreviously;
|
||||
|
||||
public List<GameObject> currentSurfaceGameObjectFoundList = new List<GameObject> ();
|
||||
public List<GameObject> currentSurfaceGameObjectFoundList = new List<GameObject> ();
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
|
||||
public bool useEventsOnStartCheckSurface;
|
||||
public UnityEvent eventOnStartCheckSurface;
|
||||
public bool useEventsOnStopCheckSurface;
|
||||
public UnityEvent eventOnStopCheckSurface;
|
||||
public bool useEventsOnStartCheckSurface;
|
||||
public UnityEvent eventOnStartCheckSurface;
|
||||
public bool useEventsOnStopCheckSurface;
|
||||
public UnityEvent eventOnStopCheckSurface;
|
||||
|
||||
public bool useEventOnSurfaceFound;
|
||||
public UnityEvent eventOnSurfaceFound;
|
||||
public bool useEventOnNoSurfaceFound;
|
||||
public UnityEvent eventOnNoSurfaceFound;
|
||||
public bool useEventOnSurfaceFound;
|
||||
public UnityEvent eventOnSurfaceFound;
|
||||
public bool useEventOnNoSurfaceFound;
|
||||
public UnityEvent eventOnNoSurfaceFound;
|
||||
|
||||
[Space]
|
||||
[Header ("Gizmo Settings")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Gizmo Settings")]
|
||||
[Space]
|
||||
|
||||
public bool showGizmo;
|
||||
public Color sphereColor = Color.green;
|
||||
public Color cubeColor = Color.blue;
|
||||
public bool showGizmo;
|
||||
public Color sphereColor = Color.green;
|
||||
public Color cubeColor = Color.blue;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public playerController playerControllerManager;
|
||||
public int playerID;
|
||||
public Transform rayOriginPositionFreeCamera;
|
||||
public Transform rayTargetPositionFreeCamera;
|
||||
public Transform rayOriginPositionLockedCamera;
|
||||
public Transform rayTargetPositionLockedCamera;
|
||||
public playerController playerControllerManager;
|
||||
public int playerID;
|
||||
public Transform rayOriginPositionFreeCamera;
|
||||
public Transform rayTargetPositionFreeCamera;
|
||||
public Transform rayOriginPositionLockedCamera;
|
||||
public Transform rayTargetPositionLockedCamera;
|
||||
|
||||
public setTransparentSurfacesSystem setTransparentSurfacesManager;
|
||||
public setTransparentSurfacesSystem setTransparentSurfacesManager;
|
||||
|
||||
RaycastHit[] hits;
|
||||
float distanceToTarget;
|
||||
RaycastHit [] hits;
|
||||
float distanceToTarget;
|
||||
|
||||
Vector3 rayDirection;
|
||||
List<GameObject> surfaceGameObjectList = new List<GameObject> ();
|
||||
Vector3 point1;
|
||||
Vector3 point2;
|
||||
Vector3 rayDirection;
|
||||
List<GameObject> surfaceGameObjectList = new List<GameObject> ();
|
||||
Vector3 point1;
|
||||
Vector3 point2;
|
||||
|
||||
GameObject currentSurfaceGameObjectFound;
|
||||
GameObject currentSurfaceGameObjectFound;
|
||||
|
||||
setTransparentSurfacesSystem.surfaceInfo currentSurfaceInfo;
|
||||
setTransparentSurfacesSystem.surfaceInfo currentSurfaceInfo;
|
||||
|
||||
Transform currentRayOriginPosition;
|
||||
Transform currentRayTargetPosition;
|
||||
Transform currentRayOriginPosition;
|
||||
Transform currentRayTargetPosition;
|
||||
|
||||
bool playerLocated;
|
||||
bool playerLocated;
|
||||
|
||||
bool setTransparentSurfacesManagerLocated;
|
||||
bool setTransparentSurfacesManagerLocated;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
void Start ()
|
||||
{
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
setTransparentSurfacesManager = setTransparentSurfacesSystem.Instance;
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
setTransparentSurfacesManager = setTransparentSurfacesSystem.Instance;
|
||||
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
GKC_Utils.instantiateMainManagerOnSceneWithTypeOnApplicationPlaying (setTransparentSurfacesSystem.getMainManagerName (), typeof(setTransparentSurfacesSystem), true);
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
GKC_Utils.instantiateMainManagerOnSceneWithTypeOnApplicationPlaying (setTransparentSurfacesSystem.getMainManagerName (), typeof (setTransparentSurfacesSystem), true);
|
||||
|
||||
setTransparentSurfacesManager = setTransparentSurfacesSystem.Instance;
|
||||
setTransparentSurfacesManager = setTransparentSurfacesSystem.Instance;
|
||||
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
setTransparentSurfacesManager = FindObjectOfType<setTransparentSurfacesSystem> ();
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
setTransparentSurfacesManager = FindObjectOfType<setTransparentSurfacesSystem> ();
|
||||
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
setTransparentSurfacesManagerLocated = setTransparentSurfacesManager != null;
|
||||
}
|
||||
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
checkSurfaceEnabled = false;
|
||||
if (!setTransparentSurfacesManagerLocated) {
|
||||
checkSurfaceEnabled = false;
|
||||
|
||||
checkSurfaceActive = false;
|
||||
}
|
||||
checkSurfaceActive = false;
|
||||
}
|
||||
|
||||
if (playerControllerManager != null) {
|
||||
playerID = playerControllerManager.getPlayerID ();
|
||||
if (playerControllerManager != null) {
|
||||
playerID = playerControllerManager.getPlayerID ();
|
||||
|
||||
playerLocated = true;
|
||||
}
|
||||
playerLocated = true;
|
||||
}
|
||||
|
||||
if (checkSurfaceActiveAtStart) {
|
||||
setCheckSurfaceActiveState (true);
|
||||
}
|
||||
}
|
||||
if (checkSurfaceActiveAtStart) {
|
||||
setCheckSurfaceActiveState (true);
|
||||
}
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (checkSurfaceActive) {
|
||||
if (lockedCameraActive) {
|
||||
currentRayOriginPosition = rayOriginPositionLockedCamera;
|
||||
currentRayTargetPosition = rayTargetPositionLockedCamera;
|
||||
} else {
|
||||
currentRayOriginPosition = rayOriginPositionFreeCamera;
|
||||
currentRayTargetPosition = rayTargetPositionFreeCamera;
|
||||
}
|
||||
void Update ()
|
||||
{
|
||||
if (checkSurfaceActive) {
|
||||
if (lockedCameraActive) {
|
||||
currentRayOriginPosition = rayOriginPositionLockedCamera;
|
||||
currentRayTargetPosition = rayTargetPositionLockedCamera;
|
||||
} else {
|
||||
currentRayOriginPosition = rayOriginPositionFreeCamera;
|
||||
currentRayTargetPosition = rayTargetPositionFreeCamera;
|
||||
}
|
||||
|
||||
distanceToTarget = GKC_Utils.distance (currentRayOriginPosition.position, currentRayTargetPosition.position);
|
||||
rayDirection = currentRayOriginPosition.position - currentRayTargetPosition.position;
|
||||
rayDirection = rayDirection / rayDirection.magnitude;
|
||||
distanceToTarget = GKC_Utils.distance (currentRayOriginPosition.position, currentRayTargetPosition.position);
|
||||
rayDirection = currentRayOriginPosition.position - currentRayTargetPosition.position;
|
||||
rayDirection = rayDirection / rayDirection.magnitude;
|
||||
|
||||
if (showGizmo) {
|
||||
Debug.DrawLine (currentRayTargetPosition.position, (distanceToTarget * rayDirection) + currentRayTargetPosition.position, Color.red, 2);
|
||||
}
|
||||
if (showGizmo) {
|
||||
Debug.DrawLine (currentRayTargetPosition.position, (distanceToTarget * rayDirection) + currentRayTargetPosition.position, Color.red, 2);
|
||||
}
|
||||
|
||||
point1 = currentRayOriginPosition.position - capsuleCastRadius * rayDirection;
|
||||
point2 = currentRayTargetPosition.position + capsuleCastRadius * rayDirection;
|
||||
point1 = currentRayOriginPosition.position - capsuleCastRadius * rayDirection;
|
||||
point2 = currentRayTargetPosition.position + capsuleCastRadius * rayDirection;
|
||||
|
||||
hits = Physics.CapsuleCastAll (point1, point2, capsuleCastRadius, rayDirection, 0, layer);
|
||||
hits = Physics.CapsuleCastAll (point1, point2, capsuleCastRadius, rayDirection, 0, layer);
|
||||
|
||||
surfaceFound = hits.Length > 0;
|
||||
surfaceFound = hits.Length > 0;
|
||||
|
||||
if (surfaceFound != surfaceFoundPreviously) {
|
||||
surfaceFoundPreviously = surfaceFound;
|
||||
if (surfaceFound != surfaceFoundPreviously) {
|
||||
surfaceFoundPreviously = surfaceFound;
|
||||
|
||||
if (surfaceFoundPreviously) {
|
||||
if (useEventOnSurfaceFound) {
|
||||
eventOnSurfaceFound.Invoke ();
|
||||
}
|
||||
} else {
|
||||
if (useEventOnNoSurfaceFound) {
|
||||
eventOnNoSurfaceFound.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (surfaceFoundPreviously) {
|
||||
if (useEventOnSurfaceFound) {
|
||||
eventOnSurfaceFound.Invoke ();
|
||||
}
|
||||
} else {
|
||||
if (useEventOnNoSurfaceFound) {
|
||||
eventOnNoSurfaceFound.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (playerLocated) {
|
||||
playerIsUsingDevices = playerControllerManager.isUsingDevice ();
|
||||
}
|
||||
if (playerLocated) {
|
||||
playerIsUsingDevices = playerControllerManager.isUsingDevice ();
|
||||
}
|
||||
|
||||
if (playerIsUsingDevices != playerIsUsingDevicesPreviously) {
|
||||
playerIsUsingDevicesPreviously = playerIsUsingDevices;
|
||||
if (playerIsUsingDevices != playerIsUsingDevicesPreviously) {
|
||||
playerIsUsingDevicesPreviously = playerIsUsingDevices;
|
||||
|
||||
changeSurfacesToTransparentOrRegularTemporaly (!playerIsUsingDevices);
|
||||
}
|
||||
changeSurfacesToTransparentOrRegularTemporaly (!playerIsUsingDevices);
|
||||
}
|
||||
|
||||
surfaceGameObjectList.Clear ();
|
||||
surfaceGameObjectList.Clear ();
|
||||
|
||||
for (int i = 0; i < hits.Length; i++) {
|
||||
currentSurfaceGameObjectFound = hits [i].collider.gameObject;
|
||||
|
||||
if (!setTransparentSurfacesManager.listContainsSurface (currentSurfaceGameObjectFound)) {
|
||||
if (useCustomShader) {
|
||||
setTransparentSurfacesManager.addNewSurface (currentSurfaceGameObjectFound, customShader);
|
||||
} else {
|
||||
setTransparentSurfacesManager.addNewSurface (currentSurfaceGameObjectFound, null);
|
||||
}
|
||||
} else {
|
||||
setTransparentSurfacesManager.checkSurfaceToSetTransparentAgain (currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
if (!currentSurfaceGameObjectFoundList.Contains (currentSurfaceGameObjectFound)) {
|
||||
currentSurfaceGameObjectFoundList.Add (currentSurfaceGameObjectFound);
|
||||
setTransparentSurfacesManager.addPlayerIDToSurface (playerID, currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
surfaceGameObjectList.Add (currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (!surfaceGameObjectList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.removePlayerIDToSurface (playerID, i);
|
||||
}
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
currentSurfaceGameObjectFoundList.Remove (currentSurfaceInfo.surfaceGameObject);
|
||||
}
|
||||
|
||||
if (currentSurfaceInfo.numberOfPlayersFound < 1 && !currentSurfaceInfo.changingToOriginalActive) {
|
||||
setTransparentSurfacesManager.setSurfaceToRegular (i, true);
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkSurfacesToRemove ()
|
||||
{
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.removePlayerIDToSurface (playerID, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void changeSurfacesToTransparentOrRegularTemporaly (bool state)
|
||||
{
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.changeSurfacesToTransparentOrRegularTemporaly (playerID, i, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCheckSurfaceActiveState (bool state)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
checkSurfaceActive = state;
|
||||
|
||||
if (!checkSurfaceActive) {
|
||||
|
||||
checkSurfacesToRemove ();
|
||||
|
||||
setTransparentSurfacesManager.checkSurfacesToRemove ();
|
||||
}
|
||||
|
||||
if (checkSurfaceActive) {
|
||||
if (useEventsOnStartCheckSurface) {
|
||||
eventOnStartCheckSurface.Invoke ();
|
||||
}
|
||||
} else {
|
||||
if (useEventsOnStopCheckSurface) {
|
||||
eventOnStopCheckSurface.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setLockedCameraActiveState (bool state)
|
||||
{
|
||||
lockedCameraActive = state;
|
||||
}
|
||||
|
||||
void OnDrawGizmos ()
|
||||
{
|
||||
if (!showGizmo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GKC_Utils.isCurrentSelectionActiveGameObject (gameObject)) {
|
||||
DrawGizmos ();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected ()
|
||||
{
|
||||
DrawGizmos ();
|
||||
}
|
||||
|
||||
void DrawGizmos ()
|
||||
{
|
||||
if (showGizmo && Application.isPlaying && checkSurfaceActive) {
|
||||
|
||||
Gizmos.color = sphereColor;
|
||||
|
||||
Gizmos.DrawSphere (point1, capsuleCastRadius);
|
||||
Gizmos.DrawSphere (point2, capsuleCastRadius);
|
||||
|
||||
Gizmos.color = cubeColor;
|
||||
|
||||
Vector3 scale = new Vector3 (capsuleCastRadius * 2, capsuleCastRadius * 2, distanceToTarget - capsuleCastRadius * 2);
|
||||
|
||||
Matrix4x4 cubeTransform = Matrix4x4.TRS (((distanceToTarget / 2) * rayDirection) +
|
||||
currentRayTargetPosition.position,
|
||||
Quaternion.LookRotation (rayDirection, point1 - point2), scale);
|
||||
|
||||
Matrix4x4 oldGizmosMatrix = Gizmos.matrix;
|
||||
|
||||
Gizmos.matrix *= cubeTransform;
|
||||
|
||||
Gizmos.DrawCube (Vector3.zero, Vector3.one);
|
||||
|
||||
Gizmos.matrix = oldGizmosMatrix;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < hits.Length; i++) {
|
||||
currentSurfaceGameObjectFound = hits [i].collider.gameObject;
|
||||
|
||||
if (!setTransparentSurfacesManager.listContainsSurface (currentSurfaceGameObjectFound)) {
|
||||
if (useCustomShader) {
|
||||
setTransparentSurfacesManager.addNewSurface (currentSurfaceGameObjectFound, customShader);
|
||||
} else {
|
||||
setTransparentSurfacesManager.addNewSurface (currentSurfaceGameObjectFound, null);
|
||||
}
|
||||
} else {
|
||||
setTransparentSurfacesManager.checkSurfaceToSetTransparentAgain (currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
if (!currentSurfaceGameObjectFoundList.Contains (currentSurfaceGameObjectFound)) {
|
||||
currentSurfaceGameObjectFoundList.Add (currentSurfaceGameObjectFound);
|
||||
setTransparentSurfacesManager.addPlayerIDToSurface (playerID, currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
surfaceGameObjectList.Add (currentSurfaceGameObjectFound);
|
||||
}
|
||||
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (!surfaceGameObjectList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.removePlayerIDToSurface (playerID, i);
|
||||
}
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
currentSurfaceGameObjectFoundList.Remove (currentSurfaceInfo.surfaceGameObject);
|
||||
}
|
||||
|
||||
if (currentSurfaceInfo.numberOfPlayersFound < 1 && !currentSurfaceInfo.changingToOriginalActive) {
|
||||
setTransparentSurfacesManager.setSurfaceToRegular (i, true);
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkSurfacesToRemove ()
|
||||
{
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.removePlayerIDToSurface (playerID, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void changeSurfacesToTransparentOrRegularTemporaly (bool state)
|
||||
{
|
||||
for (int i = 0; i < setTransparentSurfacesManager.surfaceInfoList.Count; i++) {
|
||||
currentSurfaceInfo = setTransparentSurfacesManager.surfaceInfoList [i];
|
||||
|
||||
if (currentSurfaceGameObjectFoundList.Contains (currentSurfaceInfo.surfaceGameObject)) {
|
||||
|
||||
if (currentSurfaceInfo.playerIDs.Contains (playerID)) {
|
||||
|
||||
setTransparentSurfacesManager.changeSurfacesToTransparentOrRegularTemporaly (playerID, i, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCheckSurfaceActiveState (bool state)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
checkSurfaceActive = state;
|
||||
|
||||
if (!checkSurfaceActive) {
|
||||
|
||||
checkSurfacesToRemove ();
|
||||
|
||||
setTransparentSurfacesManager.checkSurfacesToRemove ();
|
||||
}
|
||||
|
||||
if (checkSurfaceActive) {
|
||||
if (useEventsOnStartCheckSurface) {
|
||||
eventOnStartCheckSurface.Invoke ();
|
||||
}
|
||||
} else {
|
||||
if (useEventsOnStopCheckSurface) {
|
||||
eventOnStopCheckSurface.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setLockedCameraActiveState (bool state)
|
||||
{
|
||||
lockedCameraActive = state;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnDrawGizmos ()
|
||||
{
|
||||
if (!showGizmo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GKC_Utils.isCurrentSelectionActiveGameObject (gameObject)) {
|
||||
DrawGizmos ();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmosSelected ()
|
||||
{
|
||||
DrawGizmos ();
|
||||
}
|
||||
|
||||
void DrawGizmos ()
|
||||
{
|
||||
if (showGizmo && Application.isPlaying && checkSurfaceActive) {
|
||||
|
||||
Gizmos.color = sphereColor;
|
||||
|
||||
Gizmos.DrawSphere (point1, capsuleCastRadius);
|
||||
Gizmos.DrawSphere (point2, capsuleCastRadius);
|
||||
|
||||
Gizmos.color = cubeColor;
|
||||
|
||||
Vector3 scale = new Vector3 (capsuleCastRadius * 2, capsuleCastRadius * 2, distanceToTarget - capsuleCastRadius * 2);
|
||||
|
||||
Matrix4x4 cubeTransform = Matrix4x4.TRS (((distanceToTarget / 2) * rayDirection) +
|
||||
currentRayTargetPosition.position,
|
||||
Quaternion.LookRotation (rayDirection, point1 - point2), scale);
|
||||
|
||||
Matrix4x4 oldGizmosMatrix = Gizmos.matrix;
|
||||
|
||||
Gizmos.matrix *= cubeTransform;
|
||||
|
||||
Gizmos.DrawCube (Vector3.zero, Vector3.one);
|
||||
|
||||
Gizmos.matrix = oldGizmosMatrix;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public void setCheckSurfaceEnabledState (bool state)
|
||||
{
|
||||
checkSurfaceEnabled = state;
|
||||
|
||||
}
|
||||
|
||||
public void setCheckSurfaceEnabledStateFromEditor (bool state)
|
||||
{
|
||||
setCheckSurfaceEnabledState (state);
|
||||
|
||||
updateComponent ();
|
||||
}
|
||||
|
||||
void updateComponent ()
|
||||
{
|
||||
GKC_Utils.updateComponent (this);
|
||||
|
||||
GKC_Utils.updateDirtyScene ("Update Transparent Surface", gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Camera/Others/setTransparentSurfaces.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -4,360 +4,379 @@ using UnityEngine;
|
||||
|
||||
public class setTransparentSurfacesSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool checkSurfaceEnabled = true;
|
||||
public bool checkSurfaceEnabled = true;
|
||||
|
||||
public Shader transparentShader;
|
||||
public float alphaBlendSpeed = 5;
|
||||
public float alphaTransparency = 0.2f;
|
||||
public Shader transparentShader;
|
||||
public float alphaBlendSpeed = 5;
|
||||
public float alphaTransparency = 0.2f;
|
||||
|
||||
public bool useAlphaColor = true;
|
||||
public string transparentAmountName = "_TransparentAmount";
|
||||
public bool useAlphaColor = true;
|
||||
public string transparentAmountName = "_TransparentAmount";
|
||||
|
||||
public string colorPropertyName = "_Color";
|
||||
public string colorPropertyName = "_Color";
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public List<surfaceInfo> surfaceInfoList = new List<surfaceInfo> ();
|
||||
public List<GameObject> surfaceGameObjectList = new List<GameObject> ();
|
||||
public List<surfaceInfo> surfaceInfoList = new List<surfaceInfo> ();
|
||||
public List<GameObject> surfaceGameObjectList = new List<GameObject> ();
|
||||
|
||||
surfaceInfo newSurfaceInfo;
|
||||
materialInfo newMaterialInfo;
|
||||
surfaceInfo newSurfaceInfo;
|
||||
materialInfo newMaterialInfo;
|
||||
|
||||
int transparentAmountID = -1;
|
||||
int transparentAmountID = -1;
|
||||
|
||||
int colorID = -1;
|
||||
|
||||
|
||||
public const string mainManagerName = "Set Transparent Surfaces Manager";
|
||||
public const string mainManagerName = "Set Transparent Surfaces Manager";
|
||||
|
||||
public static string getMainManagerName ()
|
||||
{
|
||||
return mainManagerName;
|
||||
}
|
||||
public static string getMainManagerName ()
|
||||
{
|
||||
return mainManagerName;
|
||||
}
|
||||
|
||||
private static setTransparentSurfacesSystem _setTransparentSurfacesSystemInstance;
|
||||
private static setTransparentSurfacesSystem _setTransparentSurfacesSystemInstance;
|
||||
|
||||
public static setTransparentSurfacesSystem Instance { get { return _setTransparentSurfacesSystemInstance; } }
|
||||
public static setTransparentSurfacesSystem Instance { get { return _setTransparentSurfacesSystemInstance; } }
|
||||
|
||||
bool instanceInitialized;
|
||||
bool instanceInitialized;
|
||||
|
||||
|
||||
public void getComponentInstance ()
|
||||
{
|
||||
if (instanceInitialized) {
|
||||
return;
|
||||
}
|
||||
public void getComponentInstance ()
|
||||
{
|
||||
if (instanceInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_setTransparentSurfacesSystemInstance != null && _setTransparentSurfacesSystemInstance != this) {
|
||||
Destroy (this.gameObject);
|
||||
if (_setTransparentSurfacesSystemInstance != null && _setTransparentSurfacesSystemInstance != this) {
|
||||
Destroy (this.gameObject);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_setTransparentSurfacesSystemInstance = this;
|
||||
_setTransparentSurfacesSystemInstance = this;
|
||||
|
||||
instanceInitialized = true;
|
||||
}
|
||||
instanceInitialized = true;
|
||||
}
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
getComponentInstance ();
|
||||
}
|
||||
void Awake ()
|
||||
{
|
||||
getComponentInstance ();
|
||||
}
|
||||
|
||||
public void addNewSurface (GameObject newSurface, Shader customShader)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
public void addNewSurface (GameObject newSurface, Shader customShader)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
newSurfaceInfo = new surfaceInfo ();
|
||||
newSurfaceInfo.surfaceGameObject = newSurface;
|
||||
newSurfaceInfo = new surfaceInfo ();
|
||||
newSurfaceInfo.surfaceGameObject = newSurface;
|
||||
|
||||
Component[] components = newSurfaceInfo.surfaceGameObject.GetComponentsInChildren (typeof(Renderer));
|
||||
Component [] components = newSurfaceInfo.surfaceGameObject.GetComponentsInChildren (typeof (Renderer));
|
||||
|
||||
int componentsLength = components.Length;
|
||||
int componentsLength = components.Length;
|
||||
|
||||
int colorID = Shader.PropertyToID (colorPropertyName);
|
||||
if (colorID == -1) {
|
||||
colorID = Shader.PropertyToID (colorPropertyName);
|
||||
}
|
||||
|
||||
for (int i = 0; i < componentsLength; i++) {
|
||||
Renderer child = components [i] as Renderer;
|
||||
Renderer child = components [i] as Renderer;
|
||||
|
||||
if (child.material.shader != null) {
|
||||
int materialsLength = child.materials.Length;
|
||||
if (child.material.shader != null) {
|
||||
int materialsLength = child.materials.Length;
|
||||
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = child.materials [j];
|
||||
for (int j = 0; j < materialsLength; j++) {
|
||||
Material currentMaterial = child.materials [j];
|
||||
|
||||
newMaterialInfo = new materialInfo ();
|
||||
newMaterialInfo.surfaceMaterial = currentMaterial;
|
||||
newMaterialInfo = new materialInfo ();
|
||||
newMaterialInfo.surfaceMaterial = currentMaterial;
|
||||
|
||||
float colorValue = 1;
|
||||
float colorValue = 1;
|
||||
|
||||
if (colorID != -1) {
|
||||
if (currentMaterial.HasProperty (colorID)) {
|
||||
Color alpha = currentMaterial.color;
|
||||
if (currentMaterial.HasProperty (colorID)) {
|
||||
Color alpha = currentMaterial.color;
|
||||
|
||||
colorValue = alpha.a;
|
||||
}
|
||||
colorValue = alpha.a;
|
||||
}
|
||||
}
|
||||
|
||||
newMaterialInfo.originalAlphaColor = colorValue;
|
||||
newMaterialInfo.originalAlphaColor = colorValue;
|
||||
|
||||
newSurfaceInfo.materialInfoList.Add (newMaterialInfo);
|
||||
newSurfaceInfo.originalShader.Add (currentMaterial.shader);
|
||||
newSurfaceInfo.materialInfoList.Add (newMaterialInfo);
|
||||
newSurfaceInfo.originalShader.Add (currentMaterial.shader);
|
||||
|
||||
if (customShader != null) {
|
||||
currentMaterial.shader = customShader;
|
||||
if (customShader != null) {
|
||||
currentMaterial.shader = customShader;
|
||||
|
||||
newSurfaceInfo.customShader = customShader;
|
||||
} else {
|
||||
currentMaterial.shader = transparentShader;
|
||||
newSurfaceInfo.customShader = customShader;
|
||||
} else {
|
||||
currentMaterial.shader = transparentShader;
|
||||
|
||||
newSurfaceInfo.customShader = transparentShader;
|
||||
}
|
||||
newSurfaceInfo.customShader = transparentShader;
|
||||
}
|
||||
|
||||
newSurfaceInfo.materialsAmount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
newSurfaceInfo.materialsAmount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setSurfaceTransparent (newSurfaceInfo);
|
||||
|
||||
surfaceInfoList.Add (newSurfaceInfo);
|
||||
setSurfaceTransparent (newSurfaceInfo);
|
||||
|
||||
surfaceGameObjectList.Add (newSurfaceInfo.surfaceGameObject);
|
||||
}
|
||||
surfaceInfoList.Add (newSurfaceInfo);
|
||||
|
||||
public bool listContainsSurface (GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return false;
|
||||
}
|
||||
surfaceGameObjectList.Add (newSurfaceInfo.surfaceGameObject);
|
||||
}
|
||||
|
||||
if (surfaceGameObjectList.Contains (surfaceToCheck)) {
|
||||
return true;
|
||||
}
|
||||
public bool listContainsSurface (GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
if (surfaceGameObjectList.Contains (surfaceToCheck)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setSurfaceToRegular (int surfaceIndex, bool removeSurfaceAtEnd)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [surfaceIndex];
|
||||
public void setSurfaceToRegular (int surfaceIndex, bool removeSurfaceAtEnd)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentSurfaceToCheck.changingToOriginalActive = true;
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount = 0;
|
||||
currentSurfaceToCheck.changingToTransparentActive = false;
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [surfaceIndex];
|
||||
|
||||
currentSurfaceToCheck.changingToOriginalTemporaly = !removeSurfaceAtEnd;
|
||||
currentSurfaceToCheck.changingToOriginalActive = true;
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount = 0;
|
||||
currentSurfaceToCheck.changingToTransparentActive = false;
|
||||
|
||||
for (int j = 0; j < currentSurfaceToCheck.materialInfoList.Count; j++) {
|
||||
setAlphaValue (currentSurfaceToCheck, j, currentSurfaceToCheck.materialInfoList [j].surfaceMaterial,
|
||||
false, currentSurfaceToCheck.originalShader [j], currentSurfaceToCheck.materialInfoList [j].originalAlphaColor, removeSurfaceAtEnd);
|
||||
}
|
||||
}
|
||||
currentSurfaceToCheck.changingToOriginalTemporaly = !removeSurfaceAtEnd;
|
||||
|
||||
public void checkSurfaceToSetTransparentAgain (GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
for (int j = 0; j < currentSurfaceToCheck.materialInfoList.Count; j++) {
|
||||
setAlphaValue (currentSurfaceToCheck, j, currentSurfaceToCheck.materialInfoList [j].surfaceMaterial,
|
||||
false, currentSurfaceToCheck.originalShader [j], currentSurfaceToCheck.materialInfoList [j].originalAlphaColor, removeSurfaceAtEnd);
|
||||
}
|
||||
}
|
||||
|
||||
int surfaceIndex = surfaceGameObjectList.IndexOf (surfaceToCheck);
|
||||
public void checkSurfaceToSetTransparentAgain (GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (surfaceIndex > -1) {
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [surfaceIndex];
|
||||
int surfaceIndex = surfaceGameObjectList.IndexOf (surfaceToCheck);
|
||||
|
||||
if (currentSurfaceToCheck.changingToOriginalActive && !currentSurfaceToCheck.changingToOriginalTemporaly) {
|
||||
// print ("changing to original, stopping");
|
||||
setSurfaceTransparent (currentSurfaceToCheck);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (surfaceIndex > -1) {
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [surfaceIndex];
|
||||
|
||||
public void setSurfaceTransparent (surfaceInfo currentSurfaceToCheck)
|
||||
{
|
||||
currentSurfaceToCheck.changingToOriginalActive = false;
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount = 0;
|
||||
currentSurfaceToCheck.changingToTransparentActive = true;
|
||||
if (currentSurfaceToCheck.changingToOriginalActive && !currentSurfaceToCheck.changingToOriginalTemporaly) {
|
||||
// print ("changing to original, stopping");
|
||||
setSurfaceTransparent (currentSurfaceToCheck);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < currentSurfaceToCheck.materialInfoList.Count; j++) {
|
||||
setAlphaValue (currentSurfaceToCheck, j, currentSurfaceToCheck.materialInfoList [j].surfaceMaterial,
|
||||
true, currentSurfaceToCheck.originalShader [j], currentSurfaceToCheck.materialInfoList [j].originalAlphaColor, false);
|
||||
}
|
||||
}
|
||||
public void setSurfaceTransparent (surfaceInfo currentSurfaceToCheck)
|
||||
{
|
||||
currentSurfaceToCheck.changingToOriginalActive = false;
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount = 0;
|
||||
currentSurfaceToCheck.changingToTransparentActive = true;
|
||||
|
||||
for (int j = 0; j < currentSurfaceToCheck.materialInfoList.Count; j++) {
|
||||
setAlphaValue (currentSurfaceToCheck, j, currentSurfaceToCheck.materialInfoList [j].surfaceMaterial,
|
||||
true, currentSurfaceToCheck.originalShader [j], currentSurfaceToCheck.materialInfoList [j].originalAlphaColor, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setAlphaValue (surfaceInfo currentSurfaceToCheck, int surfaceIndex, Material currentMaterial,
|
||||
bool changingToTransparent, Shader originalShader, float originalAlphaColor, bool removeSurfaceAtEnd)
|
||||
{
|
||||
if (currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine != null) {
|
||||
StopCoroutine (currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine);
|
||||
}
|
||||
public void setAlphaValue (surfaceInfo currentSurfaceToCheck, int surfaceIndex, Material currentMaterial,
|
||||
bool changingToTransparent, Shader originalShader, float originalAlphaColor, bool removeSurfaceAtEnd)
|
||||
{
|
||||
if (currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine != null) {
|
||||
StopCoroutine (currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine);
|
||||
}
|
||||
|
||||
currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine =
|
||||
StartCoroutine (setAlphaValueCoroutine (currentSurfaceToCheck, currentMaterial,
|
||||
changingToTransparent, originalShader, originalAlphaColor, removeSurfaceAtEnd));
|
||||
}
|
||||
currentSurfaceToCheck.materialInfoList [surfaceIndex].alphaBlendCoroutine =
|
||||
StartCoroutine (setAlphaValueCoroutine (currentSurfaceToCheck, currentMaterial,
|
||||
changingToTransparent, originalShader, originalAlphaColor, removeSurfaceAtEnd));
|
||||
}
|
||||
|
||||
IEnumerator setAlphaValueCoroutine (surfaceInfo currentSurfaceToCheck, Material currentMaterial, bool changingToTransparent,
|
||||
Shader originalShader, float originalAlphaColor, bool removeSurfaceAtEnd)
|
||||
{
|
||||
float targetValue = originalAlphaColor;
|
||||
IEnumerator setAlphaValueCoroutine (surfaceInfo currentSurfaceToCheck, Material currentMaterial, bool changingToTransparent,
|
||||
Shader originalShader, float originalAlphaColor, bool removeSurfaceAtEnd)
|
||||
{
|
||||
float targetValue = originalAlphaColor;
|
||||
|
||||
if (changingToTransparent) {
|
||||
targetValue = alphaTransparency;
|
||||
if (changingToTransparent) {
|
||||
targetValue = alphaTransparency;
|
||||
|
||||
if (currentSurfaceToCheck.changingToOriginalTemporaly) {
|
||||
currentMaterial.shader = currentSurfaceToCheck.customShader;
|
||||
}
|
||||
}
|
||||
if (currentSurfaceToCheck.changingToOriginalTemporaly) {
|
||||
currentMaterial.shader = currentSurfaceToCheck.customShader;
|
||||
}
|
||||
}
|
||||
|
||||
if (useAlphaColor) {
|
||||
Color alpha = currentMaterial.color;
|
||||
if (colorID == -1) {
|
||||
colorID = Shader.PropertyToID (colorPropertyName);
|
||||
}
|
||||
|
||||
while (alpha.a != targetValue) {
|
||||
alpha.a = Mathf.MoveTowards (alpha.a, targetValue, Time.deltaTime * alphaBlendSpeed);
|
||||
currentMaterial.color = alpha;
|
||||
if (useAlphaColor) {
|
||||
if (currentMaterial.HasProperty (colorID)) {
|
||||
Color alpha = currentMaterial.GetColor (colorID);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
} else {
|
||||
if (transparentAmountID == -1) {
|
||||
transparentAmountID = Shader.PropertyToID (transparentAmountName);
|
||||
}
|
||||
while (alpha.a != targetValue) {
|
||||
alpha.a = Mathf.MoveTowards (alpha.a, targetValue, Time.deltaTime * alphaBlendSpeed);
|
||||
|
||||
if (currentMaterial.HasProperty (transparentAmountID)) {
|
||||
currentMaterial.SetColor (colorID, alpha);
|
||||
|
||||
float currentTransparentAmount = currentMaterial.GetFloat (transparentAmountID);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
//Color alpha = currentMaterial.color;
|
||||
|
||||
while (currentTransparentAmount != targetValue) {
|
||||
currentTransparentAmount = Mathf.MoveTowards (currentTransparentAmount, targetValue, Time.deltaTime * alphaBlendSpeed);
|
||||
currentMaterial.SetFloat (transparentAmountID, currentTransparentAmount);
|
||||
//while (alpha.a != targetValue) {
|
||||
// alpha.a = Mathf.MoveTowards (alpha.a, targetValue, Time.deltaTime * alphaBlendSpeed);
|
||||
// currentMaterial.color = alpha;
|
||||
|
||||
yield return null;
|
||||
}
|
||||
} else {
|
||||
// yield return null;
|
||||
//}
|
||||
} else {
|
||||
if (transparentAmountID == -1) {
|
||||
transparentAmountID = Shader.PropertyToID (transparentAmountName);
|
||||
}
|
||||
|
||||
if (currentMaterial.HasProperty (transparentAmountID)) {
|
||||
|
||||
float currentTransparentAmount = currentMaterial.GetFloat (transparentAmountID);
|
||||
|
||||
while (currentTransparentAmount != targetValue) {
|
||||
currentTransparentAmount = Mathf.MoveTowards (currentTransparentAmount, targetValue, Time.deltaTime * alphaBlendSpeed);
|
||||
currentMaterial.SetFloat (transparentAmountID, currentTransparentAmount);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
} else {
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!changingToTransparent) {
|
||||
currentMaterial.shader = originalShader;
|
||||
}
|
||||
if (!changingToTransparent) {
|
||||
currentMaterial.shader = originalShader;
|
||||
}
|
||||
|
||||
if (currentSurfaceToCheck.changingToOriginalActive) {
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount++;
|
||||
if (currentSurfaceToCheck.changingToOriginalActive) {
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount++;
|
||||
|
||||
if (removeSurfaceAtEnd) {
|
||||
if (currentSurfaceToCheck.currentMaterialsChangedAmount == currentSurfaceToCheck.materialsAmount) {
|
||||
surfaceInfoList.Remove (currentSurfaceToCheck);
|
||||
if (removeSurfaceAtEnd) {
|
||||
if (currentSurfaceToCheck.currentMaterialsChangedAmount == currentSurfaceToCheck.materialsAmount) {
|
||||
surfaceInfoList.Remove (currentSurfaceToCheck);
|
||||
|
||||
surfaceGameObjectList.Remove (currentSurfaceToCheck.surfaceGameObject);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount++;
|
||||
surfaceGameObjectList.Remove (currentSurfaceToCheck.surfaceGameObject);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
currentSurfaceToCheck.currentMaterialsChangedAmount++;
|
||||
|
||||
if (currentSurfaceToCheck.currentMaterialsChangedAmount == currentSurfaceToCheck.materialsAmount) {
|
||||
currentSurfaceToCheck.changingToTransparentActive = false;
|
||||
if (currentSurfaceToCheck.currentMaterialsChangedAmount == currentSurfaceToCheck.materialsAmount) {
|
||||
currentSurfaceToCheck.changingToTransparentActive = false;
|
||||
|
||||
currentSurfaceToCheck.changingToOriginalTemporaly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
currentSurfaceToCheck.changingToOriginalTemporaly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkSurfacesToRemove ()
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
public void checkSurfacesToRemove ()
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < surfaceInfoList.Count; i++) {
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [i];
|
||||
|
||||
if (currentSurfaceToCheck.numberOfPlayersFound == 0) {
|
||||
setSurfaceToRegular (i, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < surfaceInfoList.Count; i++) {
|
||||
surfaceInfo currentSurfaceToCheck = surfaceInfoList [i];
|
||||
|
||||
public void changeSurfacesToTransparentOrRegularTemporaly (int playerID, int surfaceIndex, bool setTransparentSurface)
|
||||
{
|
||||
if (surfaceInfoList [surfaceIndex].playerIDs.Contains (playerID)) {
|
||||
if (setTransparentSurface) {
|
||||
// print ("transparent");
|
||||
setSurfaceTransparent (surfaceInfoList [surfaceIndex]);
|
||||
} else {
|
||||
// print ("regular");
|
||||
setSurfaceToRegular (surfaceIndex, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentSurfaceToCheck.numberOfPlayersFound == 0) {
|
||||
setSurfaceToRegular (i, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addPlayerIDToSurface (int playerID, GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
public void changeSurfacesToTransparentOrRegularTemporaly (int playerID, int surfaceIndex, bool setTransparentSurface)
|
||||
{
|
||||
if (surfaceInfoList [surfaceIndex].playerIDs.Contains (playerID)) {
|
||||
if (setTransparentSurface) {
|
||||
// print ("transparent");
|
||||
setSurfaceTransparent (surfaceInfoList [surfaceIndex]);
|
||||
} else {
|
||||
// print ("regular");
|
||||
setSurfaceToRegular (surfaceIndex, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < surfaceInfoList.Count; i++) {
|
||||
if (surfaceInfoList [i].surfaceGameObject == surfaceToCheck) {
|
||||
if (!surfaceInfoList [i].playerIDs.Contains (playerID)) {
|
||||
surfaceInfoList [i].playerIDs.Add (playerID);
|
||||
public void addPlayerIDToSurface (int playerID, GameObject surfaceToCheck)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
surfaceInfoList [i].numberOfPlayersFound++;
|
||||
for (int i = 0; i < surfaceInfoList.Count; i++) {
|
||||
if (surfaceInfoList [i].surfaceGameObject == surfaceToCheck) {
|
||||
if (!surfaceInfoList [i].playerIDs.Contains (playerID)) {
|
||||
surfaceInfoList [i].playerIDs.Add (playerID);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
surfaceInfoList [i].numberOfPlayersFound++;
|
||||
|
||||
public void removePlayerIDToSurface (int playerID, int surfaceIndex)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceInfoList [surfaceIndex].playerIDs.Contains (playerID)) {
|
||||
surfaceInfoList [surfaceIndex].playerIDs.Remove (playerID);
|
||||
public void removePlayerIDToSurface (int playerID, int surfaceIndex)
|
||||
{
|
||||
if (!checkSurfaceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
surfaceInfoList [surfaceIndex].numberOfPlayersFound--;
|
||||
}
|
||||
}
|
||||
if (surfaceInfoList [surfaceIndex].playerIDs.Contains (playerID)) {
|
||||
surfaceInfoList [surfaceIndex].playerIDs.Remove (playerID);
|
||||
|
||||
[System.Serializable]
|
||||
public class surfaceInfo
|
||||
{
|
||||
public GameObject surfaceGameObject;
|
||||
public List<Shader> originalShader = new List<Shader> ();
|
||||
public List<materialInfo> materialInfoList = new List<materialInfo> ();
|
||||
public List<int> playerIDs = new List<int> ();
|
||||
public int numberOfPlayersFound;
|
||||
surfaceInfoList [surfaceIndex].numberOfPlayersFound--;
|
||||
}
|
||||
}
|
||||
|
||||
public bool changingToTransparentActive;
|
||||
public bool changingToOriginalActive;
|
||||
public bool changingToOriginalTemporaly;
|
||||
[System.Serializable]
|
||||
public class surfaceInfo
|
||||
{
|
||||
public GameObject surfaceGameObject;
|
||||
public List<Shader> originalShader = new List<Shader> ();
|
||||
public List<materialInfo> materialInfoList = new List<materialInfo> ();
|
||||
public List<int> playerIDs = new List<int> ();
|
||||
public int numberOfPlayersFound;
|
||||
|
||||
public int materialsAmount;
|
||||
public int currentMaterialsChangedAmount;
|
||||
public bool changingToTransparentActive;
|
||||
public bool changingToOriginalActive;
|
||||
public bool changingToOriginalTemporaly;
|
||||
|
||||
public Shader customShader;
|
||||
}
|
||||
public int materialsAmount;
|
||||
public int currentMaterialsChangedAmount;
|
||||
|
||||
[System.Serializable]
|
||||
public class materialInfo
|
||||
{
|
||||
public Material surfaceMaterial;
|
||||
public Coroutine alphaBlendCoroutine;
|
||||
public float originalAlphaColor;
|
||||
}
|
||||
public Shader customShader;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class materialInfo
|
||||
{
|
||||
public Material surfaceMaterial;
|
||||
public Coroutine alphaBlendCoroutine;
|
||||
public float originalAlphaColor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Camera/Others/setTransparentSurfacesSystem.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/Camera/Others/simpleMoveCameraToPosition.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -12,7 +12,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/Camera/Player Camera/camera2_5dSplineZoneOptions.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/Camera/Player Camera/camera2_5dZoneLimitSystem.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/Camera/Player Camera/cameraAxisComponentsInfo.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/Camera/Player Camera/cameraControllerManager.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/Camera/Player Camera/cameraStateInfo.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/Camera/Player Camera/externalCameraShakeSystem.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/Camera/Player Camera/externalShakeInfo.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/Camera/Player Camera/externalShakeInfoListElement.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/Camera/Player Camera/externalShakeListManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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/Camera/Player Camera/headBob.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
using static UnityEngine.GraphicsBuffer;
|
||||
|
||||
public class playerCamera : cameraControllerManager
|
||||
{
|
||||
@@ -2015,6 +2014,19 @@ public class playerCamera : cameraControllerManager
|
||||
lookCameraDirection.localPosition = new Vector3 (0, lookCameraDirection.localPosition.y, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (useTopDownView) {
|
||||
if (currentLockedCameraAxisInfo.showCameraCursorWhenNotAiming) {
|
||||
if (!lookingAtPoint && !lookingAtTarget) {
|
||||
if (!playerIsBusy () && playerControllerManager.canPlayerMove ()) {
|
||||
|
||||
setLookDirection = true;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentCameraMovementPosition = vector3Zero;
|
||||
@@ -2926,7 +2938,7 @@ public class playerCamera : cameraControllerManager
|
||||
horizontalCameraLimitActiveOnAir = state;
|
||||
}
|
||||
|
||||
public float getCurrentDeltaTime ()
|
||||
float getCurrentDeltaTime ()
|
||||
{
|
||||
currentDeltaTime = Time.deltaTime;
|
||||
|
||||
@@ -2945,6 +2957,25 @@ public class playerCamera : cameraControllerManager
|
||||
return currentDeltaTime;
|
||||
}
|
||||
|
||||
float getCurrentFixedDeltaTime ()
|
||||
{
|
||||
float currentFixedDeltaTime = Time.fixedDeltaTime;
|
||||
|
||||
if (regularMovementOnBulletTime) {
|
||||
currentScaleTime = GKC_Utils.getCurrentDeltaTime ();
|
||||
|
||||
if (useUnscaledTimeOnBulletTime) {
|
||||
if (currentScaleTime < 1) {
|
||||
currentFixedDeltaTime = Time.unscaledDeltaTime;
|
||||
}
|
||||
} else {
|
||||
currentFixedDeltaTime *= currentScaleTime;
|
||||
}
|
||||
}
|
||||
|
||||
return currentFixedDeltaTime;
|
||||
}
|
||||
|
||||
public void setShotCameraNoise (Vector2 noiseAmount)
|
||||
{
|
||||
shotCameraNoise = noiseAmount;
|
||||
@@ -3203,7 +3234,7 @@ public class playerCamera : cameraControllerManager
|
||||
|
||||
if (!isCameraTypeFree ()) {
|
||||
if (!driving) {
|
||||
followPlayerPositionOnLockedCamera (currentFixedUpdateDeltaTime);
|
||||
followPlayerPositionOnLockedCamera (getCurrentFixedDeltaTime ());
|
||||
}
|
||||
} else {
|
||||
updateSmoothPlayerCameraPosition ();
|
||||
@@ -3422,8 +3453,12 @@ public class playerCamera : cameraControllerManager
|
||||
lockedCameraPivot.position = new Vector3 (lockedCameraPivot.position.x, newVerticalPosition, newHorizontalPosition);
|
||||
}
|
||||
} else {
|
||||
lockedCameraPivot.position = Vector3.SmoothDamp (lockedCameraPivot.position,
|
||||
targetPosition, ref lockedCameraFollowPlayerPositionVelocity, currentLockedCameraAxisInfo.followPlayerPositionSpeed);
|
||||
if (currentLockedCameraAxisInfo.useSmoothDampToFollowPlayerPosition) {
|
||||
lockedCameraPivot.position = Vector3.SmoothDamp (lockedCameraPivot.position,
|
||||
targetPosition, ref lockedCameraFollowPlayerPositionVelocity, currentLockedCameraAxisInfo.followPlayerPositionSpeed);
|
||||
} else {
|
||||
lockedCameraPivot.position = Vector3.Lerp (lockedCameraPivot.position, targetPosition, deltaTimeToUse * currentLockedCameraAxisInfo.followPlayerPositionSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3805,6 +3840,7 @@ public class playerCamera : cameraControllerManager
|
||||
|
||||
IEnumerator resetPivotCameraTransformLocalRotationCoroutine ()
|
||||
{
|
||||
|
||||
pauseOrPlayCamera (false);
|
||||
|
||||
changeCameraRotationState (false);
|
||||
@@ -4069,7 +4105,10 @@ public class playerCamera : cameraControllerManager
|
||||
cameraTransformPosition = playerCameraTransform.position + currentPivotPositionCenter;
|
||||
currentPivotPositionOffset = currentState.pivotPositionOffset;
|
||||
|
||||
directionFromMainPositionToPivot = pivotCameraTransform.position - cameraTransformPosition;
|
||||
//directionFromMainPositionToPivot = pivotCameraTransform.position - cameraTransformPosition;
|
||||
|
||||
directionFromMainPositionToPivot = playerCameraTransform.up;
|
||||
|
||||
distanceToPivotPositionOffset = GKC_Utils.distance (currentPivotPositionOffset, currentPivotPositionCenter);
|
||||
|
||||
if (cameraCollisionAlwaysActive || currentState.cameraCollisionActive) {
|
||||
@@ -4193,7 +4232,7 @@ public class playerCamera : cameraControllerManager
|
||||
|
||||
previousLockedCameraAxisTransform = null;
|
||||
|
||||
playerControllerManager.setLockedCameraState (false, false, false, true);
|
||||
playerControllerManager.setLockedCameraState (false, false, false, true, false);
|
||||
|
||||
weaponsManager.setLockedCameraActiveState (false);
|
||||
|
||||
@@ -4268,7 +4307,7 @@ public class playerCamera : cameraControllerManager
|
||||
|
||||
previousLockedCameraAxisTransform = null;
|
||||
|
||||
playerControllerManager.setLockedCameraState (false, false, false, true);
|
||||
playerControllerManager.setLockedCameraState (false, false, false, true, false);
|
||||
|
||||
weaponsManager.setLockedCameraActiveState (false);
|
||||
|
||||
@@ -4549,7 +4588,9 @@ public class playerCamera : cameraControllerManager
|
||||
}
|
||||
|
||||
playerControllerManager.setLockedCameraState (true, currentLockedCameraAxisInfo.useTankControls,
|
||||
currentLockedCameraAxisInfo.useRelativeMovementToLockedCamera, currentLockedCameraAxisInfo.playerCanMoveOnAimInTankMode);
|
||||
currentLockedCameraAxisInfo.useRelativeMovementToLockedCamera,
|
||||
currentLockedCameraAxisInfo.playerCanMoveOnAimInTankMode,
|
||||
currentLockedCameraAxisInfo.keepCameraRelativeMovementWhenNotAiming);
|
||||
|
||||
followSplinePathForPlayerPosition = currentLockedCameraAxisInfo.followSplinePathForPlayerPosition;
|
||||
|
||||
@@ -5788,6 +5829,10 @@ public class playerCamera : cameraControllerManager
|
||||
settingShowCameraCursorWhenNotAimingBackToActive = false;
|
||||
} else {
|
||||
setLookAtTargetStateManual (state, null);
|
||||
|
||||
if (!state) {
|
||||
setTargetToLook (null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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/Camera/Player Camera/playerCamera.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/Camera/Player Camera/setCameraFOVValue.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/Camera/Vehicles/vehicleCameraController.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/Camera/Vehicles/vehicleCameraShake.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user