Commit 8314db35 authored by 18신대성's avatar 18신대성

mirrorreflect.cs 좀 변경 및 프리팹 변경

parent 7bf9ab38
......@@ -10,8 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 1244481854741161101}
- component: {fileID: 1244481854741161102}
- component: {fileID: 1244481854741161100}
m_Layer: 0
m_Layer: 9
m_Name: Reflection Probe
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -26,7 +25,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854741161103}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0.568, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1244481854748242454}
......@@ -65,21 +64,6 @@ ReflectionProbe:
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!114 &1244481854741161100
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854741161103}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1dd51c2faa2bf14a9c711dadc76f117, type: 3}
m_Name:
m_EditorClassIdentifier:
direction: 0
mirror: {fileID: 1244481854748242454}
mainCam: {fileID: 0}
--- !u!1 &1244481854748732982
GameObject:
m_ObjectHideFlags: 0
......@@ -94,7 +78,8 @@ GameObject:
- component: {fileID: 2694312363380670797}
- component: {fileID: 7225251243996645269}
- component: {fileID: 17874052963739924}
m_Layer: 0
- component: {fileID: 1188277518114524885}
m_Layer: 9
m_Name: mirror
m_TagString: wall
m_Icon: {fileID: 0}
......@@ -205,3 +190,19 @@ MonoBehaviour:
mapPos: {x: 0, y: 0}
len: 1
type: 2
--- !u!114 &1188277518114524885
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854748732982}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1dd51c2faa2bf14a9c711dadc76f117, type: 3}
m_Name:
m_EditorClassIdentifier:
direction: 0
mirror: {fileID: 0}
probe: {fileID: 1244481854741161101}
mainCam: {fileID: 0}
......@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 5992419591198202452}
- component: {fileID: 1788580750165913660}
- component: {fileID: 2953616027608884528}
m_Layer: 0
m_Layer: 9
m_Name: wall
m_TagString: wall
m_Icon: {fileID: 0}
......
fileFormatVersion: 2
guid: f6226b2548447a54486acfc694a44e4d
guid: a32ca40f7f255ea47ac7ee9d558755ce
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
This diff is collapsed.
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 170076734}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -634,6 +634,12 @@ PrefabInstance:
propertyPath: surface
value:
objectReference: {fileID: 2102809461}
- target: {fileID: 3268100033343711389, guid: 11285456de5f1854d947bea83275646f,
type: 3}
propertyPath: player
value:
objectReference: {fileID: 4091712138085544178, guid: 2761dd87fd5be3146b193f53ec0c4cdd,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 11285456de5f1854d947bea83275646f, type: 3}
--- !u!1001 &7277015660625800392
......
......@@ -11,16 +11,21 @@ public class MirrorReflect : MonoBehaviour
private Direction direction = Direction.X;
public Transform mirror;
public Transform probe;
public Transform mainCam;
private float offset;
private Vector3 probePos;
// Update is called once per frame
void Update()
private void Start()
{
mirror = gameObject.transform;
mainCam = Camera.main.transform; // find main camera
}
// Update is called once per frame
void Update()
{
if (direction == Direction.X)
{
offset = mirror.position.x - mainCam.position.x;
......@@ -38,6 +43,17 @@ public class MirrorReflect : MonoBehaviour
probePos.z = mirror.position.z + offset;
}
transform.position = probePos;
probe.position = probePos;
if (GetComponent<Renderer>().isVisible)
{
Debug.Log("visible");
gameObject.layer = 9;
}
else
{
Debug.Log("invisible");
gameObject.layer = 0;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment