I am 28 commits behind master

:) I have been working for a while ;(
This commit is contained in:
Unknown
2022-02-25 03:16:34 -06:00
parent 27d037d96b
commit 499ac57c89
6 changed files with 540 additions and 41 deletions
+26 -7
View File
@@ -12,7 +12,7 @@ public class ScriptRayHit : MonoBehaviour
public GameObject followCam;
public Camera staticCam;
private bool cam = false;
[Range(0.5f, 10f)] public float smoothSpeed = 1f;
[Range(0.5f, 25f)] public float smoothSpeed = 1f;
[Range(1, 10)] public float rayLength = 4f;
private float angleStep = 4;
@@ -20,12 +20,14 @@ public class ScriptRayHit : MonoBehaviour
public Rigidbody2D rb;
private Vector3 offset;
private LayerMask layerMask;
private Vector3 save;
// Start is called before the first frame update
void Start()
{
counter = 0;
layerMask = LayerMask.GetMask("Background");
save = Vector3.zero;
}
void FixedUpdate()
@@ -35,15 +37,34 @@ public class ScriptRayHit : MonoBehaviour
{
var rayAngle = Quaternion.AngleAxis((360f / angleStep) * i, target.forward) * target.up;
hit = Physics2D.Raycast(target.position, rayAngle, rayLength, layerMask);
if (hit)
{
offset += (rayAngle * rayLength) - (rayAngle * hit.distance);
//Debug.Log(hit.point);
}
Vector3 smoothedPos = Vector3.Lerp(transform.position, new Vector3(((target.position.x - offset.x)*rayLength), (target.position.y - offset.y)*smoothSpeed/5, -65f), smoothSpeed * Time.fixedDeltaTime);
float x = Mathf.Abs(target.position.x - smoothedPos.x);
float y = Mathf.Abs(target.position.y - smoothedPos.y);
if (x < 4 && y < 3)
{
save = smoothedPos;
//followCam.transform.position = smoothedPos;
}
else if (x < 4)
{
//followCam.transform.position =new Vector3((save.x + target.position.x),smoothedPos.y, -1.3f);
}else if (y < 3)
{
//followCam.transform.position = new Vector3((save.x + target.position.x), smoothedPos.y, -1.3f);
}
else
{
}
//Vector3 smoothedPos = new Vector3((target.position.x - offset.x)*rayLength, target.position.y - offset.y, -1.3f);
Vector3 smoothedPos = Vector3.Lerp(transform.position, new Vector3((target.position.x - offset.x)*rayLength, target.position.y - offset.y, -100f), smoothSpeed * Time.fixedDeltaTime);
Debug.Log(smoothedPos);
followCam.transform.position = smoothedPos;
}
}
//Vector3 smoothedPos = Vector3.Lerp(transform.position, new Vector3((target.position.x - offset.x)*rayLength, target.position.y - offset.y, -1.3f), smoothSpeed * Time.fixedDeltaTime);
@@ -75,6 +96,4 @@ public class ScriptRayHit : MonoBehaviour
}
counter++;*/
}
}
-4
View File
@@ -52,8 +52,4 @@ public class PlayerMovement : MonoBehaviour
{
transform.position = new Vector2();
}
/*void OnTriggerEnter2D(Collider2D col)
{
Debug.Log("Trigger Detected!");
}*/
}
+8 -4
View File
@@ -19,7 +19,7 @@ public class WallTrigger : MonoBehaviour
// Update is called once per frame
void Update()
{
counter++;
counter++;
}
void OnTriggerEnter2D(Collider2D col)
@@ -33,7 +33,14 @@ public class WallTrigger : MonoBehaviour
entered = true;
//Debug.Log("Move Cam Right");
//Vector3 test = Vector3.Lerp(cam.transform.position, new Vector3(cam.transform.position.x + 10, cam.transform.position.y + 5, -1.3f), 10f*Time.fixedDeltaTime);
//Vector3 smoothedPos = Vector3.Lerp(transform.position, new Vector3(((target.position.x - offset.x)*rayLength),
//target.position.y - offset.y, -65f), smoothSpeed * Time.fixedDeltaTime);
//cam.transform.position += test;
cam.transform.position += moveCam;
//float x = Mathf.Abs(cam.transform.position.x - test.x);
//float y = Mathf.Abs(cam.transform.position.y - test.y);
cat.transform.position += moveCat;
//Debug.Log(counter);
counter = 0;
@@ -57,7 +64,4 @@ public class WallTrigger : MonoBehaviour
Debug.Log("Interact Buttion Pressed!!");
}
/*void Interact(Collider2D col, ){
*
}*/
}
+430 -26
View File
@@ -153,6 +153,7 @@ Transform:
- {fileID: 853833790}
- {fileID: 272334158}
- {fileID: 1363037122}
- {fileID: 1228603695}
m_Father: {fileID: 760969146}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -304,7 +305,7 @@ BoxCollider2D:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 189071651}
m_Enabled: 1
m_Enabled: 0
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
@@ -597,6 +598,8 @@ Transform:
m_Children:
- {fileID: 267604311}
- {fileID: 636622992}
- {fileID: 701830243}
- {fileID: 1880558045}
m_Father: {fileID: 760969146}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -726,7 +729,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &636622992
Transform:
m_ObjectHideFlags: 0
@@ -781,6 +784,142 @@ MonoBehaviour:
m_EditorClassIdentifier:
cam: {fileID: 913520874}
cat: {fileID: 790075215}
--- !u!1 &701830242
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 701830243}
- component: {fileID: 701830247}
- component: {fileID: 701830246}
- component: {fileID: 701830245}
- component: {fileID: 701830244}
m_Layer: 8
m_Name: ShadowRealmGate
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &701830243
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 701830242}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 11, y: 1, z: -1.3}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 485861824}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &701830244
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 701830242}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 91e52ab338e7d0d4694d6799e50dac73, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 701830243}
rayLength: 3
box: {fileID: 701830245}
camMove: {fileID: 913520874}
catMove: {fileID: 790075215}
--- !u!61 &701830245
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 701830242}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 2, y: 9}
m_EdgeRadius: 0
--- !u!114 &701830246
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 701830242}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56666c5a40171f54783dd416a44f42bf, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EventMask:
serializedVersion: 2
m_Bits: 8
m_MaxRayIntersections: 1
--- !u!20 &701830247
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 701830242}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
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: 0
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!1 &760969145
GameObject:
m_ObjectHideFlags: 0
@@ -805,7 +944,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 760969145}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 50, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1058938763}
@@ -814,7 +953,7 @@ Transform:
- {fileID: 485861824}
- {fileID: 38840433}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &772189787
GameObject:
@@ -825,7 +964,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 772189788}
m_Layer: 2
m_Layer: 3
m_Name: Ceiling Check
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -858,7 +997,7 @@ GameObject:
- component: {fileID: 784188900}
- component: {fileID: 784188899}
- component: {fileID: 784188898}
m_Layer: 2
m_Layer: 3
m_Name: WallCheck
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -873,11 +1012,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 784188896}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 790075216}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &784188898
MonoBehaviour:
@@ -893,9 +1032,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
followCam: {fileID: 913520874}
staticCam: {fileID: 913520876}
smoothSpeed: 1
rayLength: 2
target: {fileID: 913520877}
smoothSpeed: 10
rayLength: 6
target: {fileID: 790075216}
rb: {fileID: 790075220}
--- !u!114 &784188899
MonoBehaviour:
@@ -904,7 +1043,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 784188896}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56666c5a40171f54783dd416a44f42bf, type: 3}
m_Name:
@@ -939,8 +1078,8 @@ Camera:
near clip plane: 0.3
far clip plane: 3
field of view: 60
orthographic: 0
orthographic size: 5
orthographic: 1
orthographic size: 6
m_Depth: 0
m_CullingMask:
serializedVersion: 2
@@ -970,7 +1109,7 @@ GameObject:
- component: {fileID: 790075219}
- component: {fileID: 790075218}
- component: {fileID: 790075217}
m_Layer: 2
m_Layer: 3
m_Name: Char Movement
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -991,6 +1130,7 @@ Transform:
- {fileID: 976680914}
- {fileID: 772189788}
- {fileID: 1772079924}
- {fileID: 1477085816}
- {fileID: 784188897}
m_Father: {fileID: 1330058645}
m_RootOrder: 0
@@ -1367,8 +1507,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 913520874}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 50, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@@ -1384,7 +1524,7 @@ GameObject:
m_Component:
- component: {fileID: 976680914}
- component: {fileID: 976680915}
m_Layer: 2
m_Layer: 3
m_Name: Char Art
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -1511,8 +1651,90 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 60, y: 1}
m_Size: {x: 70, y: 1}
m_EdgeRadius: 0
--- !u!1 &1228603694
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1228603695}
- component: {fileID: 1228603696}
m_Layer: 6
m_Name: Background (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1228603695
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1228603694}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -22.43, y: -0.13, z: 0}
m_LocalScale: {x: 1.8342799, y: 1.8342799, z: 1.8342799}
m_Children: []
m_Father: {fileID: 38840433}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1228603696
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1228603694}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, 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_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 0fec1a3f5ca37f84d93b1657c5f66fee, type: 3}
m_Color: {r: 0.9489546, g: 1, b: 0.514151, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 12, y: 6.3}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1330058644
GameObject:
m_ObjectHideFlags: 0
@@ -1537,12 +1759,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1330058644}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.08, z: 0}
m_LocalPosition: {x: 50, y: 2.08, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 790075216}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1363037121
GameObject:
@@ -1637,7 +1859,7 @@ GameObject:
- component: {fileID: 1477085816}
- component: {fileID: 1477085818}
- component: {fileID: 1477085817}
m_Layer: 2
m_Layer: 3
m_Name: Char Cam
m_TagString: MainCamera
m_Icon: {fileID: 0}
@@ -1652,11 +1874,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1477085815}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 2.08, z: -1.21113}
m_LocalPosition: {x: 0, y: 0, z: -1.21113}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_Father: {fileID: 790075216}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!81 &1477085817
AudioListener:
@@ -1718,7 +1940,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1772079924}
m_Layer: 2
m_Layer: 3
m_Name: Ground Check
m_TagString: Untagged
m_Icon: {fileID: 0}
@@ -1739,6 +1961,188 @@ Transform:
m_Father: {fileID: 790075216}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1831917748
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1831917749}
- component: {fileID: 1831917752}
- component: {fileID: 1831917751}
- component: {fileID: 1831917750}
m_Layer: 8
m_Name: WallRayCast
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1831917749
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1831917748}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1880558045}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1831917750
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1831917748}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 91e52ab338e7d0d4694d6799e50dac73, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 1880558045}
rayLength: 3
box: {fileID: 1880558046}
camMove: {fileID: 913520874}
catMove: {fileID: 790075215}
--- !u!114 &1831917751
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1831917748}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56666c5a40171f54783dd416a44f42bf, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EventMask:
serializedVersion: 2
m_Bits: 8
m_MaxRayIntersections: 1
--- !u!20 &1831917752
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1831917748}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
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: 0
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!1 &1880558044
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1880558045}
- component: {fileID: 1880558047}
- component: {fileID: 1880558046}
m_Layer: 8
m_Name: Portal to the piss dimension
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1880558045
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880558044}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -11, y: 1, z: -1.3}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1831917749}
m_Father: {fileID: 485861824}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &1880558046
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880558044}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.2, y: 0.2}
newSize: {x: 0.16, y: 0.16}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 4, y: 116}
m_EdgeRadius: 0
--- !u!114 &1880558047
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880558044}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e34ddf7efd0cb44ba69abc06b6567d4, type: 3}
m_Name:
m_EditorClassIdentifier:
cam: {fileID: 913520874}
cat: {fileID: 790075215}
--- !u!1 &2023632907
GameObject:
m_ObjectHideFlags: 0
+65
View File
@@ -0,0 +1,65 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UpdatedWallTrigger : MonoBehaviour
{
public RaycastHit2D hit;
public Ray ray;
private LayerMask layerMask;
private float angleStep = 8;
public Transform target;
[Range (1f,10f)]public float rayLength = 10f;
public BoxCollider2D box;
public GameObject camMove;
public GameObject catMove;
private int counter = 0;
// Start is called before the first frame update
void Start()
{
layerMask = LayerMask.GetMask("Player");
}
// Update is called once per frame
void Update()
{
for (int i = 1; i <= angleStep; i++)
{
var rayAngle = Quaternion.AngleAxis((360f / angleStep) * i, target.forward) * Vector3.left;
hit = Physics2D.Raycast(target.position, rayAngle, rayLength, layerMask);
float xe = Mathf.Abs(hit.point.x - target.position.x);
float ye = hit.point.y;
float goalx = Mathf.Abs(target.localPosition.x / box.size.x);
if (hit && counter >=150)
{
if (xe >= goalx)
{
Debug.Log("Counter Right "+counter);
Debug.Log(xe);
Debug.Log("XE " + xe);
Debug.Log("Goal " + goalx);
camMove.transform.position = new Vector3(camMove.transform.position.x - 22f, camMove.transform.position.y, -1.3f);
catMove.transform.position = new Vector3(catMove.transform.position.x - 10f, catMove.transform.position.y+1f, 0);
counter = 0;
}
else if (xe < goalx)
{
Debug.Log("Counter Left " + counter);
Debug.Log("XE "+xe);
Debug.Log("Goal "+ goalx);
camMove.transform.position = new Vector3(camMove.transform.position.x + 22f, 0,-1.3f);
catMove.transform.position = new Vector3(catMove.transform.position.x + 10f, catMove.transform.position.y +1f,0);
counter = 0;
}
}
counter++;
}
void OnTriggerEnter2D(Collider2D col)
{
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 91e52ab338e7d0d4694d6799e50dac73
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: