added target

This commit is contained in:
Bruno Rybársky 2021-07-21 11:10:04 +02:00
parent dd7a3f63cc
commit 9980435c44
3 changed files with 6682 additions and 14 deletions

File diff suppressed because it is too large Load Diff

33
Assets/Scripts/Target.cs Normal file

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Target : MonoBehaviour
{
public AudioClip target;
public AudioSource sfx;
public CircleCollider2D circ;
public string nextScene;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnCollisionEnter2D (Collision2D collisionInfo)
{
if (collisionInfo.collider.name == "Player") {
circ.enabled = false;
sfx.clip = target;
sfx.Play();
SceneManager.LoadScene(nextScene);
}
}
}

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