add ckg
plantilla base para movimiento básico
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class attachmentIconInfo : MonoBehaviour
|
||||
{
|
||||
public attachmentIcon attachmentIconManager;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad9b408198411e54aaf771357b837bce
|
||||
timeCreated: 1528919236
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentIconInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using GameKitController.Audio;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
[System.Serializable]
|
||||
public class attachmentInfo
|
||||
{
|
||||
public string Name;
|
||||
public bool attachmentEnabled = true;
|
||||
public bool attachmentActive;
|
||||
public bool currentlyActive;
|
||||
|
||||
public bool attachmentUseHUD;
|
||||
|
||||
public bool onlyEnabledWhileCarrying;
|
||||
public GameObject attachmentGameObject;
|
||||
public UnityEvent activateEvent;
|
||||
public UnityEvent deactivateEvent;
|
||||
public attachmentSlot attachmentSlotManager;
|
||||
public AudioClip selectAttachmentSound;
|
||||
public AudioElement selectAttachmentAudioElement;
|
||||
|
||||
public bool useEventOnPress;
|
||||
public UnityEvent eventOnPress;
|
||||
public bool useEventOnPressDown;
|
||||
public UnityEvent eventOnPressDown;
|
||||
public bool useEventOnPressUp;
|
||||
public UnityEvent eventOnPressUp;
|
||||
|
||||
public bool useEventHandPosition;
|
||||
public UnityEvent activateEventHandPosition;
|
||||
public UnityEvent deactivateEventHandPosition;
|
||||
|
||||
public bool useAttachmentHoverInfo;
|
||||
[TextArea (3, 10)] public string attachmentHoverInfo;
|
||||
|
||||
public void InitializeAudioElements ()
|
||||
{
|
||||
if (selectAttachmentSound != null) {
|
||||
selectAttachmentAudioElement.clip = selectAttachmentSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class attachmentIcon
|
||||
{
|
||||
public RectTransform iconRectTransform;
|
||||
public Text attachmentNumberText;
|
||||
public Text attachmentNameText;
|
||||
public Transform attachmentContent;
|
||||
public attachmentSlot notAttachmentButton;
|
||||
|
||||
public Transform attachmentPointTransform;
|
||||
public Transform attachmentLineTransform;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class attachmentSlot
|
||||
{
|
||||
public Button slotButton;
|
||||
public Text attachmentNameText;
|
||||
public GameObject attachmentSelectedIcon;
|
||||
|
||||
public RectTransform attachmentHoverInfoPanelPosition;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 205bebad72e06454b9aaf948afc3e049
|
||||
timeCreated: 1529340625
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class attachmentSlotInfo : MonoBehaviour
|
||||
{
|
||||
public attachmentSlot attachmentSlotManager;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2316ce6373a7288428c3ccdf55d6a187
|
||||
timeCreated: 1528920416
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/attachmentSlotInfo.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,377 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class laserAttachment : laser
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public LayerMask layer;
|
||||
|
||||
public bool laserEnabled = true;
|
||||
public float laserRotationSpeed = 20;
|
||||
public bool alwaysLookInCameraDirection;
|
||||
|
||||
public bool useLaserDot;
|
||||
public bool useLaserDotIconOnScreen;
|
||||
|
||||
[Space]
|
||||
[Header ("Events Settings")]
|
||||
[Space]
|
||||
|
||||
public bool sendMessageOnContact;
|
||||
public UnityEvent contantFunctions = new UnityEvent ();
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool sameObjectFound;
|
||||
public bool hittingSurface;
|
||||
|
||||
public bool laserCanBeUsed;
|
||||
|
||||
public Vector3 hitPointOffset;
|
||||
public Transform offsetReference;
|
||||
|
||||
public bool laserDotActive;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public playerWeaponsManager weaponsManager;
|
||||
public playerWeaponSystem weaponManager;
|
||||
public IKWeaponSystem IkWeaponManager;
|
||||
|
||||
public Transform mainCameraTransform;
|
||||
|
||||
public GameObject laserDot;
|
||||
public laserDotOnScreenSystem mainLaserDotOnScreenSystem;
|
||||
|
||||
RaycastHit hit;
|
||||
Vector3 hitPointPosition;
|
||||
float rayDistance;
|
||||
|
||||
GameObject lastObjectDetected;
|
||||
|
||||
Quaternion targetRotation;
|
||||
Vector3 direction;
|
||||
|
||||
GameObject objectDetectedByCamera;
|
||||
GameObject objectDetectedByLaser;
|
||||
|
||||
Vector3 hitPointCameraDirection;
|
||||
|
||||
Vector3 currentHitNormal;
|
||||
|
||||
Vector3 currentTransformPosition;
|
||||
|
||||
Vector3 currentCameraPosition;
|
||||
|
||||
Vector3 currentForwardDirection;
|
||||
|
||||
bool useForwardDirectionOnLaserAttachments;
|
||||
|
||||
bool firstPersonActive;
|
||||
|
||||
bool firstPersonViewFirstCheck;
|
||||
|
||||
bool mainCameraTransformLocated;
|
||||
|
||||
|
||||
void Start ()
|
||||
{
|
||||
rayDistance = Mathf.Infinity;
|
||||
}
|
||||
|
||||
Coroutine updateCoroutine;
|
||||
|
||||
public void stopUpdateCoroutine ()
|
||||
{
|
||||
if (updateCoroutine != null) {
|
||||
StopCoroutine (updateCoroutine);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator updateSystemCoroutine ()
|
||||
{
|
||||
var waitTime = new WaitForSeconds (0.00001f);
|
||||
|
||||
while (true) {
|
||||
updateSystem ();
|
||||
|
||||
yield return waitTime;
|
||||
}
|
||||
}
|
||||
|
||||
void updateSystem ()
|
||||
{
|
||||
if (laserEnabled) {
|
||||
|
||||
useForwardDirectionOnLaserAttachments = weaponsManager.isUseForwardDirectionOnLaserAttachmentsActive ();
|
||||
|
||||
if (mainCameraTransformLocated) {
|
||||
|
||||
laserCanBeUsed = !weaponManager.weaponIsMoving () &&
|
||||
(weaponManager.aimingInThirdPerson || weaponManager.carryingWeaponInFirstPerson) &&
|
||||
!weaponsManager.isEditinWeaponAttachments () &&
|
||||
(!weaponManager.isWeaponOnRecoil () || alwaysLookInCameraDirection) &&
|
||||
!IkWeaponManager.isWeaponSurfaceDetected () &&
|
||||
!IkWeaponManager.isWeaponInRunPosition () &&
|
||||
!IkWeaponManager.isMeleeAtacking ();
|
||||
|
||||
currentTransformPosition = transform.position;
|
||||
|
||||
currentCameraPosition = mainCameraTransform.position;
|
||||
|
||||
if (laserCanBeUsed) {
|
||||
if (Physics.Raycast (currentCameraPosition, mainCameraTransform.TransformDirection (Vector3.forward), out hit, rayDistance, layer)) {
|
||||
//Debug.DrawLine (mainCameraTransform.position, hit.point, Color.white, 2);
|
||||
direction = hit.point - currentTransformPosition;
|
||||
direction = direction / direction.magnitude;
|
||||
targetRotation = Quaternion.LookRotation (direction);
|
||||
|
||||
objectDetectedByCamera = hit.collider.gameObject;
|
||||
|
||||
if (!IkWeaponManager.isWeaponSurfaceDetected ()) {
|
||||
hitPointCameraDirection = direction;
|
||||
} else {
|
||||
hitPointCameraDirection = hit.point - currentCameraPosition;
|
||||
hitPointCameraDirection = hitPointCameraDirection / hitPointCameraDirection.magnitude;
|
||||
}
|
||||
|
||||
currentHitNormal = hit.normal;
|
||||
} else {
|
||||
targetRotation = Quaternion.LookRotation (mainCameraTransform.forward);
|
||||
|
||||
objectDetectedByCamera = null;
|
||||
|
||||
direction = laserDistance * currentTransformPosition + mainCameraTransform.position;
|
||||
direction = direction / direction.magnitude;
|
||||
|
||||
hitPointCameraDirection = direction;
|
||||
}
|
||||
|
||||
if (sameObjectFound) {
|
||||
transform.rotation = Quaternion.Slerp (transform.rotation, targetRotation, Time.deltaTime * laserRotationSpeed);
|
||||
}
|
||||
} else {
|
||||
if (sameObjectFound) {
|
||||
targetRotation = Quaternion.identity;
|
||||
transform.localRotation = Quaternion.Slerp (transform.localRotation, targetRotation, Time.deltaTime * laserRotationSpeed);
|
||||
}
|
||||
|
||||
objectDetectedByCamera = null;
|
||||
}
|
||||
} else {
|
||||
mainCameraTransform = weaponManager.getMainCameraTransform ();
|
||||
|
||||
mainCameraTransformLocated = mainCameraTransform != null;
|
||||
}
|
||||
|
||||
lRenderer.positionCount = 2;
|
||||
lRenderer.SetPosition (0, currentTransformPosition);
|
||||
|
||||
if (useForwardDirectionOnLaserAttachments) {
|
||||
currentForwardDirection = transform.forward;
|
||||
} else {
|
||||
currentForwardDirection = hitPointCameraDirection;
|
||||
}
|
||||
|
||||
if (Physics.Raycast (currentTransformPosition, currentForwardDirection, out hit, rayDistance, layer)) {
|
||||
hittingSurface = true;
|
||||
|
||||
hitPointPosition = hit.point;
|
||||
|
||||
if (hitPointOffset != Vector3.zero && offsetReference != null) {
|
||||
hitPointPosition += Vector3.Scale (offsetReference.up, hitPointOffset);
|
||||
}
|
||||
|
||||
if (hit.collider.gameObject != lastObjectDetected) {
|
||||
lastObjectDetected = hit.collider.gameObject;
|
||||
|
||||
if (sendMessageOnContact) {
|
||||
if (contantFunctions.GetPersistentEventCount () > 0) {
|
||||
contantFunctions.Invoke ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
currentHitNormal = hit.normal;
|
||||
} else {
|
||||
//the laser does not hit anything, so disable the shield if it was enabled
|
||||
hittingSurface = false;
|
||||
}
|
||||
|
||||
if (Physics.Raycast (currentTransformPosition, hitPointCameraDirection, out hit, rayDistance, layer)) {
|
||||
objectDetectedByLaser = hit.collider.gameObject;
|
||||
|
||||
// Debug.DrawLine (transform.position, hit.point, Color.white, 2);
|
||||
} else {
|
||||
objectDetectedByLaser = null;
|
||||
}
|
||||
|
||||
if (objectDetectedByCamera == objectDetectedByLaser || (objectDetectedByCamera == null && objectDetectedByLaser == null)) {
|
||||
sameObjectFound = true;
|
||||
} else {
|
||||
sameObjectFound = false;
|
||||
}
|
||||
|
||||
if (!sameObjectFound) {
|
||||
hittingSurface = false;
|
||||
targetRotation = Quaternion.identity;
|
||||
transform.localRotation = Quaternion.Slerp (transform.localRotation, targetRotation, Time.deltaTime * laserRotationSpeed);
|
||||
}
|
||||
|
||||
if (hittingSurface) {
|
||||
lRenderer.SetPosition (1, hitPointPosition);
|
||||
|
||||
if (useLaserDot) {
|
||||
if (!laserDotActive) {
|
||||
if (useLaserDotIconOnScreen) {
|
||||
if (mainLaserDotOnScreenSystem != null) {
|
||||
mainLaserDotOnScreenSystem.setLasetDotIconActiveState (true);
|
||||
}
|
||||
} else {
|
||||
laserDot.SetActive (true);
|
||||
}
|
||||
|
||||
laserDotActive = true;
|
||||
}
|
||||
|
||||
laserDot.transform.position = hitPointPosition + 0.01f * currentHitNormal;
|
||||
|
||||
laserDot.transform.rotation = Quaternion.LookRotation (currentHitNormal, transform.up);
|
||||
|
||||
if (weaponManager.carryingWeaponInFirstPerson != firstPersonActive || !firstPersonViewFirstCheck) {
|
||||
firstPersonActive = weaponManager.carryingWeaponInFirstPerson;
|
||||
|
||||
if (firstPersonActive) {
|
||||
laserDot.transform.SetParent (transform.parent);
|
||||
|
||||
weaponsManager.setWeaponPartLayerFromCameraView (laserDot, true);
|
||||
} else {
|
||||
laserDot.transform.SetParent (weaponsManager.getTemporalParentForWeapons ());
|
||||
|
||||
weaponsManager.setWeaponPartLayerFromCameraView (laserDot, false);
|
||||
}
|
||||
|
||||
firstPersonViewFirstCheck = true;
|
||||
}
|
||||
|
||||
if (useLaserDotIconOnScreen) {
|
||||
if (mainLaserDotOnScreenSystem != null) {
|
||||
mainLaserDotOnScreenSystem.updateLaserDotPosition (hitPointPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
laserDistance = 1000;
|
||||
|
||||
if (laserCanBeUsed) {
|
||||
lRenderer.SetPosition (1, (mainCameraTransform.position + laserDistance * mainCameraTransform.forward));
|
||||
} else {
|
||||
lRenderer.SetPosition (1, (currentTransformPosition + laserDistance * transform.forward));
|
||||
}
|
||||
|
||||
if (useLaserDot) {
|
||||
if (laserDotActive) {
|
||||
if (useLaserDotIconOnScreen) {
|
||||
if (mainLaserDotOnScreenSystem != null) {
|
||||
mainLaserDotOnScreenSystem.setLasetDotIconActiveState (false);
|
||||
}
|
||||
} else {
|
||||
laserDot.SetActive (false);
|
||||
}
|
||||
|
||||
laserDotActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setLaserEnabledState (bool state)
|
||||
{
|
||||
laserEnabled = state;
|
||||
|
||||
initializeComponents ();
|
||||
|
||||
if (laserEnabled) {
|
||||
if (weaponsManager == null) {
|
||||
weaponsManager = weaponManager.getPlayerWeaponsManger ();
|
||||
}
|
||||
}
|
||||
|
||||
if (lRenderer) {
|
||||
lRenderer.enabled = state;
|
||||
}
|
||||
|
||||
transform.localRotation = Quaternion.identity;
|
||||
|
||||
if (useLaserDot) {
|
||||
if (!laserEnabled) {
|
||||
if (useLaserDotIconOnScreen) {
|
||||
if (mainLaserDotOnScreenSystem != null) {
|
||||
mainLaserDotOnScreenSystem.setLasetDotIconActiveState (false);
|
||||
}
|
||||
} else {
|
||||
laserDot.SetActive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
firstPersonViewFirstCheck = false;
|
||||
|
||||
enableAttachmentOnEnableFunctionActive = false;
|
||||
|
||||
if (laserEnabled) {
|
||||
if (gameObject.activeInHierarchy) {
|
||||
updateCoroutine = StartCoroutine (updateSystemCoroutine ());
|
||||
} else {
|
||||
enableAttachmentOnEnableFunctionActive = true;
|
||||
}
|
||||
} else {
|
||||
stopUpdateCoroutine ();
|
||||
}
|
||||
}
|
||||
|
||||
bool enableAttachmentOnEnableFunctionActive;
|
||||
|
||||
void OnEnable ()
|
||||
{
|
||||
if (enableAttachmentOnEnableFunctionActive) {
|
||||
if (laserEnabled) {
|
||||
updateCoroutine = StartCoroutine (updateSystemCoroutine ());
|
||||
}
|
||||
|
||||
enableAttachmentOnEnableFunctionActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool componentsInitialized;
|
||||
|
||||
void initializeComponents ()
|
||||
{
|
||||
if (componentsInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (weaponManager != null) {
|
||||
GameObject playerControllerGameObject = weaponManager.getPlayerWeaponsManger ().gameObject;
|
||||
|
||||
playerComponentsManager mainPlayerComponentsManager = playerControllerGameObject.GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (mainPlayerComponentsManager != null) {
|
||||
|
||||
mainCameraTransform = mainPlayerComponentsManager.getPlayerCamera ().getCameraTransform ();
|
||||
|
||||
mainCameraTransformLocated = mainCameraTransform != null;
|
||||
}
|
||||
}
|
||||
|
||||
componentsInitialized = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 140e5806eadf9b54c8c381955a4411c0
|
||||
timeCreated: 1528833896
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/laserAttachment.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,108 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class laserDotOnScreenSystem : MonoBehaviour
|
||||
{
|
||||
[Header ("Main Settings")]
|
||||
[Space]
|
||||
|
||||
public bool laserDotEnabled = true;
|
||||
|
||||
[Space]
|
||||
[Header ("Debug")]
|
||||
[Space]
|
||||
|
||||
public bool laserDotActive;
|
||||
|
||||
[Space]
|
||||
[Header ("Components")]
|
||||
[Space]
|
||||
|
||||
public GameObject laserDotIcon;
|
||||
|
||||
public RectTransform laserDotIconRectTransform;
|
||||
|
||||
public Camera mainCamera;
|
||||
|
||||
public playerCamera mainPlayerCamera;
|
||||
|
||||
public bool targetOnScreen;
|
||||
|
||||
Vector3 currentIconPosition;
|
||||
|
||||
Vector3 screenPoint;
|
||||
|
||||
float screenWidth;
|
||||
float screenHeight;
|
||||
|
||||
Vector2 iconPosition2d;
|
||||
|
||||
Vector2 mainCanvasSizeDelta;
|
||||
Vector2 halfMainCanvasSizeDelta;
|
||||
|
||||
bool usingScreenSpaceCamera;
|
||||
|
||||
public void updateLaserDotPosition (Vector3 hitPoint)
|
||||
{
|
||||
currentIconPosition = hitPoint;
|
||||
|
||||
screenWidth = Screen.width;
|
||||
screenHeight = Screen.height;
|
||||
|
||||
if (usingScreenSpaceCamera) {
|
||||
screenPoint = mainCamera.WorldToViewportPoint (currentIconPosition);
|
||||
targetOnScreen = screenPoint.z > 0 && screenPoint.x > 0 && screenPoint.x < 1 && screenPoint.y > 0 && screenPoint.y < 1;
|
||||
} else {
|
||||
screenPoint = mainCamera.WorldToScreenPoint (currentIconPosition);
|
||||
targetOnScreen = screenPoint.z > 0 && screenPoint.x > 0 && screenPoint.x < screenWidth && screenPoint.y > 0 && screenPoint.y < screenHeight;
|
||||
}
|
||||
|
||||
if (targetOnScreen) {
|
||||
if (usingScreenSpaceCamera) {
|
||||
iconPosition2d = new Vector2 ((screenPoint.x * mainCanvasSizeDelta.x) - halfMainCanvasSizeDelta.x,
|
||||
(screenPoint.y * mainCanvasSizeDelta.y) - halfMainCanvasSizeDelta.y);
|
||||
|
||||
laserDotIconRectTransform.anchoredPosition = iconPosition2d;
|
||||
} else {
|
||||
laserDotIcon.transform.position = new Vector3 (screenPoint.x, screenPoint.y, 0);
|
||||
}
|
||||
|
||||
if (laserDotActive) {
|
||||
if (!laserDotIcon.activeSelf) {
|
||||
laserDotIcon.SetActive (true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (laserDotActive) {
|
||||
if (laserDotIcon.activeSelf) {
|
||||
laserDotIcon.SetActive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setLasetDotIconActiveState (bool state)
|
||||
{
|
||||
if (!laserDotEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
laserDotActive = state;
|
||||
|
||||
if (laserDotActive) {
|
||||
mainCanvasSizeDelta = mainPlayerCamera.getMainCanvasSizeDelta ();
|
||||
halfMainCanvasSizeDelta = mainCanvasSizeDelta * 0.5f;
|
||||
usingScreenSpaceCamera = mainPlayerCamera.isUsingScreenSpaceCamera ();
|
||||
|
||||
if (mainCamera == null) {
|
||||
mainCamera = mainPlayerCamera.getMainCamera ();
|
||||
}
|
||||
}
|
||||
|
||||
if (laserDotIcon.activeSelf != laserDotActive) {
|
||||
laserDotIcon.SetActive (laserDotActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e571f4e8266e69e44b457b06d5ae9ca1
|
||||
timeCreated: 1607451876
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/laserDotOnScreenSystem.cs
|
||||
uploadId: 814740
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2ab7f27ba2cb6f409e11fc0ab2a406f
|
||||
timeCreated: 1528834845
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/weaponAttachmentSystem.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class weaponsAttachmentUIManager : MonoBehaviour
|
||||
{
|
||||
public GameObject attachmentInfoGameObject;
|
||||
public GameObject attachmentSlotGameObject;
|
||||
|
||||
public GameObject weaponAttachmentsMenu;
|
||||
public Transform attachmentHoverInfoPanelGameObject;
|
||||
public Text attachmentHoverInfoText;
|
||||
|
||||
public Camera weaponsCamera;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 463bc182c376ce44ab822b6b59644ec1
|
||||
timeCreated: 1594768832
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Weapons/Attachments/weaponsAttachmentUIManager.cs
|
||||
uploadId: 814740
|
||||
Reference in New Issue
Block a user