Commit cb38d222 authored by 18신대성's avatar 18신대성

bullet 다 작동함

캐릭터가 총 쏘는 위치 맞췄음
parent 18cdb90b
...@@ -9,12 +9,13 @@ Material: ...@@ -9,12 +9,13 @@ Material:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Mirror m_Name: Mirror
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4 m_LightmapFlags: 4
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0 m_DoubleSidedGI: 0
m_CustomRenderQueue: -1 m_CustomRenderQueue: 3000
stringTagMap: {} stringTagMap:
RenderType: Transparent
disabledShaderPasses: [] disabledShaderPasses: []
m_SavedProperties: m_SavedProperties:
serializedVersion: 3 serializedVersion: 3
...@@ -59,19 +60,19 @@ Material: ...@@ -59,19 +60,19 @@ Material:
- _BumpScale: 1 - _BumpScale: 1
- _Cutoff: 0.5 - _Cutoff: 0.5
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 10
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.95 - _Glossiness: 0.4
- _GlossyReflections: 1 - _GlossyReflections: 1
- _Metallic: 0.9 - _Metallic: 0.5
- _Mode: 0 - _Mode: 3
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Parallax: 0.02 - _Parallax: 0.02
- _SmoothnessTextureChannel: 0 - _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1 - _SpecularHighlights: 1
- _SrcBlend: 1 - _SrcBlend: 1
- _UVSec: 0 - _UVSec: 0
- _ZWrite: 1 - _ZWrite: 0
m_Colors: m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 0.9890261, b: 0.82547176, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
...@@ -90,7 +90,7 @@ SphereCollider: ...@@ -90,7 +90,7 @@ SphereCollider:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7554112578236620015} m_GameObject: {fileID: 7554112578236620015}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 1
m_Enabled: 1 m_Enabled: 1
serializedVersion: 2 serializedVersion: 2
m_Radius: 0.5 m_Radius: 0.5
......
...@@ -1433,6 +1433,7 @@ MonoBehaviour: ...@@ -1433,6 +1433,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
head: {fileID: 3233955354714130270} head: {fileID: 3233955354714130270}
shootingArm: {fileID: 494213313239917623} shootingArm: {fileID: 494213313239917623}
shootingFinger: {fileID: 494213313239918045}
--- !u!1 &494213313239918029 --- !u!1 &494213313239918029
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -91,7 +91,7 @@ BoxCollider: ...@@ -91,7 +91,7 @@ BoxCollider:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1244481854748732982} m_GameObject: {fileID: 1244481854748732982}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 1
m_Enabled: 1 m_Enabled: 1
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 1.0000005, y: 1.0000002, z: 0.080003634} m_Size: {x: 1.0000005, y: 1.0000002, z: 0.080003634}
...@@ -134,11 +134,6 @@ PrefabInstance: ...@@ -134,11 +134,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 1244481854748242454} m_TransformParent: {fileID: 1244481854748242454}
m_Modifications: m_Modifications:
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -152,7 +147,7 @@ PrefabInstance: ...@@ -152,7 +147,7 @@ PrefabInstance:
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.04 value: -0.01
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
...@@ -197,18 +192,28 @@ PrefabInstance: ...@@ -197,18 +192,28 @@ PrefabInstance:
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.9 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 0.9 value: 0.9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror
objectReference: {fileID: 0}
- target: {fileID: 5956712601794644638, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601794644638, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: TextureSize propertyPath: TextureSize
value: 768 value: 768
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601804180398, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_CullingMask.m_Bits
value: 1335
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3}
--- !u!4 &5893704869078864246 stripped --- !u!4 &5893704869078864246 stripped
...@@ -224,11 +229,6 @@ PrefabInstance: ...@@ -224,11 +229,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 1244481854748242454} m_TransformParent: {fileID: 1244481854748242454}
m_Modifications: m_Modifications:
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror (1)
objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -242,7 +242,7 @@ PrefabInstance: ...@@ -242,7 +242,7 @@ PrefabInstance:
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.04 value: 0.01
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
...@@ -287,18 +287,28 @@ PrefabInstance: ...@@ -287,18 +287,28 @@ PrefabInstance:
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.9 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601805655926, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 0.9 value: 0.9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601806148718, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_Name
value: Mirror (1)
objectReference: {fileID: 0}
- target: {fileID: 5956712601794644638, guid: 6cee9ce2ee605c54c957dc68c69cea90, - target: {fileID: 5956712601794644638, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3} type: 3}
propertyPath: TextureSize propertyPath: TextureSize
value: 768 value: 768
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5956712601804180398, guid: 6cee9ce2ee605c54c957dc68c69cea90,
type: 3}
propertyPath: m_CullingMask.m_Bits
value: 1335
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 6cee9ce2ee605c54c957dc68c69cea90, type: 3}
--- !u!4 &8860960064478022773 stripped --- !u!4 &8860960064478022773 stripped
......
...@@ -68,6 +68,7 @@ MeshRenderer: ...@@ -68,6 +68,7 @@ MeshRenderer:
m_ProbeAnchor: {fileID: 0} m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1 m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0 m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0 m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0 m_ImportantGI: 0
...@@ -88,7 +89,7 @@ BoxCollider: ...@@ -88,7 +89,7 @@ BoxCollider:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 337530617404887312} m_GameObject: {fileID: 337530617404887312}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 1
m_Enabled: 1 m_Enabled: 1
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 1.0000005, y: 1.0000002, z: 0.080003634} m_Size: {x: 1.0000005, y: 1.0000002, z: 0.080003634}
......
fileFormatVersion: 2
guid: ae6df86ab9243f74f8c5e9aab2cbca92
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -120,6 +120,75 @@ NavMeshSettings: ...@@ -120,6 +120,75 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1001 &471248682
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1244481854748732982, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_Name
value: mirror (2)
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071058
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071078
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90.00001
objectReference: {fileID: 0}
- target: {fileID: 1244481854748242454, guid: 90282f1c82fff7545962b5ca66f1a102,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 90282f1c82fff7545962b5ca66f1a102, type: 3}
--- !u!1001 &527634235 --- !u!1001 &527634235
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -38,7 +38,7 @@ RenderSettings: ...@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 170076734} m_Sun: {fileID: 170076734}
m_IndirectSpecularColor: {r: 0.040745974, g: 0.050543424, b: 0.08338426, a: 1} m_IndirectSpecularColor: {r: 0.040508375, g: 0.050361775, b: 0.08322008, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
...@@ -220,7 +220,6 @@ GameObject: ...@@ -220,7 +220,6 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 448150610} - component: {fileID: 448150610}
- component: {fileID: 448150609}
- component: {fileID: 448150608} - component: {fileID: 448150608}
m_Layer: 10 m_Layer: 10
m_Name: Post-process Volume m_Name: Post-process Volume
...@@ -228,7 +227,7 @@ GameObject: ...@@ -228,7 +227,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!114 &448150608 --- !u!114 &448150608
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -246,19 +245,6 @@ MonoBehaviour: ...@@ -246,19 +245,6 @@ MonoBehaviour:
blendDistance: 0 blendDistance: 0
weight: 1 weight: 1
priority: 0 priority: 0
--- !u!65 &448150609
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448150607}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!4 &448150610 --- !u!4 &448150610
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -378,7 +364,7 @@ MonoBehaviour: ...@@ -378,7 +364,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 534669902} m_GameObject: {fileID: 534669902}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
m_Name: m_Name:
......
...@@ -14,6 +14,7 @@ public class TruthBullet : Bullet ...@@ -14,6 +14,7 @@ public class TruthBullet : Bullet
{ {
other.GetComponent<IBulletInteractor>().Interact(this); other.GetComponent<IBulletInteractor>().Interact(this);
} }
Debug.Log(other.name);
Destroy(gameObject); Destroy(gameObject);
} }
} }
...@@ -148,6 +148,37 @@ public class Map : MonoBehaviour ...@@ -148,6 +148,37 @@ public class Map : MonoBehaviour
} }
} }
/// <summary> /// <summary>
/// Change normal wall at position to mirror.
/// </summary>
/// <param name="pos">Position of wall.</param>
public void ChangeToMirror(Vector2 pos)
{
if (((int)pos.x >= 0 ? ((int)pos.x > maxMapSize / 2) : ((int)pos.x < -maxMapSize / 2)) || ((int)pos.y >= 0 ? ((int)pos.y > maxMapSize / 2) : ((int)pos.y < -maxMapSize / 2)))
{
Debug.Log("Input size exceeds map's max size.");
return;
}
if (Mathf.Abs(pos.x * 10) % 5 != 0 || Mathf.Abs(pos.y * 10) % 5 != 0 || (Mathf.Abs(pos.x * 10) % 10 == 5 && Mathf.Abs(pos.y * 10) % 10 == 5) || (Mathf.Abs(pos.x * 10) % 10 != 5 && Mathf.Abs(pos.y * 10) % 10 != 5))
{
Debug.Log("Inappropriate position of wall.");
return;
}
if (wallGrid.ContainsKey(pos))
{
RemoveWall(pos);
wallGrid.Add(pos, Instantiate(MapManager.inst.mirror, new Vector3(pos.x, 0, pos.y), Quaternion.identity, walls.transform).GetComponent<Wall>());
wallGrid[pos].mapPos = pos;
wallGrid[pos].type = WallType.Mirror;
if (Mathf.Abs(pos.x * 10) % 10 == 5)
wallGrid[pos].transform.eulerAngles = new Vector3(0, 90, 0);
else if (Mathf.Abs(pos.y * 10) % 10 == 5)
wallGrid[pos].transform.eulerAngles = new Vector3(0, 0, 0);
StartCoroutine(MapManager.inst.Rebaker());
}
else
Debug.Log("Wall already exists at : " + pos);
}
/// <summary>
/// Remove wall at position. /// Remove wall at position.
/// </summary> /// </summary>
/// <param name="pos">Position of wall.</param> /// <param name="pos">Position of wall.</param>
......
...@@ -12,12 +12,7 @@ public class NormalWall : Wall, IBulletInteractor ...@@ -12,12 +12,7 @@ public class NormalWall : Wall, IBulletInteractor
} }
else if (bullet is MirrorBullet) else if (bullet is MirrorBullet)
{ {
Mirror mirror = gameObject.AddComponent<Mirror>(); MapManager.inst.currentMap.ChangeToMirror(mapPos);
GetComponent<Renderer>().material = GameManager.inst.mirrorMaterial;
mirror.mapPos = mapPos;
mirror.len = len;
mirror.type = WallType.Mirror;
Destroy(this);
} }
} }
} }
...@@ -13,6 +13,7 @@ public class Player : MonoBehaviour ...@@ -13,6 +13,7 @@ public class Player : MonoBehaviour
Coroutine playerArrivalCheck; Coroutine playerArrivalCheck;
public GameObject head; public GameObject head;
public GameObject shootingArm; public GameObject shootingArm;
public GameObject shootingFinger;
Animator anim; Animator anim;
/// <summary> /// <summary>
...@@ -101,6 +102,7 @@ public class Player : MonoBehaviour ...@@ -101,6 +102,7 @@ public class Player : MonoBehaviour
public void Shoot(BulletCode bulletCode) public void Shoot(BulletCode bulletCode)
{ {
Bullet newBullet = MapManager.inst.bulletFactory.MakeBullet(bulletCode); Bullet newBullet = MapManager.inst.bulletFactory.MakeBullet(bulletCode);
newBullet.transform.position = shootingFinger.transform.position;
newBullet.Init(transform.forward); newBullet.Init(transform.forward);
} }
......
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