4 Commits

Author SHA1 Message Date
jlink 32fe394b58 Merge pull request 'eingeschränktes Movement' (#2) from Jonas into master
Reviewed-on: #2
2026-01-23 17:58:07 +01:00
Sanelschnitte 3d964a33e1 Merge branch 'master' of https://gitea.sneaky-elephants.com/jlink/CodenamePenguin 2026-01-23 17:08:18 +01:00
jlink fe6821d986 Merge pull request 'Jonas' (#1) from Jonas into master
Reviewed-on: #1
2026-01-23 16:48:29 +01:00
Sanelschnitte 968a095813 Audio 23-01
Musik und Sounds
2026-01-23 16:09:12 +01:00
43 changed files with 64 additions and 2277 deletions
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8ecf27f8ef94e904981b6ec7f5363702
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 140426efa0ba27942bd569222ed3a9f4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
Binary file not shown.
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4b37e6f7170b25c4db6a0c78dfa46e57
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-137
View File
@@ -1,137 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ice
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.37486652, g: 0.8441055, b: 0.9811321, a: 1}
- _Color: {r: 0.3748665, g: 0.8441055, b: 0.9811321, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &2741026907837304031
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ee4d96d7f508e9444af762136e9c6e5c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e055c8f81d5bb87429176f3634717f05
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
-137
View File
@@ -1,137 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Penguin
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 0cb99b4457363fe448ba37ceb61821ba, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 0cb99b4457363fe448ba37ceb61821ba, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &2636418254405507475
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b4e93230cf8b48c4a84b58b041637280
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
-115
View File
@@ -1,115 +0,0 @@
fileFormatVersion: 2
guid: 32969bda2a2b4fc4aaf0976c60efc61d
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Material
second: {fileID: 2100000, guid: b4e93230cf8b48c4a84b58b041637280, type: 2}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 KiB

-130
View File
@@ -1,130 +0,0 @@
fileFormatVersion: 2
guid: 0cb99b4457363fe448ba37ceb61821ba
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
-68
View File
@@ -1,68 +0,0 @@
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
public class BearAwareness : MonoBehaviour
{
private int awareness;
public Slider awarenessSlider;
public Image SilderColor;
public static event Action<float> HasWokenUp;
public float timeToWakeUp = 2f;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
awareness = 0;
awarenessSlider.value = 0;
Noice.OnMakeNoice += IncreaseAwareness;
StartCoroutine(Decrease(10));
}
private void Update()
{
if (awareness >= (awarenessSlider.maxValue - 10))
{
SilderColor.color = Color.red;
}
else if (awareness >= (awarenessSlider.maxValue / 2))
{
SilderColor.color = Color.orange;
}
else if (awareness <= (awarenessSlider.maxValue / 2) )
{
SilderColor.color = Color.darkGreen;
}
}
void IncreaseAwareness(int noice)
{
awareness += noice;
awarenessSlider.value = awareness;
if (awareness >= awarenessSlider.maxValue)
{
Debug.Log("Bear is awake now!");
HasWokenUp.Invoke(timeToWakeUp);
}
}
IEnumerator Decrease(float delay)
{
while (true)
{
yield return new WaitForSeconds(5);
awarenessSlider.value -= 5;
}
}
}
-2
View File
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 9d065ef101ba1aa4287712ed4364f254
-45
View File
@@ -1,45 +0,0 @@
using System;
using System.Collections;
using UnityEngine;
public class BearIsAwake : MonoBehaviour
{
public Transform Penguin;
private void Start()
{
BearAwareness.HasWokenUp += IsAwake;
}
public void IsAwake(float time)
{
StartCoroutine(SleepIsOver(time));
}
IEnumerator SleepIsOver(float time)
{
yield return new WaitForSeconds(time);
Vector3 direction = Penguin.position - transform.position;
float distance = direction.magnitude;
direction.Normalize(); // Wichtig: Raycast braucht eine normierte Richtung
if (Physics.Raycast(transform.position, direction, out RaycastHit hit, distance))
{
Debug.Log("Getroffen: " + hit.collider.name);
if (hit.collider.name == "StandUpCollider")
{
Debug.Log("Your Dead!");
}
else
{
Debug.Log("What?");
}
}
Debug.DrawLine(transform.position, Penguin.position, Color.red, 10f);
}
}
-2
View File
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 682ff406ef701fc47849b6c2a3e3473e
+6
View File
@@ -5,6 +5,7 @@ public class IceBlockPush : MonoBehaviour
{
[SerializeField] float contactForce = 2.5f;
private Rigidbody rb;
[SerializeField] private Vector3 StartPos;
private void Start()
{
@@ -34,4 +35,9 @@ public class IceBlockPush : MonoBehaviour
rb.AddForce(directionVector * contactForce, ForceMode.Impulse);
}
public void Reset()
{
this.transform.position = StartPos;
}
}
-14
View File
@@ -1,14 +0,0 @@
using Unity.VisualScripting;
using UnityEngine;
using System;
public class Noice : MonoBehaviour
{
public static event Action<int> OnMakeNoice;
public int noice;
private void OnTriggerEnter(Collider other)
{
if (other.isTrigger) return;
OnMakeNoice.Invoke(noice);
}
}
-2
View File
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: e7bd60a7c0041e044b3f3b515418222e
+21 -7
View File
@@ -1,16 +1,30 @@
using System;
using UnityEngine;
using UnityEngine.Serialization;
public class Pit : MonoBehaviour
{
public float startmass;
public PlayerMove player;
public IceBlockPush ice;
//
// // Update is called once per frame
// void Update()
// {
// if (Input.GetKeyDown(KeyCode.Space))
// {
// player.Reset();
// ice.Reset();
// }
// }
private void OnTriggerEnter(Collider other)
{
if (other.isTrigger) return;
startmass = other.GetComponent<Rigidbody>().mass;
other.GetComponent<Rigidbody>().mass = 100;
other.GetComponent<Rigidbody>().mass = startmass;
other.GetComponent<PositionReset>().Reset();
if (other.GetComponent<PlayerMove>())
{
player.Reset();
}
else if(other.GetComponent<IceBlockPush>())
{
ice.Reset();
}
}
}
+17 -58
View File
@@ -1,96 +1,55 @@
using System;
using System.Collections;
using Unity.VisualScripting;
using UnityEngine;
public class PlayerMove : MonoBehaviour
{
[SerializeField] private float basespeed;
[SerializeField] private float speed;
[SerializeField] private float speedincrease;
[SerializeField] private float maxspeed;
private Rigidbody rb;
[SerializeField] private float slide;
Vector3 moveDirection;
[SerializeField] private Rigidbody rb;
[SerializeField] private Vector3 StartPos;
bool vertical;
private bool horizontal;
[SerializeField] StandUpCollider standUp;
[SerializeField] private string inputNameHorizontal;
[SerializeField] private string inputNameVertical;
bool horizontal;
private void Start()
{
rb = GetComponent<Rigidbody>();
standUp = GetComponentInChildren<StandUpCollider>();
}
void Update()
{
float horizontalInput = Input.GetAxis(inputNameHorizontal);
float verticalInput = Input.GetAxis(inputNameVertical);
float horizontalInput = Input.GetAxis("Horizontal");
float verticalInput = Input.GetAxis("Vertical");
horizontalInput = Mathf.Round(horizontalInput);
verticalInput = Mathf.Round(verticalInput);
Vector3 moveDirection;
if (horizontalInput != 0 && horizontal == true)
{
if (!standUp.ispushing)
{
transform.rotation = Quaternion.Euler(0f, 0f, 90f);
}
vertical = false;
moveDirection = new Vector3(horizontalInput,0, 0);
moveDirection.Normalize();
if (!vertical && speed <= maxspeed && !standUp.ispushing)
{
speed += speedincrease;
}
}
else if (verticalInput != 0 && vertical == true)
{
if (!standUp.ispushing)
{
transform.rotation = Quaternion.Euler(90f, 0f, 0f);
}
horizontal = false;
moveDirection = new Vector3(0, 0, verticalInput);
moveDirection.Normalize();
if (!horizontal && speed <= maxspeed && !standUp.ispushing)
{
speed += speedincrease;
}
}
else
{
StartCoroutine(Slide(slide));
transform.rotation = Quaternion.Euler(0f, 0f, 0f);
moveDirection = new Vector3(0, 0, 0);
horizontal = true;
vertical = true;
}
transform.Translate(moveDirection * speed * Time.deltaTime, Space.World);
}
IEnumerator Slide(float delay)
public void Reset()
{
yield return new WaitForSeconds(delay);
moveDirection = new Vector3(0, 0, 0);
horizontal = true;
vertical = true;
speed = basespeed;
this.transform.position = StartPos;
}
}
-24
View File
@@ -1,24 +0,0 @@
using UnityEngine;
public class StandUpCollider : MonoBehaviour
{
public bool ispushing;
private void OnTriggerEnter(Collider other)
{
IceBlockPush block = other.gameObject.GetComponent<IceBlockPush>();
if (block != null)
{
ispushing = true;
}
}
private void OnTriggerExit(Collider other)
{
IceBlockPush block = other.gameObject.GetComponent<IceBlockPush>();
if (block != null)
{
ispushing = false;
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 19aae932aa4446c4788d84deb1116128
-11
View File
@@ -1,11 +0,0 @@
using UnityEngine;
public class PositionReset : MonoBehaviour
{
[SerializeField] private Vector3 StartPos;
public void Reset()
{
this.transform.position = StartPos;
}
}
-2
View File
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8fc662358fbf8394d804207b2a8c9868
+6 -71
View File
@@ -6,11 +6,11 @@ InputManager:
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Horizontal 1
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
negativeButton: left
positiveButton: right
altNegativeButton: a
altPositiveButton: d
gravity: 3
@@ -22,77 +22,13 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal 2
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal 3
descriptiveName:
descriptiveNegativeName:
negativeButton: h
positiveButton: k
altNegativeButton:
altPositiveButton:
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical 1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical 2
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical 3
descriptiveName:
descriptiveNegativeName:
negativeButton: j
positiveButton: u
altNegativeButton:
altPositiveButton:
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
@@ -549,4 +485,3 @@ InputManager:
type: 2
axis: 5
joyNum: 0
m_UsePhysicalKeys: 1
+1 -1
View File
@@ -12,7 +12,7 @@ TagManager:
-
- Water
- UI
- Player
-
-
-
-