Refactor namespaces
This commit is contained in:
parent
4475fd4305
commit
3b865bbd13
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
public abstract class AIBehaviour : MonoBehaviour {
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
[Serializable]
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
[Serializable]
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
[Serializable]
|
||||
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI.Behaviours {
|
||||
public class Follow : AIBehaviour {
|
||||
|
@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI.Behaviours {
|
||||
public class MeleeAttackFollowed : AIBehaviour {
|
||||
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI.Behaviours {
|
||||
public class Wander : AIBehaviour {
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.AI;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
[RequireComponent(typeof(AI.Behaviours.Follow), typeof(AI.Triggers.EnemySighted))]
|
||||
public class EnemyFollower : MonoBehaviour {
|
||||
public AI.Behaviours.Follow Follow;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.AI;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
[RequireComponent(typeof(AI.Behaviours.Follow), typeof(AI.Triggers.PlayerSighted))]
|
||||
public class PlayerFollower : MonoBehaviour {
|
||||
public AI.Behaviours.Follow Follow;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI {
|
||||
public abstract class Trigger : MonoBehaviour {
|
||||
|
@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI.Triggers {
|
||||
public class EnemySighted : Trigger {
|
||||
|
@ -1,13 +1,15 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon.AI.Triggers {
|
||||
public class PlayerSighted : Trigger {
|
||||
public float Radius;
|
||||
public Player Player { get; private set; }
|
||||
public PlayerController Player { get; private set; }
|
||||
|
||||
public override bool IsTriggered(Enemy subject) {
|
||||
Player = Util.GetClosestTo<Player>(transform, Radius, true);
|
||||
Player = Util.GetClosestTo<PlayerController>(transform, Radius, true);
|
||||
return Player != null;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Effects {
|
||||
public class BloodDripper : MonoBehaviour {
|
||||
public Vector2 DripOffset = new Vector2(0, -0.5f);
|
||||
public int DripCount = 5;
|
||||
|
@ -1,8 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Effects {
|
||||
public class BloodLauncher : MonoBehaviour {
|
||||
private static BloodLauncher Singleton;
|
||||
public GameObject StructuralParticlePrefab;
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Effects {
|
||||
public class BloodParticle : MonoBehaviour {
|
||||
public SpriteRenderer Renderer;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Effects {
|
||||
public class CameraFX : MonoBehaviour {
|
||||
public Transform Player;
|
||||
public Transform ShakeHandle;
|
||||
|
@ -1,8 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Effects {
|
||||
public class Explodable : MonoBehaviour {
|
||||
public GameObject[] BodypartPrefabs;
|
||||
public bool DebugExplode = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.AI;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Enemies {
|
||||
[RequireComponent(typeof(Rigidbody2D))]
|
||||
public class Enemy : MonoBehaviour {
|
||||
[Header("Debug Info")]
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Enemies {
|
||||
public class EnemySpawner : MonoBehaviour {
|
||||
public GameObject[] EnemyPrefabs;
|
||||
public float SpawnCooldown = 5.0f;
|
||||
|
@ -1,8 +1,10 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
using Saltosion.OneWeapon.Effects;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Enemies {
|
||||
public class Health : MonoBehaviour {
|
||||
public float MaxHealth;
|
||||
public float CurrentHealth;
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Saltosion.OneWeapon.Menus {
|
||||
namespace Saltosion.OneWeapon.GUI {
|
||||
public class BackToMainMenuButton : MonoBehaviour {
|
||||
public int MainMenuScene;
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
|
||||
namespace Saltosion.OneWeapon.Menus {
|
||||
namespace Saltosion.OneWeapon.GUI {
|
||||
public class GoreToggler : MonoBehaviour {
|
||||
public GameObject GoreObject;
|
||||
public GameObject CensoredObject;
|
||||
|
@ -2,8 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.GUI {
|
||||
public class HUDController : MonoBehaviour {
|
||||
|
||||
public PlayerFun PlayerFun;
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Saltosion.OneWeapon.Menus {
|
||||
namespace Saltosion.OneWeapon.GUI {
|
||||
public class MainMenuController : MonoBehaviour {
|
||||
public int PlayGameScene;
|
||||
public int OptionsMenuScene;
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Guns {
|
||||
public class Bullet : MonoBehaviour {
|
||||
|
||||
public Vector2 Direction;
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Guns {
|
||||
public class Gun : MonoBehaviour {
|
||||
|
||||
public Bullet Bullet;
|
||||
@ -24,7 +24,7 @@ namespace Saltosion.OneWeapon {
|
||||
if (IsHeld) {
|
||||
return;
|
||||
}
|
||||
Player Player = collider.GetComponent<Player>();
|
||||
PlayerController Player = collider.GetComponent<PlayerController>();
|
||||
if (Player != null) {
|
||||
IsHeld = true;
|
||||
Player.SetGun(this);
|
||||
|
@ -1,8 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Player;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
using Saltosion.OneWeapon.Effects;
|
||||
|
||||
namespace Saltosion.OneWeapon.Bullets {
|
||||
namespace Saltosion.OneWeapon.Guns {
|
||||
[RequireComponent(typeof(Bullet))]
|
||||
public class RevolverBullet : MonoBehaviour {
|
||||
|
||||
@ -32,7 +35,7 @@ namespace Saltosion.OneWeapon.Bullets {
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
if (collider.GetComponent<Player>() != null) {
|
||||
if (collider.GetComponent<PlayerController>() != null) {
|
||||
// don't hit the player!
|
||||
return;
|
||||
}
|
||||
|
@ -4,9 +4,10 @@ using UnityEngine;
|
||||
using UnityEngine.Animations;
|
||||
using Saltosion.OneWeapon.Effects;
|
||||
using Saltosion.OneWeapon.Utils;
|
||||
using Saltosion.OneWeapon.Guns;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
public class Player : MonoBehaviour {
|
||||
namespace Saltosion.OneWeapon.Player {
|
||||
public class PlayerController : MonoBehaviour {
|
||||
|
||||
public Rigidbody2D Body;
|
||||
public Transform Hand;
|
@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Player {
|
||||
public class PlayerFun : MonoBehaviour {
|
||||
|
||||
public Player Player;
|
||||
public PlayerController Player;
|
||||
|
||||
public float MaxFun = 100;
|
||||
public float FunDegradeSpeed = 5;
|
||||
|
@ -1,8 +1,10 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Saltosion.OneWeapon.Enemies;
|
||||
using Saltosion.OneWeapon.Effects;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Player {
|
||||
public class PunchingHand : MonoBehaviour {
|
||||
|
||||
public bool Punching = false;
|
||||
|
@ -36,4 +36,4 @@ namespace Saltosion.OneWeapon.Utils {
|
||||
Bobbing.BobbingMultiplier = SpeedPercentage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Utils {
|
||||
public class CameraHelper : MonoBehaviour {
|
||||
public Camera Camera;
|
||||
[Range(1, 4)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Saltosion.OneWeapon {
|
||||
namespace Saltosion.OneWeapon.Utils {
|
||||
public class Options {
|
||||
public static bool CensorGore = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user