Commit 3107c04d authored by Markus Schlösser's avatar Markus Schlösser

Cleaned up code

parent 1f34bea3
......@@ -5,7 +5,7 @@ using UnityEngine;
namespace Utilities {
[CustomPropertyDrawer(typeof(ScenePathAttribute))]
public class ScenePathAttributeDrawer : PropertyDrawer {
private const float FIX_BUTTON_WIDTH = 70.0f;
private const float FixButtonWidth = 70.0f;
private static SceneAsset GetSceneAsset(SerializedProperty property) {
return AssetDatabase.LoadAssetAtPath<SceneAsset>(property.stringValue);
......@@ -61,8 +61,8 @@ namespace Utilities {
float singleLineHeight = EditorGUIUtility.singleLineHeight;
Rect helpBox = new Rect(position.x, position.yMax - singleLineHeight, position.width - FIX_BUTTON_WIDTH, singleLineHeight);
Rect buttonRect = new Rect(position.xMax - FIX_BUTTON_WIDTH, position.yMax - singleLineHeight, FIX_BUTTON_WIDTH, singleLineHeight);
Rect helpBox = new Rect(position.x, position.yMax - singleLineHeight, position.width - FixButtonWidth, singleLineHeight);
Rect buttonRect = new Rect(position.xMax - FixButtonWidth, position.yMax - singleLineHeight, FixButtonWidth, singleLineHeight);
EditorGUI.HelpBox(helpBox, "Scene is not added to build settings", MessageType.Warning);
......
using System;
using UnityEngine;
using UnityEngine;
using UnityEngine.UI;
public class GameSelectButton : MonoBehaviour {
......@@ -14,7 +13,7 @@ public class GameSelectButton : MonoBehaviour {
}
public void Initialize(Game g) {
this.game = g;
game = g;
GetComponent<Image>().sprite = game.Sprite;
}
......
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
......
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
public class Cannon : MonoBehaviour {
......
......@@ -2,16 +2,11 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using Random = UnityEngine.Random;
public class Spawner : MonoBehaviour {
[Serializable]
private struct Enemy {
[SerializeField] public GameObject prefab;
[SerializeField] public AnimationCurve spawnRate;
}
private readonly Queue<Transform> waves = new Queue<Transform>();
[SerializeField] private Vector2 cellSize;
[SerializeField] private int rowSize;
......@@ -25,8 +20,6 @@ public class Spawner : MonoBehaviour {
private float halfRowSize;
private readonly Queue<Transform> waves = new Queue<Transform>();
private int CurrentRow => Mathf.FloorToInt((startHeight - transform.position.y) / cellSize.y);
private void Awake() {
......@@ -101,4 +94,10 @@ public class Spawner : MonoBehaviour {
rb.AddExplosionForce(Random.value * 50, origin, 100, 10, ForceMode.Impulse);
}
}
[Serializable]
private struct Enemy {
[SerializeField] public GameObject prefab;
[SerializeField] public AnimationCurve spawnRate;
}
}
fileFormatVersion: 2
guid: 9c1c935516563ed43aeb68261503ac8b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment