Add scanlines to holograms and make inv icons two-sided

This commit is contained in:
excitedneon 2017-05-12 19:11:19 +03:00
parent 27c1e7a0c4
commit 1753a43f6d
7 changed files with 272 additions and 8 deletions

View File

@ -8,7 +8,8 @@ Material:
m_PrefabInternal: {fileID: 0}
m_Name: Hologram
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_ShaderKeywords: _ALPHABLEND_ON _DETAIL_MULX2 _EMISSION _GLOSSYREFLECTIONS_OFF
_SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: 3000
@ -23,8 +24,8 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: 3d845f739c7a64c819f4a6b62b6fced5, type: 3}
m_Scale: {x: 1, y: 50}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}

View File

@ -8,7 +8,8 @@ Material:
m_PrefabInternal: {fileID: 0}
m_Name: Hologram_Base
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_ShaderKeywords: _ALPHABLEND_ON _DETAIL_MULX2 _EMISSION _GLOSSYREFLECTIONS_OFF
_SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_CustomRenderQueue: 3000
@ -23,8 +24,8 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Texture: {fileID: 2800000, guid: 3d845f739c7a64c819f4a6b62b6fced5, type: 3}
m_Scale: {x: 1, y: 10}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bfee97be2464fce984713eb758fa613776f4838757fa8e1c914be2ba1b0f6b33
size 194

View File

@ -0,0 +1,68 @@
fileFormatVersion: 2
guid: 3d845f739c7a64c819f4a6b62b6fced5
timeCreated: 1494604080
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -166,5 +166,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b128d3bedf18c46f6b23cf529a954f59, type: 3}
m_Name:
m_EditorClassIdentifier:
HologramMesh: {fileID: 23583528089297200}
Visible: 0
Text: {fileID: 114171175549544602}
HologramScanlineScrollingSpeed: 1

View File

@ -221,6 +221,11 @@ MeshFilter:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 100803251}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &122895534 stripped
MeshRenderer:
m_PrefabParentObject: {fileID: 23929481531100956, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
m_PrefabInternal: {fileID: 2139315739}
--- !u!1 &132238581
GameObject:
m_ObjectHideFlags: 0
@ -235,7 +240,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &132238582
Transform:
m_ObjectHideFlags: 0
@ -2900,6 +2905,167 @@ Prefab:
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4099946104317490, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalPosition.z
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 114633016952828368, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: HologramMesh
value:
objectReference: {fileID: 122895534}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.x
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.z
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 33337063842811222, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 64730419328261050, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.x
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.z
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 33540133742758052, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 64705548599298680, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.x
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.z
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 64013687062017004, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 33683376200718996, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.x
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalScale.z
value: 0.115
objectReference: {fileID: 0}
- target: {fileID: 33521042049071656, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 64624223168060348, guid: e8761b9491a974d1780e60dafbd372a2,
type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 4300000, guid: 8d9188969010c44ce935ad4421c967df, type: 3}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.x
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.w
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4508297394169232, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.x
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.w
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4530634180654324, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.x
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.w
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4164543123855502, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.x
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalRotation.w
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4638548974480200, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: e8761b9491a974d1780e60dafbd372a2, type: 2}
m_IsPrefabParent: 0

View File

@ -1,4 +1,5 @@
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
using Cyber.Util;
namespace Cyber.Util {
@ -8,6 +9,11 @@ namespace Cyber.Util {
/// </summary>
public class Hologram : MonoBehaviour {
/// <summary>
/// The Hologram mesh.
/// </summary>
public MeshRenderer HologramMesh;
/// <summary>
/// Whether the hologram is visible or not.
/// </summary>
@ -19,17 +25,34 @@ namespace Cyber.Util {
/// </summary>
public TextTextureApplier Text;
/// <summary>
/// How fast the scanlines scroll. 1 = the scanlines will scroll the
/// height of a line per second.
/// </summary>
public float HologramScanlineScrollingSpeed = 1f;
private float CurrentScale;
private List<Material> ScanlineMaterials = new List<Material>();
private void Start() {
CurrentScale = GetTargetScale();
UpdateScale();
foreach (Material Mat in HologramMesh.materials) {
if (!Mat.name.Contains("Screen")) {
ScanlineMaterials.Add(Mat);
}
}
}
private void Update() {
if (GetTargetScale() != CurrentScale) {
UpdateScale();
}
float ScaledTime = Time.time * HologramScanlineScrollingSpeed;
float UVScroll = (ScaledTime - (int) ScaledTime);
foreach (Material Mat in ScanlineMaterials) {
Mat.SetTextureOffset("_DetailAlbedoMap", new Vector2(0, UVScroll));
}
}
private void UpdateScale() {