Commit 5faabea9 authored by 18신대성's avatar 18신대성

mirror 프리팹 완성, 거울 구현 완료

parent cea78e5e
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1244481854741161103
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1244481854741161101}
- component: {fileID: 1244481854741161102}
m_Layer: 9
m_Name: Reflection Probe
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1244481854741161101
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854741161103}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.568, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1244481854748242454}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!215 &1244481854741161102
ReflectionProbe:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854741161103}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 1
m_RefreshMode: 1
m_TimeSlicingMode: 2
m_Resolution: 512
m_UpdateFrequency: 0
m_BoxSize: {x: 10, y: 2, z: 10}
m_BoxOffset: {x: 0, y: 0, z: 0}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 0
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 311
m_IntensityMultiplier: 1
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 1
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!1 &1244481854748732982
GameObject:
m_ObjectHideFlags: 0
......@@ -78,7 +14,6 @@ GameObject:
- component: {fileID: 2694312363380670797}
- component: {fileID: 7225251243996645269}
- component: {fileID: 17874052963739924}
- component: {fileID: 1188277518114524885}
m_Layer: 9
m_Name: mirror
m_TagString: wall
......@@ -97,7 +32,8 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1244481854741161101}
- {fileID: 5893704869078864246}
- {fileID: 8860960064478022773}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
......@@ -190,19 +126,173 @@ MonoBehaviour:
mapPos: {x: 0, y: 0}
len: 1
type: 2
--- !u!114 &1188277518114524885
MonoBehaviour:
--- !u!1001 &243436096608247296
PrefabInstance:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1244481854748242454}
m_Modifications:
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.6
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.04
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalScale.x
value: 0.9
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalScale.z
value: 0.9
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3}
--- !u!4 &5893704869078864246 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
m_PrefabInstance: {fileID: 243436096608247296}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2905396486803718915
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1244481854748242454}
m_Modifications:
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror (1)
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.6
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.04
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.y
value: -1
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.0000030696388
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -180.00002
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalScale.x
value: 0.9
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_LocalScale.z
value: 0.9
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3}
--- !u!4 &8860960064478022773 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
m_PrefabInstance: {fileID: 2905396486803718915}
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}
......@@ -25,9 +25,9 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5956712601806148718}
m_LocalRotation: {x: -0, y: -0.7071067, z: -0, w: 0.70710695}
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: -3.43, y: 0.44306278, z: 3.59}
m_LocalScale: {x: 8, y: 8, z: 8}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5956712601805702164}
- {fileID: 5956712601805658424}
......@@ -47,9 +47,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
MaximumPerPixelLights: 2
TextureSize: 768
ClipPlaneOffset: 0.07
FarClipPlane: 1000
TextureSize: 400
ClipPlaneOffset: -0.1
FarClipPlane: 100
ReflectLayers:
serializedVersion: 2
m_Bits: 4294967295
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
public class ModelTestCode : MonoBehaviour
public class MirrorMaterial : MonoBehaviour
{
[SerializeField] private Material mat;
[SerializeField] public static int count = 0;
......@@ -16,10 +16,4 @@ public class ModelTestCode : MonoBehaviour
mat = new Material(Shader.Find("Custom/Mirror"));
mirrorReflect.materials[0] = mat;
}
// Update is called once per frame
void Update()
{
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// code that moves Reflection Probe to proper position
public class MirrorReflect : MonoBehaviour
{
enum Direction { X, Z } // +X direction and +Z direction. Mirror on both side
[SerializeField]
private Direction direction = Direction.X;
public Transform mirror;
public Transform probe;
public Transform mainCam;
private float offset;
private Vector3 probePos;
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;
probePos.x = mirror.position.x + offset;
probePos.y = mainCam.position.y;
probePos.z = mainCam.position.z;
}
else if (direction == Direction.Z)
{
offset = mirror.position.z - mainCam.position.z;
probePos.x = mainCam.position.x;
probePos.y = mainCam.position.y;
probePos.z = mirror.position.z + offset;
}
probe.position = probePos;
if (GetComponent<Renderer>().isVisible)
{
Debug.Log("visible");
gameObject.layer = 9;
}
else
{
Debug.Log("invisible");
gameObject.layer = 0;
}
}
}
fileFormatVersion: 2
guid: e1dd51c2faa2bf14a9c711dadc76f117
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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