Import existing Unity project

This commit is contained in:
2019-09-19 20:47:29 +02:00
parent adf16435c5
commit fcc2c31771
56 changed files with 4627 additions and 0 deletions

38
Assets/Scripts/Goal.cs Normal file
View File

@@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Goal : MonoBehaviour
{
public GameManager gm;
public int playerNumber = 0;
// Start is called before the first frame update
void Start()
{
this.gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManager>();
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter(Collider other)
{
if (other.transform.tag == "Ball")
{
if (this.playerNumber == 1)
{
this.gm.scorePlayer2 += 1;
}
if (this.playerNumber == 2)
{
this.gm.scorePlayer1 += 1;
}
this.gm.ResetPositions();
}
}
}