hopefully this doesnt break stuff

This commit is contained in:
Rizvee
2022-02-25 07:42:07 -06:00
parent 2195ac327b
commit 8191d4e79e
14 changed files with 537 additions and 46 deletions
+189
View File
@@ -0,0 +1,189 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7120480105423891695
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7120480105423891682}
- component: {fileID: 7120480105423891681}
- component: {fileID: 7120480105423891680}
- component: {fileID: 7120480105423891683}
- component: {fileID: 7120480105423891684}
- component: {fileID: 7120480105423891685}
- component: {fileID: 7120480105423891686}
m_Layer: 7
m_Name: Bird
m_TagString: Platform
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7120480105423891682
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 8.31, y: 0.06, z: 0}
m_LocalScale: {x: 2.04, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7120480105423891681
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
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: -2413806693520163455, guid: ebe73ca9363db456bacf42c025bb4847, type: 3}
m_Color: {r: 0.1981132, g: 0.11048625, b: 0.060555354, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &7120480105423891680
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 33ae55f3d792d2043a282a498c7203e1, type: 3}
m_Name:
m_EditorClassIdentifier:
controller: {fileID: 0}
animator: {fileID: 0}
horizontalMove: -1
runSpeed: 2
deltaY: 3
frequency: 2
m_MovementSmoothing: 0
--- !u!50 &7120480105423891683
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 7
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 6200000, guid: 52e104d77b96cbf4680cc9d0faad8d73, type: 2}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 4
--- !u!61 &7120480105423891684
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 6200000, guid: 52e104d77b96cbf4680cc9d0faad8d73, type: 2}
m_IsTrigger: 0
m_UsedByEffector: 1
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: 1, y: 1}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0.1
--- !u!251 &7120480105423891685
PlatformEffector2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_Enabled: 1
m_UseColliderMask: 1
m_ColliderMask:
serializedVersion: 2
m_Bits: 8
m_RotationalOffset: 0
m_UseOneWay: 1
m_UseOneWayGrouping: 1
m_SurfaceArc: 135
m_UseSideFriction: 0
m_UseSideBounce: 0
m_SideArc: 1
--- !u!114 &7120480105423891686
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7120480105423891695}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56977ce248620a94199b7ddedef0152e, type: 3}
m_Name:
m_EditorClassIdentifier:
isMoving: 0
positionToMoveTo: {x: 0, y: 0, z: 0}
length: 0
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f47750517b3662a4ab2cbeeb18eec95f
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+54
View File
@@ -0,0 +1,54 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bird : MonoBehaviour
{
// Start is called before the first frame update
public Movement controller;
public Animator animator;
public float horizontalMove = -1f;
[SerializeField] float runSpeed = 40f;
private Rigidbody2D m_Rigidbody2D;
[SerializeField] float deltaY;
[SerializeField] float frequency;
private float elapsed = 0;
[Range(0, .3f)][SerializeField] private float m_MovementSmoothing = .05f;
Vector3 m_Velocity = Vector3.zero;
//constructs an NPC using parameters
void Start()
{
m_Rigidbody2D = GetComponent<Rigidbody2D>();
horizontalMove *= runSpeed;
}
// Update is called once per frame
void Update()
{
// if(Movement.pause) {
// animator.SetFloat("Horizontal", 0);
// }
// if (animator != null && !Movement.pause) {
// animator.SetFloat("Horizontal", (horizontalMove/Mathf.Abs(horizontalMove)));
// animator.SetBool("Airborne", !controller.m_Grounded);
// }
if(!Movement.pause){
elapsed += Time.deltaTime;
Vector3 targetVelocity = new Vector2(horizontalMove, Mathf.Sin(elapsed * frequency) * deltaY);
// And then smoothing it out and applying it to the character
m_Rigidbody2D.velocity = Vector3.SmoothDamp(m_Rigidbody2D.velocity, targetVelocity, ref m_Velocity, m_MovementSmoothing);
}
else {
m_Rigidbody2D.velocity = Vector3.zero;
}
}
//NPC movement determined by script in subclasses
// void FixedUpdate()
// {
// controller.Move(horizontalMove *Time.fixedDeltaTime, false, false);
// }
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 61010a6ec25feb5498e828c19148706e
guid: 33ae55f3d792d2043a282a498c7203e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
-20
View File
@@ -1,20 +0,0 @@
//WIP
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!62 &6200000
PhysicsMaterial2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Friction
friction: 1
bounciness: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 52e104d77b96cbf4680cc9d0faad8d73
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 6200000
userData:
assetBundleName:
assetBundleVariant:
-20
View File
@@ -1,20 +0,0 @@
//WIP
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Friend : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
+63
View File
@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeanBird : MonoBehaviour
{
// Start is called before the first frame update
public Movement controller;
public Animator animator;
[SerializeField] float runSpeed = 5.0f;
// private Rigidbody2D m_Rigidbody2D;
private bool attack;
private Vector3 direction;
Transform player;
[SerializeField] float detectRange;
private float accelTime = 1f;
private float elapsed = 0f;
private float t;
//constructs an NPC using parameters
void Start()
{
player = GameObject.FindGameObjectWithTag("Player").transform;
}
// Update is called once per frame
void Update()
{
// if(Movement.pause) {
// animator.SetFloat("Horizontal", 0);
// }
// if (animator != null && !Movement.pause) {
// animator.SetFloat("Horizontal", (horizontalMove/Mathf.Abs(horizontalMove)));
// animator.SetBool("Airborne", !controller.m_Grounded);
// }
}
private void FixedUpdate() {
if(!attack) {
direction = player.position - transform.position;
if(direction.magnitude < detectRange) {
attack = true;
Debug.Log("attack");
}
}
else {
if(t < 1f) {
t = elapsed / accelTime;
t = t * t * (3f - 2f * t);
}
else {
t = 1f;
}
GetComponent<Rigidbody2D>().MovePosition(transform.position + direction.normalized * runSpeed * t / 100f);
elapsed += Time.fixedDeltaTime;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 527e6d43896d2c4409cbb78ce4afdd04
guid: e2ac1ab11e649f44588372b17008679c
MonoImporter:
externalObjects: {}
serializedVersion: 2
+4
View File
@@ -44,6 +44,10 @@ public class PlayerMovement : MonoBehaviour
if (other.gameObject.tag == "Platform") {
transform.parent = other.transform;
}
// if(other.gameObject.tag == "Detection") {
// Debug.Log("detect");
// other.gameObject.GetComponent<MeanBird>().Detected(transform.position - other.gameObject.transform.position);
// }
}
void OnCollisionExit2D (Collision2D other) {
if (other.gameObject.tag == "Platform") {
+196 -2
View File
@@ -278,6 +278,127 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &282791051
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 282791054}
- component: {fileID: 282791053}
- component: {fileID: 282791052}
- component: {fileID: 282791055}
m_Layer: 0
m_Name: Meanbird
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &282791052
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 282791051}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e2ac1ab11e649f44588372b17008679c, type: 3}
m_Name:
m_EditorClassIdentifier:
controller: {fileID: 0}
animator: {fileID: 0}
runSpeed: 25
detectRange: 6
--- !u!212 &282791053
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 282791051}
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: -2413806693520163455, guid: ebe73ca9363db456bacf42c025bb4847, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &282791054
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 282791051}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3.28, y: 3.3, z: 0}
m_LocalScale: {x: 3, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &282791055
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 282791051}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 0
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!1 &532366117
GameObject:
m_ObjectHideFlags: 0
@@ -526,7 +647,7 @@ GameObject:
- component: {fileID: 1536876601}
m_Layer: 3
m_Name: Character
m_TagString: Player
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -734,7 +855,7 @@ GameObject:
- component: {fileID: 1969245557}
m_Layer: 3
m_Name: Char Art
m_TagString: Untagged
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -834,6 +955,10 @@ PrefabInstance:
propertyPath: m_Name
value: NPC
objectReference: {fileID: 0}
- target: {fileID: 252906743233931201, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 252906743233931256, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: m_Radius
value: 2
@@ -846,10 +971,18 @@ PrefabInstance:
propertyPath: controller
value:
objectReference: {fileID: 9100000, guid: 7eb4fdbc838e84a8e83347d54fd48aa6, type: 2}
- target: {fileID: 252906743233931257, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: repeatable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 252906743233931257, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: audioManager
value:
objectReference: {fileID: 220277985}
- target: {fileID: 252906743233931257, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: forceInteract
value: 0
objectReference: {fileID: 0}
- target: {fileID: 252906743233931257, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
propertyPath: pages.Array.size
value: 4
@@ -944,3 +1077,64 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 616bb628e140f2746aa551bed0c95e8f, type: 3}
--- !u!1001 &7120480105463622328
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalPosition.x
value: 8.31
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalPosition.y
value: 0.06
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891682, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891695, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_Name
value: Bird
objectReference: {fileID: 0}
- target: {fileID: 7120480105423891695, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f47750517b3662a4ab2cbeeb18eec95f, type: 3}
+1
View File
@@ -7,6 +7,7 @@ TagManager:
- AudioManager
- Event
- Platform
- Detection
layers:
- Default
- TransparentFX
+2 -2
View File
@@ -27,10 +27,10 @@ EditorUserSettings:
value: 22424703114646680e0b0227036c6d190c011d2f6b3b66032e2c1336acf53a31f6fe
flags: 0
RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c6f1c17031e253e256624283a097df7ee3d2cfb
value: 22424703114646680e0b0227036c6d190c011d2f6b3b66032e2c1336acf53a31f6fe
flags: 0
RecentlyUsedScenePath-8:
value: 22424703114646680e0b0227036c6d190c011d2f6b3b66032e2c1336acf53a31f6fe
value: 22424703114646680e0b0227036c6f1c17031e253e256624283a097df7ee3d2cfb
flags: 0
RecentlyUsedScenePath-9:
value: 22424703114646680e0b0227036c7c0219001c396c1c23233967083debf42d