Pingu Art und Bear mechanic

Sanel
JoansLink00 3 months ago
parent a6c4d0ba5b
commit 7d6579dce7

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e055c8f81d5bb87429176f3634717f05
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,137 @@
%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

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b4e93230cf8b48c4a84b58b041637280
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -3,7 +3,12 @@ guid: 32969bda2a2b4fc4aaf0976c60efc61d
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Material
second: {fileID: 2100000, guid: b4e93230cf8b48c4a84b58b041637280, type: 2}
materials:
materialImportMode: 2
materialName: 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

@ -0,0 +1,130 @@
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

@ -0,0 +1,68 @@
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;
}
}
}

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9d065ef101ba1aa4287712ed4364f254

@ -0,0 +1,45 @@
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);
}
}

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 682ff406ef701fc47849b6c2a3e3473e

@ -0,0 +1,14 @@
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);
}
}

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e7bd60a7c0041e044b3f3b515418222e

@ -79,48 +79,6 @@ public class PlayerMove : MonoBehaviour
}
private void Move(float _horizontalInput, float _verticalInput)
{
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);
// }
//
// transform.Translate(moveDirection * speed * Time.deltaTime, Space.World);
//Debug.Log(moveDirection);
}
IEnumerator Slide(float delay)
{

@ -12,7 +12,7 @@ TagManager:
-
- Water
- UI
-
- Player
-
-
-

Loading…
Cancel
Save