added test light switches and hold progress circle

This commit is contained in:
janis
2022-02-15 17:50:57 +01:00
parent c485401c58
commit 7872a35be1
341 changed files with 27344 additions and 9134 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 07d6479e8a097a442b09bd078512c8e3
guid: 80e82d2274387fd4da6a9680e81c9e06
PrefabImporter:
externalObjects: {}
userData:

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class PlayerInteraction : MonoBehaviour
{
public TMPro.TextMeshProUGUI interactionText;
[SerializeField]
TextMeshProUGUI interactionText;
[SerializeField]
Image interactionProgressImg;
void Update()
{
@@ -21,15 +26,22 @@ public class PlayerInteraction : MonoBehaviour
HandleInteraction(interactable);
successfulHit = true;
HandleInteractionText(interactable);
HandleInteractionProgress(interactable);
}
}
if (!successfulHit)
{
interactionText.text = "";
interactionProgressImg.fillAmount = 0;
}
}
void HandleInteractionProgress(Interactable interactable)
{
interactionProgressImg.fillAmount = interactable.GetHoldTime() / interactable.GetHoldDuration();
}
void HandleInteractionText(Interactable interactable)
{
@@ -46,13 +58,13 @@ public class PlayerInteraction : MonoBehaviour
switch (interactable.interactionType)
{
case Interactable.InteractionType.Click:
if (Input.GetButtonDown("Interact"))
if (Input.GetButtonDown("Interact") && interactable.isInRange())
{
interactable.Interact();
}
break;
case Interactable.InteractionType.Hold:
if (Input.GetButton("Interact"))
if (Input.GetButton("Interact") && interactable.isInRange())
{
interactable.IncreaseHoldTime();
@@ -69,8 +81,8 @@ public class PlayerInteraction : MonoBehaviour
break;
case Interactable.InteractionType.Harvest:
Harvestable harvestable = interactable.GetComponent<Harvestable>();
Debug.Log(harvestable.GetHarvestTimeLeft());
if (Input.GetButton("Interact"))
if (Input.GetButton("Interact") && interactable.isInRange())
{
harvestable.IncreaseHarvestTime();

View File

@@ -0,0 +1,22 @@
using UnityEngine;
using UnityEngine.Rendering.Universal;
public class TestLight : Interactable
{
[Header("Test Light Properties")]
[SerializeField] Color color;
[SerializeField] Light2D globalLight;
public override string GetDescription()
{
if (isInRange())
return "Turn Light " + gameObject.name;
else
return "Light switch not in range";
}
public override void Interact()
{
globalLight.color = color;
Debug.Log("Color set to " + gameObject.name);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9cfe123230b3a464da8006f1a53a48e8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TreeInteraction : Harvestable
@@ -8,7 +6,7 @@ public class TreeInteraction : Harvestable
public override string GetDescription()
{
if (isInRange())
return "Baum muss schreien";
return "Baum muss weg";
else
return "Tree is not in range";
}

View File

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

View File

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

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a43babfa671545f4bb61621b601e432a
guid: c32f559dee2aeb14bb94c92c61d0bf64
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b92046585647d014faf600e7d38497c1
guid: ae0acf9e445d14c428759c735520d056
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 68f15854e61bd9447b5ba2cb425d6c23
guid: 673a565780fe78f46a9bc0c4cd3ad3c0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fcf7bd12379077440aafc48c2539d663
guid: 44edbf911474b1e4bb0808f1af1f0adc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7a9682a34ebdce2438e9f1b7d63ce170
guid: 6f6575482ae612245adcf529780271e1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d7a3d8f1fe77bc545b42987c53542517
guid: ee8de28e9e4180d43be1b2c1a8ef70a4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0776811934888ee48831feafc2576d28
guid: 6599532f572237a43b4e2b684fcf2173
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 54ac8928a79e63f4a84b03bec274eb2b
guid: 2a9d125bff71e4c469750b11bd89bc71
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d1693b374daf42d4290fc498e1778560
guid: cd3ddf508fa2f7c4095701c501ae23d4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0f9f55daa389d6e42b55e12c3bbd9a6b
guid: ed997a4fad66dfe4592f5bbdfad37b5f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2b28bf81299dff5418f0ff5dc8dd6179
guid: ec2c755ae5186954b8a8e5ee806ac500
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 94dd5914409ab984eb976565a9f5dfa4
guid: 15431675a57720a498bf5357b7a5db8f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 702626df44892a146b8edf548095ce9e
guid: 8522f70463c7a3243ab0e4d6444c654b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dc65b4a1640acb74a980056f61667765
guid: f9fb6dc831a9bcc4599344f64768f84d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5e46a432eeeabfd41b979706a6017e4d
guid: 838b03c97a2c290429023862f5b975e8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 946f49718f6d258409dba7c18af9c197
guid: 17d14c9555b791146b1faf9cc28a75a1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 31861159d62e3fe46bb312ef180fe0bb
guid: 7436960c2535b6b438b8e4909e650104
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 096a5bf2283399048891084c0db28fea
guid: 610ad40380804cd49b15558513364f75
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7e30ae3f8bb2ff74cb9bf6f3a6ff260a
guid: b0ca305ec51fe944ca40a608098bd851
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 615616418cc23904aa74b82628b3c569
guid: 6427364c9843610469730c1392735017
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4e0458f56828b0f4da1371e66a9f1253
guid: 482206ef6aff47c4db97c0d4425ca2a5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3a80fdbf7f341d449aebb6f0ebfc5690
guid: 6d7e1c47af4bb124991ce88430d85272
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8ae945bfb97749b479ab773f6350f41d
guid: 2052f8df8a5d5064aa18cb47a8da52dc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3dc65952dfa57b046970795b7fd60e1f
guid: beba8d595c7ff9f47b6d2694bbb92fe5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 25b67cf1de3e68e41b7e90cb5d798969
guid: c8ca051a10980594fa29b20bce33ef4d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4cb867a87bd34474f9f9e22b5182b68b
guid: 62eea0d3967128f45a9e3267f271e975
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 800a764dfe398694db58be3d23a3c1c9
guid: f33929fb135b01a44ba3021aa06f49c2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 213e57d3f3081d243a3a3f5c8cb26b01
guid: 9e662398cfab4a44d8baa135972a8209
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 68282f241cd33f4449c3d67f99f9dd9a
guid: 1ebbac566f88f474dbf69d9e82ce8c73
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e49ffe19c897d344bbf710276acc07d5
guid: 94baf8668295666499c0b92aad0d837c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5ccbe297c60dedc438faa22c6c6544ca
guid: e78be86adc2735247aa8241a16b588d3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c5835aa351e99bf419ea98160bc95696
guid: 5db3a81a19f6a5c4d9d9f4909aed24a5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2cf3694c76d5fc84dbe2a825e1f60943
guid: 1e1fe2d530ea25543a25417bdd74985e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 40a796a4521988d4ab88011715d23fe7
guid: 8b5abe9306914d0468219227583abdbb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f0deaf0cd1eb9584da6d65be95c1f009
guid: fbc4641853e0dc149babe80d0fc7132e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 02772c0b85bd9a342932c359cc0d70c9
guid: de7e51505aff3a64a88fb1c5c5f063bd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c9e846f30aff45e4b980ae976717e8af
guid: 6d1cb65f0c3f6b94c9632113c269df0e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cfaf8ca6623675c4bbe42333023604de
guid: 4476d499be94a3340b78874eb8b7ff5f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: daff85c918602054eb5a0697c52fd5ef
guid: 2e6ed6d0c1db77e4a865ecbffbe91233
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5091deb3f8ad00d46a9676d898707f5e
guid: 644a3d40d8ce18348b2a7e0faa956446
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: efc580a720cb0254db459df78f76e52e
guid: 7dd0cfb4e9b930e45bfa0cb8a2eb20e2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5695f1c7a56eccb4e8d2c079711feaf8
guid: dcad1c0126f22114fa6bcd6875fbe6c4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4764417f95265cf4d83f9e580bf40506
guid: fdda75cc88db65749ba8a30eb3c01e37
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 635b629fe6cd0d540bd0e264069bfd2d
guid: 8205e9de8b2e70143a713e73ef4182b7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

Some files were not shown because too many files have changed in this diff Show More