Compare commits
No commits in common. "93f83c121ce9161b91b56e971c49c2dfdd347247" and "54576cb420684e0851e938aa2319b2f8a67d7462" have entirely different histories.
93f83c121c
...
54576cb420
|
@ -1 +1 @@
|
||||||
Subproject commit ea2119913ae05cb512b9e5bc3b28b88e50ade9af
|
Subproject commit cf3cf65b068d861d5bd65db2fbbb53a55f5bbf4d
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 35a6473e8e64e19c69b5a2aa7cf193d3
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Turret",
|
|
||||||
"rootNamespace": "",
|
|
||||||
"references": [
|
|
||||||
"UnityEngine.TestRunner",
|
|
||||||
"UnityEditor.TestRunner",
|
|
||||||
"Entities"
|
|
||||||
],
|
|
||||||
"includePlatforms": [],
|
|
||||||
"excludePlatforms": [],
|
|
||||||
"allowUnsafeCode": false,
|
|
||||||
"overrideReferences": true,
|
|
||||||
"precompiledReferences": [
|
|
||||||
"nunit.framework.dll"
|
|
||||||
],
|
|
||||||
"autoReferenced": false,
|
|
||||||
"defineConstraints": [
|
|
||||||
"UNITY_INCLUDE_TESTS"
|
|
||||||
],
|
|
||||||
"versionDefines": [],
|
|
||||||
"noEngineReferences": false
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3ab67724d349675b1a6a9081eb70e62a
|
|
||||||
AssemblyDefinitionImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f6189f795d25322fa93a6fcde3bd4b2a
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -1,70 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using AsteroidGame.Entities;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using UnityEditor.SceneManagement;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
using UnityEngine.Serialization;
|
|
||||||
using UnityEngine.TestTools;
|
|
||||||
using Assert = UnityEngine.Assertions.Assert;
|
|
||||||
|
|
||||||
public class TurretTestScript : MonoBehaviour
|
|
||||||
{
|
|
||||||
[SerializeField] private List<Turret> _turrets;
|
|
||||||
[SerializeField] private EnemyBase _enemy;
|
|
||||||
|
|
||||||
[UnitySetUp]
|
|
||||||
public IEnumerator LoadScene()
|
|
||||||
{
|
|
||||||
// Load the scene asynchronously and wait until it's fully loaded
|
|
||||||
var asyncLoad = SceneManager.LoadSceneAsync("TurretTestScene");
|
|
||||||
while (!asyncLoad.isDone)
|
|
||||||
{
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_turrets = new();
|
|
||||||
_turrets = FindObjectsOfType<Turret>().ToList();
|
|
||||||
|
|
||||||
_enemy = new();
|
|
||||||
_enemy = FindObjectOfType<EnemyBase>();
|
|
||||||
}
|
|
||||||
|
|
||||||
// // A Test behaves as an ordinary method
|
|
||||||
// [Test]
|
|
||||||
// public void NewTestScriptSimplePasses()
|
|
||||||
// {
|
|
||||||
// // Use the Assert class to test conditions
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
|
||||||
// // `yield return null;` to skip a frame.
|
|
||||||
// [UnityTest]
|
|
||||||
// public IEnumerator NewTestScriptWithEnumeratorPasses()
|
|
||||||
// {
|
|
||||||
// // Use the Assert class to test conditions.
|
|
||||||
// // Use yield to skip a frame.
|
|
||||||
// yield return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
[UnityTest]
|
|
||||||
public IEnumerator OnlyOneTurretGetsTheKill()
|
|
||||||
{
|
|
||||||
var totalKillCount = 0;
|
|
||||||
if (_enemy != null)
|
|
||||||
{
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var turret in _turrets)
|
|
||||||
{
|
|
||||||
totalKillCount += turret.Kills;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert.IsTrue(totalKillCount == 1);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 565b0512bfe5540aebdda54c45668c3c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -12,9 +12,9 @@ namespace AsteroidGame.Entities
|
||||||
[SerializeField] private float _projectileSpeed = 5;
|
[SerializeField] private float _projectileSpeed = 5;
|
||||||
|
|
||||||
[field: Header("Stats")]
|
[field: Header("Stats")]
|
||||||
[field: SerializeField] public int Kills { get; set; }
|
[field: SerializeField] public float Kills { get; set; }
|
||||||
|
|
||||||
[field: SerializeField] public int DamageDealt { get; set; }
|
[field: SerializeField] public float DamageDealt { get; set; }
|
||||||
|
|
||||||
[field: Header("Weapon")]
|
[field: Header("Weapon")]
|
||||||
[field: SerializeField] public List<Weapon> Weapons { get; set; }
|
[field: SerializeField] public List<Weapon> Weapons { get; set; }
|
||||||
|
@ -73,7 +73,7 @@ namespace AsteroidGame.Entities
|
||||||
|
|
||||||
private void TurnOffWeapons()
|
private void TurnOffWeapons()
|
||||||
{
|
{
|
||||||
powerSystem.SetCurrentPower(0);
|
//powerSystem.SetCurrentPower(0);
|
||||||
foreach (var weapon in Weapons)
|
foreach (var weapon in Weapons)
|
||||||
{
|
{
|
||||||
weapon.FireWeapon = false;
|
weapon.FireWeapon = false;
|
||||||
|
|
Loading…
Reference in New Issue