From 7559f1339b17c509a31c137f633a545c60235282 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sat, 19 Jan 2019 13:58:41 -0500 Subject: [PATCH 1/6] lighttest --- Together/Assets/Main Camera.prefab | 84 +++++++ Together/Assets/Main Camera.prefab.meta | 7 + Together/Assets/Materials/Light.mat | 77 +++++++ Together/Assets/Materials/Light.mat.meta | 8 + Together/Assets/PlayerControllerTransform.cs | 18 ++ .../Assets/PlayerControllerTransform.cs.meta | 11 + Together/Assets/PlayerMovement.cs | 19 ++ Together/Assets/PlayerMovement.cs.meta | 11 + Together/Assets/Prefabs.meta | 2 +- Together/Assets/RayCast.cs | 37 ++++ Together/Assets/RayCast.cs.meta | 11 + Together/Assets/Scenes/Light Test.unity | 208 +++++++++++------- Together/ProjectSettings/InputManager.asset | 8 +- 13 files changed, 417 insertions(+), 84 deletions(-) create mode 100644 Together/Assets/Main Camera.prefab create mode 100644 Together/Assets/Main Camera.prefab.meta create mode 100644 Together/Assets/Materials/Light.mat create mode 100644 Together/Assets/Materials/Light.mat.meta create mode 100644 Together/Assets/PlayerControllerTransform.cs create mode 100644 Together/Assets/PlayerControllerTransform.cs.meta create mode 100644 Together/Assets/PlayerMovement.cs create mode 100644 Together/Assets/PlayerMovement.cs.meta create mode 100644 Together/Assets/RayCast.cs create mode 100644 Together/Assets/RayCast.cs.meta diff --git a/Together/Assets/Main Camera.prefab b/Together/Assets/Main Camera.prefab new file mode 100644 index 0000000..4e38523 --- /dev/null +++ b/Together/Assets/Main Camera.prefab @@ -0,0 +1,84 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5274119946999933358 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5274119946999933347} + - component: {fileID: 5274119946999933356} + - component: {fileID: 5274119946999933357} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5274119946999933347 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5274119946999933358} + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0.0000029653306} + m_LocalPosition: {x: 0, y: 0, z: 0.08} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 180.00002, z: 0} +--- !u!20 &5274119946999933356 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5274119946999933358} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_GateFitMode: 2 + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &5274119946999933357 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5274119946999933358} + m_Enabled: 1 diff --git a/Together/Assets/Main Camera.prefab.meta b/Together/Assets/Main Camera.prefab.meta new file mode 100644 index 0000000..cd077d7 --- /dev/null +++ b/Together/Assets/Main Camera.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b6d7bc4609133f44ead4a114af9d2458 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Materials/Light.mat b/Together/Assets/Materials/Light.mat new file mode 100644 index 0000000..f692d4a --- /dev/null +++ b/Together/Assets/Materials/Light.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Light + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Together/Assets/Materials/Light.mat.meta b/Together/Assets/Materials/Light.mat.meta new file mode 100644 index 0000000..0480364 --- /dev/null +++ b/Together/Assets/Materials/Light.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a0d5e3aca7c24e41a180107cd952fde +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/PlayerControllerTransform.cs b/Together/Assets/PlayerControllerTransform.cs new file mode 100644 index 0000000..b06100f --- /dev/null +++ b/Together/Assets/PlayerControllerTransform.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerControllerTransform : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Together/Assets/PlayerControllerTransform.cs.meta b/Together/Assets/PlayerControllerTransform.cs.meta new file mode 100644 index 0000000..60f2dd7 --- /dev/null +++ b/Together/Assets/PlayerControllerTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a90e7ad0e91c76f47812810f0203ae74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/PlayerMovement.cs b/Together/Assets/PlayerMovement.cs new file mode 100644 index 0000000..f16780f --- /dev/null +++ b/Together/Assets/PlayerMovement.cs @@ -0,0 +1,19 @@ + +using UnityEngine; +using System.Collections; + +public class PlayerMovement : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + transform.Translate(Input.GetAxis("Horizontal") * Time.deltaTime, 0f, Input.GetAxis("Vertical") * Time.deltaTime); + } +} diff --git a/Together/Assets/PlayerMovement.cs.meta b/Together/Assets/PlayerMovement.cs.meta new file mode 100644 index 0000000..626b17e --- /dev/null +++ b/Together/Assets/PlayerMovement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f496d40936e3ad74e9b6499ee63b3364 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Prefabs.meta b/Together/Assets/Prefabs.meta index 72c76c2..7394653 100644 --- a/Together/Assets/Prefabs.meta +++ b/Together/Assets/Prefabs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c6c48ef2eb0dce44fb10545d05c1a211 +guid: f783cb2b6eee40044a1cac379d44a415 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Together/Assets/RayCast.cs b/Together/Assets/RayCast.cs new file mode 100644 index 0000000..dba9b2c --- /dev/null +++ b/Together/Assets/RayCast.cs @@ -0,0 +1,37 @@ + +using UnityEngine; + +public class RayCast : MonoBehaviour +{ + public Camera lightRay; + public float lightRange = 7f; + + + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + shoot(); + + } + + void shoot() + { + RaycastHit hit; + + if(Physics.Raycast(lightRay.transform.position, lightRay.transform.forward, out hit, lightRange)) + { + Debug.Log(hit.transform.name); + if (hit < lightRange) + { + + } + } + } +} diff --git a/Together/Assets/RayCast.cs.meta b/Together/Assets/RayCast.cs.meta new file mode 100644 index 0000000..eff1596 --- /dev/null +++ b/Together/Assets/RayCast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aec6b72b07818d49a78065c32cc8511 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Scenes/Light Test.unity b/Together/Assets/Scenes/Light Test.unity index b881e03..0c269e4 100644 --- a/Together/Assets/Scenes/Light Test.unity +++ b/Together/Assets/Scenes/Light Test.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -125,6 +125,8 @@ GameObject: - component: {fileID: 152582816} - component: {fileID: 152582815} - component: {fileID: 152582819} + - component: {fileID: 152582821} + - component: {fileID: 152582820} m_Layer: 0 m_Name: Player m_TagString: Untagged @@ -197,14 +199,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 152582814} - m_LocalRotation: {x: -0.09187309, y: -0.060035285, z: -0.005549239, w: 0.9939438} - m_LocalPosition: {x: -1.008, y: 2.1412466, z: 0.014557197} + m_LocalRotation: {x: 0.005050501, y: -0.994255, z: -0.091902845, w: -0.05463816} + m_LocalPosition: {x: 0.67, y: 2.1412466, z: -7.39} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 270275368} m_Father: {fileID: 0} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: -10.562, y: -6.913, z: 0} + m_LocalEulerAnglesHint: {x: -10.562, y: -186.29099, z: 0} --- !u!143 &152582819 CharacterController: m_ObjectHideFlags: 0 @@ -223,88 +225,52 @@ CharacterController: m_SkinWidth: 0.08 m_MinMoveDistance: 0.001 m_Center: {x: 0, y: 0, z: 0} ---- !u!1 &270275365 -GameObject: +--- !u!195 &152582820 +NavMeshAgent: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 270275368} - - component: {fileID: 270275367} - - component: {fileID: 270275366} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &270275366 -AudioListener: + m_GameObject: {fileID: 152582814} + m_Enabled: 1 + m_AgentTypeID: 0 + m_Radius: 0.5 + m_Speed: 3.5 + m_Acceleration: 8 + avoidancePriority: 50 + m_AngularSpeed: 120 + m_StoppingDistance: 0 + m_AutoTraverseOffMeshLink: 1 + m_AutoBraking: 1 + m_AutoRepath: 1 + m_Height: 0.99999994 + m_BaseOffset: 0.49999997 + m_WalkableMask: 4294967295 + m_ObstacleAvoidanceType: 4 +--- !u!114 &152582821 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 270275365} + m_GameObject: {fileID: 152582814} m_Enabled: 1 ---- !u!20 &270275367 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f496d40936e3ad74e9b6499ee63b3364, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!20 &270275367 stripped Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 5274119946999933356, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + m_PrefabInstance: {fileID: 5274119946730191499} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 270275365} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_GateFitMode: 2 - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &270275368 +--- !u!4 &270275368 stripped Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + m_PrefabInstance: {fileID: 5274119946730191499} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 270275365} - m_LocalRotation: {x: -0, y: 1, z: -0, w: 0.0000029653306} - m_LocalPosition: {x: 0, y: 0, z: 0.08} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 152582818} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 180.00002, z: 0} --- !u!1 &410437378 GameObject: m_ObjectHideFlags: 0 @@ -406,6 +372,7 @@ GameObject: m_Component: - component: {fileID: 806940719} - component: {fileID: 806940718} + - component: {fileID: 806940720} m_Layer: 0 m_Name: Spot Light m_TagString: Untagged @@ -458,13 +425,27 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 806940717} - m_LocalRotation: {x: 0.979661, y: -0, z: -0, w: 0.2006597} - m_LocalPosition: {x: 0, y: 2.611, z: 0} + m_LocalRotation: {x: 0.14298481, y: -0.108409844, z: 0.98281527, w: 0.043323353} + m_LocalPosition: {x: -0.99891883, y: 0.48668247, z: 0.12737712} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 156.849, y: -0.000015258789, z: -0.000015258789} + m_Father: {fileID: 270275368} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 156.849, y: 10.270996, z: 0} +--- !u!114 &806940720 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 806940717} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3aec6b72b07818d49a78065c32cc8511, type: 3} + m_Name: + m_EditorClassIdentifier: + lightRay: {fileID: 270275367} + lightRange: 7 --- !u!1 &840751876 GameObject: m_ObjectHideFlags: 0 @@ -478,7 +459,7 @@ GameObject: - component: {fileID: 840751878} - component: {fileID: 840751877} m_Layer: 0 - m_Name: Cube (1) + m_Name: LightBox m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -694,3 +675,72 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1001 &5274119946730191499 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 152582818} + m_Modifications: + - target: {fileID: 5274119946999933358, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_Name + value: Main Camera + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.08 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalRotation.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.0000029653306 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 180.00002 + objectReference: {fileID: 0} + - target: {fileID: 5274119946999933347, guid: b6d7bc4609133f44ead4a114af9d2458, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b6d7bc4609133f44ead4a114af9d2458, type: 3} diff --git a/Together/ProjectSettings/InputManager.asset b/Together/ProjectSettings/InputManager.asset index 17c8f53..a2d47e3 100644 --- a/Together/ProjectSettings/InputManager.asset +++ b/Together/ProjectSettings/InputManager.asset @@ -11,8 +11,8 @@ InputManager: descriptiveNegativeName: negativeButton: left positiveButton: right - altNegativeButton: a - altPositiveButton: d + altNegativeButton: d + altPositiveButton: a gravity: 3 dead: 0.001 sensitivity: 3 @@ -27,8 +27,8 @@ InputManager: descriptiveNegativeName: negativeButton: down positiveButton: up - altNegativeButton: s - altPositiveButton: w + altNegativeButton: w + altPositiveButton: s gravity: 3 dead: 0.001 sensitivity: 3 From deaf86f5eddbbdc5155ee35c8f96f5c5e99333c5 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sat, 19 Jan 2019 20:45:04 -0500 Subject: [PATCH 2/6] start of enumerator --- Together/Assets/Editor.meta | 8 ++ Together/Assets/Glow.cs | 28 ++++ Together/Assets/Glow.cs.meta | 11 ++ Together/Assets/LightPuzzle.cs | 40 ++++++ Together/Assets/LightPuzzle.cs.meta | 11 ++ Together/Assets/Materials/FirstPuzzle.mat | 77 ++++++++++ .../Assets/Materials/FirstPuzzle.mat.meta | 8 ++ Together/Assets/Materials/Light.mat | 6 +- Together/Assets/Models/Robot.mtl.meta | 7 + Together/Assets/Models/Robot.obj.meta | 134 ++++++++++++++++++ Together/Assets/RayCast.cs | 13 +- Together/Assets/Scenes/Light Test.unity | 4 +- 12 files changed, 338 insertions(+), 9 deletions(-) create mode 100644 Together/Assets/Editor.meta create mode 100644 Together/Assets/Glow.cs create mode 100644 Together/Assets/Glow.cs.meta create mode 100644 Together/Assets/LightPuzzle.cs create mode 100644 Together/Assets/LightPuzzle.cs.meta create mode 100644 Together/Assets/Materials/FirstPuzzle.mat create mode 100644 Together/Assets/Materials/FirstPuzzle.mat.meta create mode 100644 Together/Assets/Models/Robot.mtl.meta create mode 100644 Together/Assets/Models/Robot.obj.meta diff --git a/Together/Assets/Editor.meta b/Together/Assets/Editor.meta new file mode 100644 index 0000000..6275bef --- /dev/null +++ b/Together/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a6df55a0c661074a85cfc53b64f5c16 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Glow.cs b/Together/Assets/Glow.cs new file mode 100644 index 0000000..f5827d4 --- /dev/null +++ b/Together/Assets/Glow.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Glow : MonoBehaviour +{ + //public GameObject box; + public Material material; + //public Material[] mat; + // Renderer rend; + + // Start is called before the first frame update + void Start() + { + //box.SetActive(false); + material.DisableKeyword("_EMISSION"); + //rend = GetComponent(); + //rend.enabled = false; + + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Together/Assets/Glow.cs.meta b/Together/Assets/Glow.cs.meta new file mode 100644 index 0000000..79d9330 --- /dev/null +++ b/Together/Assets/Glow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6463d20bac3b9f0478deb0b39d2dd11f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/LightPuzzle.cs b/Together/Assets/LightPuzzle.cs new file mode 100644 index 0000000..a116440 --- /dev/null +++ b/Together/Assets/LightPuzzle.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LightPuzzle : MonoBehaviour +{ + public GameObject puzzle; + // objectWithScript.GetComponent(); + + //setting color + public Color color = Color.white; + private Color red = Color.red; + Renderer rend; + + // Start is called before the first frame update + void Start() + { + rend = GetComponent(); + //setting opacity of color + color.a = 0f; + rend.material.color = color; + } + + // Update is called once per frame + void Update() + { + red.a = .1f; + rend.material.color = red; + } + IEnumerator FadeIn() + { + for (float f = 0.05f; f <= 1; f += 0.05f) + { + Color color = rend.material.color; + color.a = f; + rend.material.color = color; + yield return new WaitForSeconds(0.5f); + } + } +} diff --git a/Together/Assets/LightPuzzle.cs.meta b/Together/Assets/LightPuzzle.cs.meta new file mode 100644 index 0000000..6652dfa --- /dev/null +++ b/Together/Assets/LightPuzzle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd48c70f4aa5c3141b9102ac069f866e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Materials/FirstPuzzle.mat b/Together/Assets/Materials/FirstPuzzle.mat new file mode 100644 index 0000000..e3ae78f --- /dev/null +++ b/Together/Assets/Materials/FirstPuzzle.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FirstPuzzle + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Together/Assets/Materials/FirstPuzzle.mat.meta b/Together/Assets/Materials/FirstPuzzle.mat.meta new file mode 100644 index 0000000..dbb1b13 --- /dev/null +++ b/Together/Assets/Materials/FirstPuzzle.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65ffc2bbcbde5364fb6e7784b37f7e08 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Materials/Light.mat b/Together/Assets/Materials/Light.mat index f692d4a..aafbfee 100644 --- a/Together/Assets/Materials/Light.mat +++ b/Together/Assets/Materials/Light.mat @@ -9,8 +9,8 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: Light m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: - m_LightmapFlags: 4 + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 @@ -74,4 +74,4 @@ Material: - _ZWrite: 1 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0.9528302, g: 0.8159464, b: 0, a: 1} diff --git a/Together/Assets/Models/Robot.mtl.meta b/Together/Assets/Models/Robot.mtl.meta new file mode 100644 index 0000000..6066b94 --- /dev/null +++ b/Together/Assets/Models/Robot.mtl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d76439d979e2cb342bc7335a7d794ba3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/Models/Robot.obj.meta b/Together/Assets/Models/Robot.obj.meta new file mode 100644 index 0000000..5ada419 --- /dev/null +++ b/Together/Assets/Models/Robot.obj.meta @@ -0,0 +1,134 @@ +fileFormatVersion: 2 +guid: dcae1eb359db6724f81e16a7f9253319 +ModelImporter: + serializedVersion: 23 + fileIDToRecycleName: + 100000: Cylinder + 100002: CylinderFBXASC046000 + 100004: CylinderFBXASC046001 + 100006: Plane + 100008: PlaneFBXASC046001 + 100010: PlaneFBXASC046002 + 100012: //RootNode + 100014: Sphere + 400000: Cylinder + 400002: CylinderFBXASC046000 + 400004: CylinderFBXASC046001 + 400006: Plane + 400008: PlaneFBXASC046001 + 400010: PlaneFBXASC046002 + 400012: //RootNode + 400014: Sphere + 2100000: CylinderSG + 2100002: PlaneSG1 + 2100004: PlaneSG + 2100006: PlaneFBXASC046001SG + 2100008: PlaneFBXASC046001SG1 + 2100010: SphereSG + 2300000: Cylinder + 2300002: CylinderFBXASC046000 + 2300004: CylinderFBXASC046001 + 2300006: Plane + 2300008: PlaneFBXASC046001 + 2300010: PlaneFBXASC046002 + 2300012: Sphere + 3300000: Cylinder + 3300002: CylinderFBXASC046000 + 3300004: CylinderFBXASC046001 + 3300006: Plane + 3300008: PlaneFBXASC046001 + 3300010: PlaneFBXASC046002 + 3300012: Sphere + 4300000: Cylinder + 4300002: CylinderFBXASC046000 + 4300004: CylinderFBXASC046001 + 4300006: Plane + 4300008: PlaneFBXASC046001 + 4300010: PlaneFBXASC046002 + 4300012: Sphere + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + previousCalculatedGlobalScale: 1 + hasPreviousCalculatedGlobalScale: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/RayCast.cs b/Together/Assets/RayCast.cs index dba9b2c..4399f97 100644 --- a/Together/Assets/RayCast.cs +++ b/Together/Assets/RayCast.cs @@ -2,16 +2,21 @@ using UnityEngine; public class RayCast : MonoBehaviour -{ +{ + //hold the camera public Camera lightRay; + //camera range for raycast public float lightRange = 7f; - + //reference the puzzle + public GameObject LightBox; + LightPuzzle lightPuzzle; + // Start is called before the first frame update void Start() { - + lightPuzzle = LightBox.GetComponent(); } // Update is called once per frame @@ -28,7 +33,7 @@ void shoot() if(Physics.Raycast(lightRay.transform.position, lightRay.transform.forward, out hit, lightRange)) { Debug.Log(hit.transform.name); - if (hit < lightRange) + if (hit.distance < lightRange) { } diff --git a/Together/Assets/Scenes/Light Test.unity b/Together/Assets/Scenes/Light Test.unity index 0c269e4..bf25e84 100644 --- a/Together/Assets/Scenes/Light Test.unity +++ b/Together/Assets/Scenes/Light Test.unity @@ -284,7 +284,7 @@ GameObject: - component: {fileID: 410437380} - component: {fileID: 410437379} m_Layer: 0 - m_Name: Cube + m_Name: Floor m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -298,7 +298,7 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 410437378} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} From 7c6c880975472d490770c0fc962b89c98039eb12 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sat, 19 Jan 2019 23:01:08 -0500 Subject: [PATCH 3/6] lerptest --- Together/Assets/LightPuzzle.cs | 26 +- Together/Assets/Materials/FirstPuzzle.mat | 16 +- Together/Assets/Materials/Light.mat | 2 +- Together/Assets/Materials/room.mat | 15 +- Together/Assets/RayCast.cs | 1 + Together/Assets/Scenes/Light Test.unity | 507 +++++++++++++++++++++- 6 files changed, 532 insertions(+), 35 deletions(-) diff --git a/Together/Assets/LightPuzzle.cs b/Together/Assets/LightPuzzle.cs index a116440..81a4b2e 100644 --- a/Together/Assets/LightPuzzle.cs +++ b/Together/Assets/LightPuzzle.cs @@ -9,8 +9,10 @@ public class LightPuzzle : MonoBehaviour //setting color public Color color = Color.white; - private Color red = Color.red; + private Color solid = Color.white; Renderer rend; + private float sec = 2f; + // Start is called before the first frame update void Start() @@ -19,22 +21,28 @@ void Start() //setting opacity of color color.a = 0f; rend.material.color = color; + solid.a = 1f; } // Update is called once per frame void Update() { - red.a = .1f; - rend.material.color = red; + + fadeIn(); } - IEnumerator FadeIn() + + void fadeIn() { - for (float f = 0.05f; f <= 1; f += 0.05f) + // float startOpacity = 0.0f; + //float endOpacity = 1f; + Color inv = Color.white; + inv.a = 0f; + + Color full = Color.white; + full.a = 1f; + while (true) { - Color color = rend.material.color; - color.a = f; - rend.material.color = color; - yield return new WaitForSeconds(0.5f); + rend.material.color = Color.Lerp(inv, full, Time.deltaTime * sec); } } } diff --git a/Together/Assets/Materials/FirstPuzzle.mat b/Together/Assets/Materials/FirstPuzzle.mat index e3ae78f..b2ace96 100644 --- a/Together/Assets/Materials/FirstPuzzle.mat +++ b/Together/Assets/Materials/FirstPuzzle.mat @@ -8,8 +8,8 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: FirstPuzzle - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: + m_Shader: {fileID: 32, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _GLOSSYREFLECTIONS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 @@ -59,19 +59,21 @@ Material: - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - - _DstBlend: 0 + - _DstBlend: 10 - _GlossMapScale: 1 - _Glossiness: 0.5 - - _GlossyReflections: 1 + - _GlossyReflections: 0 - _Metallic: 0 - - _Mode: 0 + - _Mode: 3 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 + - _Shininess: 0.078125 + - _SmoothnessTextureChannel: 1 - _SpecularHighlights: 1 - _SrcBlend: 1 - _UVSec: 0 - - _ZWrite: 1 + - _ZWrite: 0 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.5, g: 0.5, b: 0.5, a: 0} diff --git a/Together/Assets/Materials/Light.mat b/Together/Assets/Materials/Light.mat index aafbfee..5b78585 100644 --- a/Together/Assets/Materials/Light.mat +++ b/Together/Assets/Materials/Light.mat @@ -74,4 +74,4 @@ Material: - _ZWrite: 1 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0.9528302, g: 0.8159464, b: 0, a: 1} + - _EmissionColor: {r: 1.9730586, g: 2.0181055, b: 0.0810846, a: 1} diff --git a/Together/Assets/Materials/room.mat b/Together/Assets/Materials/room.mat index 7511f57..700847a 100644 --- a/Together/Assets/Materials/room.mat +++ b/Together/Assets/Materials/room.mat @@ -9,12 +9,13 @@ Material: m_PrefabAsset: {fileID: 0} m_Name: room m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: + m_ShaderKeywords: _ALPHABLEND_ON m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 @@ -59,19 +60,19 @@ Material: - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - - _DstBlend: 0 + - _DstBlend: 10 - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 - _Metallic: 0 - - _Mode: 0 + - _Mode: 2 - _OcclusionStrength: 1 - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - - _SrcBlend: 1 + - _SrcBlend: 5 - _UVSec: 0 - - _ZWrite: 1 + - _ZWrite: 0 m_Colors: - _Color: {r: 0.3679245, g: 0.33495015, b: 0.33495015, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Together/Assets/RayCast.cs b/Together/Assets/RayCast.cs index 4399f97..6d2a31d 100644 --- a/Together/Assets/RayCast.cs +++ b/Together/Assets/RayCast.cs @@ -17,6 +17,7 @@ public class RayCast : MonoBehaviour void Start() { lightPuzzle = LightBox.GetComponent(); + } // Update is called once per frame diff --git a/Together/Assets/Scenes/Light Test.unity b/Together/Assets/Scenes/Light Test.unity index bf25e84..f9ddb31 100644 --- a/Together/Assets/Scenes/Light Test.unity +++ b/Together/Assets/Scenes/Light Test.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1} + m_IndirectSpecularColor: {r: 0.37311947, g: 0.38074005, b: 0.35872722, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -112,6 +112,97 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &126835015 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 126835019} + - component: {fileID: 126835018} + - component: {fileID: 126835017} + - component: {fileID: 126835016} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &126835016 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 126835015} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &126835017 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 126835015} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &126835018 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 126835015} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &126835019 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 126835015} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 7.27, y: 5.92, z: 0.27} + m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!1 &152582814 GameObject: m_ObjectHideFlags: 0 @@ -200,7 +291,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 152582814} m_LocalRotation: {x: 0.005050501, y: -0.994255, z: -0.091902845, w: -0.05463816} - m_LocalPosition: {x: 0.67, y: 2.1412466, z: -7.39} + m_LocalPosition: {x: 0.67, y: 2.1412466, z: -6.2} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 270275368} @@ -216,7 +307,7 @@ CharacterController: m_GameObject: {fileID: 152582814} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Height: 1 m_Radius: 0.5 @@ -271,6 +362,97 @@ Transform: type: 3} m_PrefabInstance: {fileID: 5274119946730191499} m_PrefabAsset: {fileID: 0} +--- !u!1 &352580108 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 352580112} + - component: {fileID: 352580111} + - component: {fileID: 352580110} + - component: {fileID: 352580109} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &352580109 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352580108} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &352580110 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352580108} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &352580111 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352580108} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &352580112 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352580108} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -0.09, y: 5.92, z: -8.21} + m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!1 &410437378 GameObject: m_ObjectHideFlags: 0 @@ -387,7 +569,7 @@ Light: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 806940717} - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 8 m_Type: 0 m_Color: {r: 1, g: 0, b: 0, a: 1} @@ -446,6 +628,7 @@ MonoBehaviour: m_EditorClassIdentifier: lightRay: {fileID: 270275367} lightRange: 7 + LightBox: {fileID: 0} --- !u!1 &840751876 GameObject: m_ObjectHideFlags: 0 @@ -458,12 +641,14 @@ GameObject: - component: {fileID: 840751879} - component: {fileID: 840751878} - component: {fileID: 840751877} + - component: {fileID: 840751881} + - component: {fileID: 840751882} m_Layer: 0 m_Name: LightBox m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 + m_StaticEditorFlags: 4294967295 m_IsActive: 1 --- !u!65 &840751877 BoxCollider: @@ -473,7 +658,7 @@ BoxCollider: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 840751876} m_Material: {fileID: 0} - m_IsTrigger: 0 + m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} @@ -486,16 +671,16 @@ MeshRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 840751876} m_Enabled: 1 - m_CastShadows: 1 + m_CastShadows: 0 m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 + m_ReflectionProbeUsage: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 65ffc2bbcbde5364fb6e7784b37f7e08, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -537,6 +722,33 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &840751881 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 840751876} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6463d20bac3b9f0478deb0b39d2dd11f, type: 3} + m_Name: + m_EditorClassIdentifier: + material: {fileID: 2100000, guid: 1a0d5e3aca7c24e41a180107cd952fde, type: 2} +--- !u!114 &840751882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 840751876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dd48c70f4aa5c3141b9102ac069f866e, type: 3} + m_Name: + m_EditorClassIdentifier: + puzzle: {fileID: 0} + color: {r: 0.9433962, g: 0.87664646, b: 0.87664646, a: 0.019607844} --- !u!1001 &1056250861 PrefabInstance: m_ObjectHideFlags: 0 @@ -606,6 +818,279 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 2ff102ba6cf59b848a83aaba87351fed, type: 3} +--- !u!1 &1180291491 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1180291495} + - component: {fileID: 1180291494} + - component: {fileID: 1180291493} + - component: {fileID: 1180291492} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1180291492 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180291491} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1180291493 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180291491} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1180291494 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180291491} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1180291495 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1180291491} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 5.92, z: 0} + m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1202460363 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1202460367} + - component: {fileID: 1202460366} + - component: {fileID: 1202460365} + - component: {fileID: 1202460364} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1202460364 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1202460363} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1202460365 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1202460363} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1202460366 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1202460363} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1202460367 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1202460363} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -7.36, y: 5.92, z: 0.27} + m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!1 &1262161729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1262161733} + - component: {fileID: 1262161732} + - component: {fileID: 1262161731} + - component: {fileID: 1262161730} + m_Layer: 0 + m_Name: Cube (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1262161730 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262161729} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1262161731 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262161729} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1262161732 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262161729} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1262161733 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1262161729} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -0.09, y: 5.92, z: 7.4} + m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!1 &1720988262 GameObject: m_ObjectHideFlags: 0 @@ -622,7 +1107,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!108 &1720988263 Light: m_ObjectHideFlags: 0 @@ -634,7 +1119,7 @@ Light: serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 0 + m_Intensity: 0.5 m_Range: 10 m_SpotAngle: 30 m_CookieSize: 10 From 5e6481d4daa155af95ad1d7f13fe751d6e546fa9 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sat, 19 Jan 2019 23:06:04 -0500 Subject: [PATCH 4/6] lerp --- Together/Assets/LightPuzzle.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Together/Assets/LightPuzzle.cs b/Together/Assets/LightPuzzle.cs index 81a4b2e..9864111 100644 --- a/Together/Assets/LightPuzzle.cs +++ b/Together/Assets/LightPuzzle.cs @@ -40,9 +40,9 @@ void fadeIn() Color full = Color.white; full.a = 1f; - while (true) - { + + rend.material.color = Color.Lerp(inv, full, Time.deltaTime * sec); - } + } } From 7a97e3a6ec5fdc76a5d820e7b9139cd812c79a14 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sun, 20 Jan 2019 06:32:08 -0500 Subject: [PATCH 5/6] lerpComp --- Together/Assets/LightPuzzle.cs | 15 ++- Together/Assets/Models/Barrel.prefab | 15 ++- Together/Assets/RayCast.cs | 9 +- Together/Assets/Scenes/Light Test.unity | 120 +++++++++++++++++- Together/Assets/enumLight.cs | 33 +++++ Together/Assets/enumLight.cs.meta | 11 ++ .../ProjectSettings/EditorBuildSettings.asset | 6 +- 7 files changed, 196 insertions(+), 13 deletions(-) create mode 100644 Together/Assets/enumLight.cs create mode 100644 Together/Assets/enumLight.cs.meta diff --git a/Together/Assets/LightPuzzle.cs b/Together/Assets/LightPuzzle.cs index 9864111..441e24c 100644 --- a/Together/Assets/LightPuzzle.cs +++ b/Together/Assets/LightPuzzle.cs @@ -40,9 +40,18 @@ void fadeIn() Color full = Color.white; full.a = 1f; - - - rend.material.color = Color.Lerp(inv, full, Time.deltaTime * sec); + + // Color change = + + + //float lerp = Mathf.PingPong(Time.time, sec) / sec; + //rend.material.Lerp(inv, full, lerp); + + rend.material.color = Color.Lerp(inv, full, Time.deltaTime * sec); + // if (full.a > 1) + //{ + // rend.material.color = Color.white; + //} } } diff --git a/Together/Assets/Models/Barrel.prefab b/Together/Assets/Models/Barrel.prefab index aba0d1a..18119da 100644 --- a/Together/Assets/Models/Barrel.prefab +++ b/Together/Assets/Models/Barrel.prefab @@ -11,8 +11,9 @@ GameObject: - component: {fileID: 3797631425104592939} - component: {fileID: 3797631425101693003} - component: {fileID: 3797631425102824971} + - component: {fileID: 2480813063709350371} m_Layer: 0 - m_Name: mesh91684083 + m_Name: Barrel m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -77,3 +78,15 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!114 &2480813063709350371 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3797631425105089611} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62a4fbed92c3c6b46b25202ab67b3539, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Together/Assets/RayCast.cs b/Together/Assets/RayCast.cs index 6d2a31d..ffe4300 100644 --- a/Together/Assets/RayCast.cs +++ b/Together/Assets/RayCast.cs @@ -31,9 +31,14 @@ void shoot() { RaycastHit hit; - if(Physics.Raycast(lightRay.transform.position, lightRay.transform.forward, out hit, lightRange)) + if (Physics.Raycast(transform.position, -Vector3.up, out hit)) { - Debug.Log(hit.transform.name); + hit.transform.SendMessage("hitByRay"); + } + + if (Physics.Raycast(lightRay.transform.position, lightRay.transform.forward, out hit, lightRange)) + { + Debug.Log(hit.transform.name); if (hit.distance < lightRange) { diff --git a/Together/Assets/Scenes/Light Test.unity b/Together/Assets/Scenes/Light Test.unity index f9ddb31..53fae40 100644 --- a/Together/Assets/Scenes/Light Test.unity +++ b/Together/Assets/Scenes/Light Test.unity @@ -291,7 +291,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 152582814} m_LocalRotation: {x: 0.005050501, y: -0.994255, z: -0.091902845, w: -0.05463816} - m_LocalPosition: {x: 0.67, y: 2.1412466, z: -6.2} + m_LocalPosition: {x: 2.88, y: 1.39, z: -8.23} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 270275368} @@ -555,6 +555,8 @@ GameObject: - component: {fileID: 806940719} - component: {fileID: 806940718} - component: {fileID: 806940720} + - component: {fileID: 806940721} + - component: {fileID: 806940722} m_Layer: 0 m_Name: Spot Light m_TagString: Untagged @@ -608,7 +610,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 806940717} m_LocalRotation: {x: 0.14298481, y: -0.108409844, z: 0.98281527, w: 0.043323353} - m_LocalPosition: {x: -0.99891883, y: 0.48668247, z: 0.12737712} + m_LocalPosition: {x: -0.999, y: 0.462, z: 0.132} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 270275368} @@ -629,6 +631,36 @@ MonoBehaviour: lightRay: {fileID: 270275367} lightRange: 7 LightBox: {fileID: 0} +--- !u!54 &806940721 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 806940717} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &806940722 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 806940717} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &840751876 GameObject: m_ObjectHideFlags: 0 @@ -756,6 +788,51 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: startColor.r + value: 0.990566 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: startColor.g + value: 0.990566 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: startColor.b + value: 0.990566 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: startColor.a + value: 0.02745098 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: endColor.r + value: 0.9150943 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: endColor.g + value: 0.07338022 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: endColor.b + value: 0.07338022 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: endColor.a + value: 0.972549 + objectReference: {fileID: 0} + - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: speed + value: 0.1 + objectReference: {fileID: 0} - target: {fileID: 3797631425105089611, guid: 2ff102ba6cf59b848a83aaba87351fed, type: 3} propertyPath: m_Name @@ -903,7 +980,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1180291491} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 5.92, z: 0} + m_LocalPosition: {x: 0, y: 7.43, z: 0} m_LocalScale: {x: 15.57, y: 0.42, z: 14.52} m_Children: [] m_Father: {fileID: 0} @@ -958,7 +1035,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 81abeb4f8ae67164681b07241e0c83fe, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1091,6 +1168,41 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &1656246283 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3797631425105089611, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + m_PrefabInstance: {fileID: 1056250861} + m_PrefabAsset: {fileID: 0} +--- !u!135 &1656246288 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1656246283} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.2574165 + m_Center: {x: -0.12114291, y: 2.0574794, z: 1.4843535} +--- !u!54 &1656246289 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1656246283} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 --- !u!1 &1720988262 GameObject: m_ObjectHideFlags: 0 diff --git a/Together/Assets/enumLight.cs b/Together/Assets/enumLight.cs new file mode 100644 index 0000000..e9698c5 --- /dev/null +++ b/Together/Assets/enumLight.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class enumLight : MonoBehaviour +{ + public float speed = 1; + public Color startColor; + public Color endColor; + float startTime; + // Start is called before the first frame update + + void Start() + { + startTime = Time.time; + } + + // Update is called once per frame + void Update() + { + RaycastHit hit; + float t = (Time.time - startTime) * speed; + GetComponent().material.color = Color.Lerp(startColor, endColor, t); + //Debug.Log(Color.Lerp(startColor, endColor, t)); + //Debug.Log(hit.transform.name); + + //hitByray(); + } + void hitByray() + { + Debug.Log("I was hit"); + } +} diff --git a/Together/Assets/enumLight.cs.meta b/Together/Assets/enumLight.cs.meta new file mode 100644 index 0000000..6f288b5 --- /dev/null +++ b/Together/Assets/enumLight.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62a4fbed92c3c6b46b25202ab67b3539 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/ProjectSettings/EditorBuildSettings.asset b/Together/ProjectSettings/EditorBuildSettings.asset index ea88784..9bd6d10 100644 --- a/Together/ProjectSettings/EditorBuildSettings.asset +++ b/Together/ProjectSettings/EditorBuildSettings.asset @@ -5,7 +5,7 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: - - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: 99c9720ab356a0642a771bea13969a05 + - enabled: 0 + path: + guid: 00000000000000000000000000000000 m_configObjects: {} From dc1392d873bbd330c836304e8ca549e595953c43 Mon Sep 17 00:00:00 2001 From: Jason Glenn Date: Sun, 20 Jan 2019 11:31:04 -0500 Subject: [PATCH 6/6] finalLighttest --- Together/Assets/Materials/fade.mat | 78 +++++++++++++++++++++++++ Together/Assets/Materials/fade.mat.meta | 8 +++ Together/Assets/RayCast.cs | 31 +++++++--- Together/Assets/Scenes/Light Test.unity | 66 +++++++++------------ Together/Assets/enumLight.cs | 31 +++++++--- 5 files changed, 162 insertions(+), 52 deletions(-) create mode 100644 Together/Assets/Materials/fade.mat create mode 100644 Together/Assets/Materials/fade.mat.meta diff --git a/Together/Assets/Materials/fade.mat b/Together/Assets/Materials/fade.mat new file mode 100644 index 0000000..57ab8e3 --- /dev/null +++ b/Together/Assets/Materials/fade.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: fade + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Together/Assets/Materials/fade.mat.meta b/Together/Assets/Materials/fade.mat.meta new file mode 100644 index 0000000..30fbc98 --- /dev/null +++ b/Together/Assets/Materials/fade.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 901fba8f89bec2b43933fec1788f6e6c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Together/Assets/RayCast.cs b/Together/Assets/RayCast.cs index ffe4300..0334fa7 100644 --- a/Together/Assets/RayCast.cs +++ b/Together/Assets/RayCast.cs @@ -8,15 +8,16 @@ public class RayCast : MonoBehaviour //camera range for raycast public float lightRange = 7f; //reference the puzzle - public GameObject LightBox; - LightPuzzle lightPuzzle; + //public GameObject LightBox; + // LightPuzzle lightPuzzle; + enumLight hitByRay; // Start is called before the first frame update void Start() { - lightPuzzle = LightBox.GetComponent(); + //lightPuzzle = LightBox.GetComponent(); } @@ -24,24 +25,38 @@ void Start() void Update() { shoot(); - + // if ((hitByRay == null) && (GetComponent() != null)) + // { + // hitByRay = GetComponent(); + // Debug.Log("got component"); + // } + // else + // { + // Debug.LogWarning("Missing hitByRay_script component. Please add one"); + // } + } - void shoot() + public void shoot() { RaycastHit hit; if (Physics.Raycast(transform.position, -Vector3.up, out hit)) { - hit.transform.SendMessage("hitByRay"); + // hit.transform.SendMessage("hitByRay"); } if (Physics.Raycast(lightRay.transform.position, lightRay.transform.forward, out hit, lightRange)) { - Debug.Log(hit.transform.name); + //Debug.Log(hit.transform.name); + Debug.DrawRay(lightRay.transform.position, lightRay.transform.forward); + + hitByRay = hit.collider.GetComponent(); if (hit.distance < lightRange) { - + Debug.Log(hit.transform.name); + //hit.collider.gameObject.GetComponent().HitByray(); + hitByRay.startLerp(); } } } diff --git a/Together/Assets/Scenes/Light Test.unity b/Together/Assets/Scenes/Light Test.unity index 53fae40..ee9938b 100644 --- a/Together/Assets/Scenes/Light Test.unity +++ b/Together/Assets/Scenes/Light Test.unity @@ -555,7 +555,6 @@ GameObject: - component: {fileID: 806940719} - component: {fileID: 806940718} - component: {fileID: 806940720} - - component: {fileID: 806940721} - component: {fileID: 806940722} m_Layer: 0 m_Name: Spot Light @@ -571,7 +570,7 @@ Light: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 806940717} - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 8 m_Type: 0 m_Color: {r: 1, g: 0, b: 0, a: 1} @@ -630,23 +629,6 @@ MonoBehaviour: m_EditorClassIdentifier: lightRay: {fileID: 270275367} lightRange: 7 - LightBox: {fileID: 0} ---- !u!54 &806940721 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 806940717} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 --- !u!136 &806940722 CapsuleCollider: m_ObjectHideFlags: 0 @@ -712,7 +694,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 65ffc2bbcbde5364fb6e7784b37f7e08, type: 2} + - {fileID: 2100000, guid: 901fba8f89bec2b43933fec1788f6e6c, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -761,26 +743,31 @@ MonoBehaviour: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 840751876} - m_Enabled: 0 + m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6463d20bac3b9f0478deb0b39d2dd11f, type: 3} + m_Script: {fileID: 11500000, guid: 62a4fbed92c3c6b46b25202ab67b3539, type: 3} m_Name: m_EditorClassIdentifier: - material: {fileID: 2100000, guid: 1a0d5e3aca7c24e41a180107cd952fde, type: 2} ---- !u!114 &840751882 -MonoBehaviour: + speed: 0.3 + startColor: {r: 0.9716981, g: 0.9579477, b: 0.9579477, a: 0} + endColor: {r: 0, g: 0, b: 0, a: 0.972549} + invisible: {r: 1, g: 1, b: 1, a: 1} +--- !u!54 &840751882 +Rigidbody: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 840751876} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dd48c70f4aa5c3141b9102ac069f866e, type: 3} - m_Name: - m_EditorClassIdentifier: - puzzle: {fileID: 0} - color: {r: 0.9433962, g: 0.87664646, b: 0.87664646, a: 0.019607844} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 --- !u!1001 &1056250861 PrefabInstance: m_ObjectHideFlags: 0 @@ -788,6 +775,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 3797631425105089611, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: m_Name + value: Barrel + objectReference: {fileID: 0} - target: {fileID: 2480813063709350371, guid: 2ff102ba6cf59b848a83aaba87351fed, type: 3} propertyPath: startColor.r @@ -833,11 +825,6 @@ PrefabInstance: propertyPath: speed value: 0.1 objectReference: {fileID: 0} - - target: {fileID: 3797631425105089611, guid: 2ff102ba6cf59b848a83aaba87351fed, - type: 3} - propertyPath: m_Name - value: Barrel - objectReference: {fileID: 0} - target: {fileID: 3797631425104592939, guid: 2ff102ba6cf59b848a83aaba87351fed, type: 3} propertyPath: m_LocalPosition.x @@ -893,6 +880,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3797631425102824971, guid: 2ff102ba6cf59b848a83aaba87351fed, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 2100000, guid: 901fba8f89bec2b43933fec1788f6e6c, type: 2} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 2ff102ba6cf59b848a83aaba87351fed, type: 3} --- !u!1 &1180291491 diff --git a/Together/Assets/enumLight.cs b/Together/Assets/enumLight.cs index e9698c5..d6151c3 100644 --- a/Together/Assets/enumLight.cs +++ b/Together/Assets/enumLight.cs @@ -8,26 +8,43 @@ public class enumLight : MonoBehaviour public Color startColor; public Color endColor; float startTime; + bool isfading; // Start is called before the first frame update + Renderer rend; + public Color invisible = Color.white; void Start() { - startTime = Time.time; + rend = GetComponent(); + invisible.a = 0.0f; + rend.material.color = invisible; } // Update is called once per frame void Update() { - RaycastHit hit; - float t = (Time.time - startTime) * speed; - GetComponent().material.color = Color.Lerp(startColor, endColor, t); + //Debug.Log(Color.Lerp(startColor, endColor, t)); //Debug.Log(hit.transform.name); - - //hitByray(); + if (isfading) + { + HitByray(); + } } - void hitByray() + public void HitByray() { Debug.Log("I was hit"); + //RaycastHit hit; + float t = (Time.time - startTime) * speed; + GetComponent().material.color = Color.Lerp(startColor, endColor, t); + } + + public void startLerp() + { + if (isfading == false) + { + isfading = true; + startTime = Time.time; + } } }