slimecing

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 80025e55bd93be346eb023d467aecb30b191afbd
parent a498741b57562fbbc5aa01bf9909d3dd73eb1a31
Author: PlutoTank <qwolkensperg@gmail.com>
Date:   Tue, 14 Apr 2020 19:19:58 -0400

fixing merge flags

Diffstat:
MAssets/Scripts/Slimecing/Abilities/Ability.cs | 43-------------------------------------------
MAssets/Scripts/Slimecing/Abilities/AbilityEffects/AbilityEffect.cs | 25+------------------------
MAssets/Scripts/Slimecing/Abilities/AbilityEffects/DashAbilityEffect.cs | 33+--------------------------------
MAssets/Scripts/Slimecing/Abilities/AbilityEffects/JumpAbilityEffect.cs | 1+
MAssets/Scripts/Slimecing/Abilities/AbilityEffects/SimpleJumpAbilityEffect.cs | 3++-
MAssets/Scripts/Slimecing/Abilities/AbilityEffects/TimedAbilityEffect.cs | 20++------------------
MAssets/Scripts/Slimecing/Abilities/AbilityPackage.cs | 7++-----
MAssets/Scripts/Slimecing/Abilities/CooldownData.cs | 71++++++++++++++++++++++++++++++-----------------------------------------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities.meta | 8--------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs | 29-----------------------------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs.meta | 11-----------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs | 14--------------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs.meta | 11-----------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs | 16----------------
DAssets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs.meta | 11-----------
MAssets/Scripts/Slimecing/Abilities/UseAbilities/DashAbility.cs | 2+-
MAssets/Scripts/Slimecing/Abilities/UseAbilities/JumpAbility.cs | 3+--
MAssets/Scripts/Slimecing/Abilities/UseAbilities/TestAbility.cs | 2+-
MAssets/Scripts/Slimecing/Abilities/UseAbilities/VoidAbility.cs | 2+-
MAssets/Scripts/Slimecing/Camera/CameraControllerNew.cs | 41+----------------------------------------
MAssets/Scripts/Slimecing/Characters/AbilityUser.cs | 81++++++-------------------------------------------------------------------------
MAssets/Scripts/Slimecing/Characters/CharacterMovementController.cs | 86++++---------------------------------------------------------------------------
MAssets/Scripts/Slimecing/Characters/SlimeMovementController.cs | 19+------------------
MAssets/Scripts/Slimecing/Characters/SlopeCharacter.cs | 1-
MAssets/Scripts/Slimecing/Dependency/Timer.cs | 61+------------------------------------------------------------
MAssets/Scripts/Slimecing/InputSystem/PlayerInput.cs | 8+++-----
MAssets/Scripts/Slimecing/InputSystem/SlimeControls.cs | 158+------------------------------------------------------------------------------
MAssets/Scripts/Slimecing/InputSystem/SlimeInput.cs | 3+--
MAssets/Scripts/Slimecing/MainScripts(old)/SwordScript.cs | 21---------------------
MAssets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/RotatableLogic.cs | 21---------------------
MAssets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/SimpleRotatableLogicSO.cs | 4----
MAssets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/TorqueRotatableLogicSO.cs | 24+-----------------------
MAssets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable.cs | 34+---------------------------------
MAssets/Scripts/Slimecing/SimpleComponents/TimerBehaviour.cs | 2+-
MAssets/Scripts/Slimecing/StateMachine/StateChangers/InputCondition.cs | 6------
MAssets/Scripts/Slimecing/StateMachine/StateChangers/UsingAbilityCondition.cs | 9+--------
MProjectSettings/ProjectSettings.asset | 11++++++++++-
37 files changed, 76 insertions(+), 826 deletions(-)

diff --git a/Assets/Scripts/Slimecing/Abilities/Ability.cs b/Assets/Scripts/Slimecing/Abilities/Ability.cs @@ -1,11 +1,6 @@ -<<<<<<< HEAD -using Slimecing.Character; using System; -======= -using System; using Slimecing.Characters; using Slimecing.Triggers; ->>>>>>> Added triggers and lots of backend using UnityEngine; namespace Slimecing.Abilities @@ -16,24 +11,6 @@ namespace Slimecing.Abilities [SerializeField] protected string abilityName = "REPLACE ABILITY NAME"; [SerializeField] private string abilityDescription = "REPLACE ABILITY DESCRIPTION"; [SerializeField] protected float abilityCooldown = 1f; -<<<<<<< HEAD - [SerializeField] private AudioClip abilitySound; - [SerializeField] private string abilityButton = "Void"; - - private enum CooldownState - { - FirstTimeUse, - HasAnotherUse, - OnCooldown - } - - public string AbilityButton => abilityButton; - public abstract void Use(AbilityUser aUser); - public virtual void Initialize(AbilityUser aUser) { } - public virtual void StartAbility(AbilityUser aUser) - { - //Debug.Log(User.name + " started " + abilityName); -======= [SerializeField] protected AudioClip abilitySound; [SerializeField] private Trigger abilityTrigger = null; public virtual void CheckActivation(AbilityUser aUser, InputTriggerPackage abilityTriggerPackage) @@ -65,7 +42,6 @@ namespace Slimecing.Abilities public void StartAbility(AbilityUser aUser) { ->>>>>>> Added triggers and lots of backend switch (CanUse(aUser)) { case CooldownState.FirstTimeUse: @@ -84,21 +60,11 @@ namespace Slimecing.Abilities { aUser.AddAbilityOnCooldown(new CooldownData(this, abilityCooldown)); } - -<<<<<<< HEAD - private CooldownState CanUse(AbilityUser aUser) -======= protected CooldownState CanUse(AbilityUser aUser) ->>>>>>> Added triggers and lots of backend { Ability coolinAbility = null; CooldownData coolinAbilityObject = null; - -<<<<<<< HEAD - foreach (var cooldownData in aUser.AbilitiesOnCooldown) -======= foreach (var cooldownData in aUser.abilitiesOnCooldown) ->>>>>>> Added triggers and lots of backend { if (cooldownData.GetAbility != this) continue; coolinAbility = cooldownData.GetAbility; @@ -107,14 +73,6 @@ namespace Slimecing.Abilities } if (ReferenceEquals(coolinAbility, null)) return CooldownState.FirstTimeUse; -<<<<<<< HEAD - if (coolinAbilityObject.UseAmount > 0) - { - coolinAbilityObject.SubUseAmount(); - return CooldownState.HasAnotherUse; - } - return CooldownState.OnCooldown; -======= if (coolinAbilityObject.UseAmount <= 0) return CooldownState.OnCooldown; coolinAbilityObject.SubUseAmount(); return CooldownState.HasAnotherUse; @@ -123,7 +81,6 @@ namespace Slimecing.Abilities private void EndAbility() { AbilityTrigger.currentTriggerState = TriggerState.Canceled; ->>>>>>> Added triggers and lots of backend } } } diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityEffects/AbilityEffect.cs b/Assets/Scripts/Slimecing/Abilities/AbilityEffects/AbilityEffect.cs @@ -1,32 +1,10 @@ -<<<<<<< HEAD -using UnityEngine; -======= -using Slimecing.Characters; +using Slimecing.Characters; using UnityEngine; ->>>>>>> Added triggers and lots of backend namespace Slimecing.Abilities.AbilityEffects { public abstract class AbilityEffect { -<<<<<<< HEAD - protected bool doesUpdate; - - private GameObject obj; - private Ability ability; - - public bool DoesUpdate => doesUpdate; - - public AbilityEffect(Ability ability, GameObject obj) - { - this.ability = ability; - this.obj = obj; - } - - public void UpdateEffect() - { - DoUpdate(); -======= public abstract bool DoesUpdate(); private AbilityUser aUser; @@ -36,7 +14,6 @@ namespace Slimecing.Abilities.AbilityEffects { this.ability = ability; this.aUser = aUser; ->>>>>>> Added triggers and lots of backend } public abstract void Activate(); diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityEffects/DashAbilityEffect.cs b/Assets/Scripts/Slimecing/Abilities/AbilityEffects/DashAbilityEffect.cs @@ -1,26 +1,11 @@ -<<<<<<< HEAD -using Slimecing.Character; +using Slimecing.Abilities.UseAbilities; using Slimecing.Characters; -======= -using Slimecing.Characters; ->>>>>>> Added triggers and lots of backend using UnityEngine; namespace Slimecing.Abilities.AbilityEffects { public class DashAbilityEffect : TimedAbilityEffect { -<<<<<<< HEAD - private DashAbility dashAbility; - private GameObject character; - private CharacterMovementController characterMovementController; - - public DashAbilityEffect(float duration, Ability ability, GameObject obj) : base(duration, ability, obj) - { - character = obj; - characterMovementController = obj.GetComponent<CharacterMovementController>(); - dashAbility = (DashAbility) ability; -======= private DashAbility _ability; private readonly AbilityUser _aUser; private readonly CharacterMovementController _characterMovementController; @@ -33,25 +18,10 @@ namespace Slimecing.Abilities.AbilityEffects _characterMovementController = controller; _dashForce = dashForce; _ability = (DashAbility) ability; ->>>>>>> Added triggers and lots of backend } public override void Activate() { -<<<<<<< HEAD - Vector3 dashDir = character.transform.forward; - if (characterMovementController.MoveInput != Vector2.zero) - { - Vector2 moveInputDir = characterMovementController.MoveInput; - dashDir = new Vector3(moveInputDir.x, 0, moveInputDir.y); - } - - characterMovementController.AddForceTo(dashDir, dashAbility.DashForce); - } - public override void End() - { - characterMovementController.SetBackToNormalForces(); -======= Vector3 dashDir = _aUser.transform.forward; if (_characterMovementController.MoveInput != Vector2.zero) { @@ -64,7 +34,6 @@ namespace Slimecing.Abilities.AbilityEffects public override void End() { _characterMovementController.SetBackToNormalForces(); ->>>>>>> Added triggers and lots of backend } } } diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityEffects/JumpAbilityEffect.cs b/Assets/Scripts/Slimecing/Abilities/AbilityEffects/JumpAbilityEffect.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Slimecing.Abilities.UseAbilities; using UnityEngine; namespace Slimecing.Abilities.AbilityEffects diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityEffects/SimpleJumpAbilityEffect.cs b/Assets/Scripts/Slimecing/Abilities/AbilityEffects/SimpleJumpAbilityEffect.cs @@ -1,4 +1,5 @@ -using Slimecing.Characters; +using Slimecing.Abilities.UseAbilities; +using Slimecing.Characters; using UnityEngine; namespace Slimecing.Abilities.AbilityEffects diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityEffects/TimedAbilityEffect.cs b/Assets/Scripts/Slimecing/Abilities/AbilityEffects/TimedAbilityEffect.cs @@ -1,37 +1,21 @@ -<<<<<<< HEAD -using UnityEngine; -======= -using Slimecing.Characters; +using Slimecing.Characters; using UnityEngine; ->>>>>>> Added triggers and lots of backend namespace Slimecing.Abilities.AbilityEffects { public abstract class TimedAbilityEffect { protected float duration; -<<<<<<< HEAD - protected GameObject obj; -======= protected AbilityUser aUser; ->>>>>>> Added triggers and lots of backend protected Ability ability; public bool IsDone => duration <= 0; - -<<<<<<< HEAD - public TimedAbilityEffect(float duration, Ability ability, GameObject obj) - { - this.duration = duration; - this.ability = ability; - this.obj = obj; -======= + public TimedAbilityEffect(float duration, Ability ability, AbilityUser aUser) { this.duration = duration; this.ability = ability; this.aUser = aUser; ->>>>>>> Added triggers and lots of backend } public void Tick(float delta) diff --git a/Assets/Scripts/Slimecing/Abilities/AbilityPackage.cs b/Assets/Scripts/Slimecing/Abilities/AbilityPackage.cs @@ -1,8 +1,5 @@ -<<<<<<< HEAD -using Slimecing.Character; -======= -using Slimecing.Characters; ->>>>>>> Added triggers and lots of backend +using Slimecing.Characters; + namespace Slimecing.Abilities { [System.Serializable] public class AbilityPackage diff --git a/Assets/Scripts/Slimecing/Abilities/CooldownData.cs b/Assets/Scripts/Slimecing/Abilities/CooldownData.cs @@ -1,48 +1,37 @@ -using System; -using Slimecing.Abilities; -using UnityEngine; - -[System.Serializable] -public class CooldownData +namespace Slimecing.Abilities { - private Ability ability; - private float cooldown; - private int useAmount = 0; - -<<<<<<< HEAD - //COPY PASTED CODE FROM TIMEDABILITYEFFECT - //SINGLE RESPONSIBILITY!!! -======= ->>>>>>> Added triggers and lots of backend - public Ability GetAbility => ability; - public int UseAmount => useAmount; - public bool IsCoolin => cooldown > 0 || useAmount > 0; //? true : false; - - public CooldownData(Ability ability, float cooldown) + [System.Serializable] + public class CooldownData { - this.ability = ability; - this.cooldown = cooldown; - } + private Ability ability; + private float cooldown; + private int useAmount = 0; + public Ability GetAbility => ability; + public int UseAmount => useAmount; + public bool IsCoolin => cooldown > 0 || useAmount > 0; //? true : false; - public CooldownData (Ability ability, float cooldown, int useAmount) - { - this.ability = ability; - this.cooldown = cooldown; - this.useAmount = useAmount - 1; - } + public CooldownData(Ability ability, float cooldown) + { + this.ability = ability; + this.cooldown = cooldown; + } -<<<<<<< HEAD - //COPY PASTED CODE FROM TIMEDABILITYEFFECT -======= ->>>>>>> Added triggers and lots of backend - public void TickCooldown(float delta) - { - if (useAmount > 0) return; - cooldown -= delta; + public CooldownData (Ability ability, float cooldown, int useAmount) + { + this.ability = ability; + this.cooldown = cooldown; + this.useAmount = useAmount - 1; + } + + public void TickCooldown(float delta) + { + if (useAmount > 0) return; + cooldown -= delta; - } - public void SubUseAmount() - { - useAmount -= 1; + } + public void SubUseAmount() + { + useAmount -= 1; + } } } diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities.meta b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities.meta @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 42571e33eb80e074e90eff871ff1f9e7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs @@ -1,28 +0,0 @@ -using Slimecing.Abilities.AbilityEffects; -using UnityEngine; -using Slimecing.Character; - -namespace Slimecing.Abilities -{ - [CreateAssetMenu(fileName = "DashAbility", menuName = "Abilities/DashAbility")] - public class DashAbility : Ability - { - [SerializeField] private float dashForce; - [SerializeField] private float dashLength; - [SerializeField] private int dashUseAmount; - - public float DashForce { get { return dashForce; } } - public float DashLength { get { return dashLength; } } - - protected override void PutOnCooldown(AbilityUser aUser) - { - aUser.AddAbilityOnCooldown(new CooldownData(this, abilityCooldown, dashUseAmount)); - } - - public override void Use(AbilityUser aUser) - { - //Debug.Log(aUser.name + " used " + abilityName); - aUser.AddTimedAbilityEffect(new DashAbilityEffect(dashLength, this, aUser.gameObject)); - } - } -}- \ No newline at end of file diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs.meta b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/DashAbility.cs.meta @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f90b5b947dd31dc4983255a160ba883a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs @@ -1,14 +0,0 @@ -using Slimecing.Character; -using UnityEngine; - -namespace Slimecing.Abilities -{ - [CreateAssetMenu(fileName = "TestAbility", menuName = "Abilities/TestAbility")] - public class TestAbility : Ability - { - public override void Use(AbilityUser aUser) - { - Debug.Log(aUser.name + " used " + abilityName); - } - } -} diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs.meta b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/TestAbility.cs.meta @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fe984ff99561db447a20f8160a4e76a5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs @@ -1,16 +0,0 @@ -using Slimecing.Character; -using UnityEngine; - -namespace Slimecing.Abilities -{ - public class VoidAbility : Ability - { - public override void Initialize(AbilityUser aUser) - { - base.Initialize(aUser); - abilityName = "Void Ability"; - Debug.LogWarning(aUser.name + " added a void ability"); - } - public override void Use(AbilityUser aUser) { } - } -} diff --git a/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs.meta b/Assets/Scripts/Slimecing/Abilities/SlimeAbilities/VoidAbility.cs.meta @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 994e61c7aaa46024fafe8e0f5fccae73 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Slimecing/Abilities/UseAbilities/DashAbility.cs b/Assets/Scripts/Slimecing/Abilities/UseAbilities/DashAbility.cs @@ -2,7 +2,7 @@ using Slimecing.Characters; using UnityEngine; -namespace Slimecing.Abilities +namespace Slimecing.Abilities.UseAbilities { [CreateAssetMenu(fileName = "DashAbility", menuName = "Abilities/DashAbility")] public class DashAbility : Ability diff --git a/Assets/Scripts/Slimecing/Abilities/UseAbilities/JumpAbility.cs b/Assets/Scripts/Slimecing/Abilities/UseAbilities/JumpAbility.cs @@ -1,11 +1,10 @@ using System; using Slimecing.Abilities.AbilityEffects; using Slimecing.Characters; -using Slimecing.SOEventSystem.Events; using Slimecing.Triggers; using UnityEngine; -namespace Slimecing.Abilities +namespace Slimecing.Abilities.UseAbilities { [CreateAssetMenu(fileName = "JumpAbility", menuName = "Abilities/JumpAbility")] public class JumpAbility : Ability diff --git a/Assets/Scripts/Slimecing/Abilities/UseAbilities/TestAbility.cs b/Assets/Scripts/Slimecing/Abilities/UseAbilities/TestAbility.cs @@ -1,7 +1,7 @@ using Slimecing.Characters; using UnityEngine; -namespace Slimecing.Abilities +namespace Slimecing.Abilities.UseAbilities { [CreateAssetMenu(fileName = "TestAbility", menuName = "Abilities/TestAbility")] public class TestAbility : Ability diff --git a/Assets/Scripts/Slimecing/Abilities/UseAbilities/VoidAbility.cs b/Assets/Scripts/Slimecing/Abilities/UseAbilities/VoidAbility.cs @@ -1,7 +1,7 @@ using Slimecing.Characters; using UnityEngine; -namespace Slimecing.Abilities +namespace Slimecing.Abilities.UseAbilities { public class VoidAbility : Ability { diff --git a/Assets/Scripts/Slimecing/Camera/CameraControllerNew.cs b/Assets/Scripts/Slimecing/Camera/CameraControllerNew.cs @@ -9,20 +9,7 @@ namespace Slimecing.Camera public float zoomLimit = 50f; public float minZoom = 40f; public float maxZoom = 10f; -<<<<<<< HEAD - - public float maxDistanceFromOtherPlayers = 70; - [HideInInspector] public List<Transform> visibleThings = new List<Transform>(); - //private List<Transform> unSeenPlayers = new List<Transform>(); - //private List<float> localDistances = new List<float>(); - private UnityEngine.Camera _cCamera; - private Vector3 _cameraVelocity; - - private int _numberPlayers; - - public Vector3 offset; -======= public float maxDistanceFromOtherPlayers = 70; private List<Transform> visibleThings = new List<Transform>(); @@ -34,8 +21,7 @@ namespace Slimecing.Camera public Vector3 offset; public List<Transform> VisibleThings { get => visibleThings; set => visibleThings = value; } - ->>>>>>> Added triggers and lots of backend + private void Awake() { _cCamera = GetComponent<UnityEngine.Camera>(); @@ -53,20 +39,12 @@ namespace Slimecing.Camera private Vector3 GetCenterPoint() { -<<<<<<< HEAD - switch (visibleThings.Count) -======= switch (VisibleThings.Count) ->>>>>>> Added triggers and lots of backend { case 0: return Vector3.zero; case 1: -<<<<<<< HEAD - return visibleThings[0].position; -======= return VisibleThings[0].position; ->>>>>>> Added triggers and lots of backend default: return FindBoundsAndSetBounds().center; } @@ -79,23 +57,14 @@ namespace Slimecing.Camera private Bounds FindBoundsAndSetBounds() { -<<<<<<< HEAD - if (visibleThings.Count == 0) -======= if (VisibleThings.Count == 0) ->>>>>>> Added triggers and lots of backend { Bounds zeroBounds = new Bounds(Vector3.zero, Vector3.zero); return zeroBounds; } -<<<<<<< HEAD - Bounds playerBounds = new Bounds(visibleThings[0].position, Vector3.zero); - foreach (var thing in visibleThings) -======= Bounds playerBounds = new Bounds(VisibleThings[0].position, Vector3.zero); foreach (var thing in VisibleThings) ->>>>>>> Added triggers and lots of backend { playerBounds.Encapsulate(thing.position); } @@ -104,19 +73,11 @@ namespace Slimecing.Camera public void AddToCameraList(GameObject thing) { -<<<<<<< HEAD - visibleThings.Add(thing.transform); - } - public void RemoveFromCameraList(GameObject thing) - { - visibleThings.Remove(thing.transform); -======= VisibleThings.Add(thing.transform); } public void RemoveFromCameraList(GameObject thing) { VisibleThings.Remove(thing.transform); ->>>>>>> Added triggers and lots of backend } } } diff --git a/Assets/Scripts/Slimecing/Characters/AbilityUser.cs b/Assets/Scripts/Slimecing/Characters/AbilityUser.cs @@ -1,39 +1,15 @@ -<<<<<<< HEAD -using System.Collections; using System.Collections.Generic; -using UnityEngine; -using Slimecing.Abilities; -using System; -using Slimecing.Abilities.AbilityEffects; - -namespace Slimecing.Character -======= -using System.Collections.Generic; using System.Linq; using Slimecing.Abilities; using Slimecing.Abilities.AbilityEffects; -using Slimecing.SOEventSystem.Events; +using Slimecing.Abilities.UseAbilities; using UnityEngine; -using UnityEngine.InputSystem; namespace Slimecing.Characters ->>>>>>> Added triggers and lots of backend { //LOOKING LIKE THERE IS TOO MANY FUNCTIONS LOOK INTO SPLITTING UP. Maybe needs interface ICooldownUser, IAbilityEffectUser public class AbilityUser : MonoBehaviour { -<<<<<<< HEAD - [SerializeField] private List<AbilityPackage> useableAbilities = new List<AbilityPackage>(); - - List<TimedAbilityEffect> currentTimedAbilityEffects = new List<TimedAbilityEffect>(); - private List<CooldownData> abilitiesOnCooldown = new List<CooldownData>(); - private List<AbilityEffect> currentAbilityEffects = new List<AbilityEffect>(); - - public IEnumerable<CooldownData> AbilitiesOnCooldown => abilitiesOnCooldown; - - private void Awake() - { -======= //[SerializeField] private CharacterMovementController controller; //public CharacterMovementController Controller { get { return controller; } } @@ -50,7 +26,6 @@ namespace Slimecing.Characters private void Awake() { Audio = GetComponent<AudioSource>(); ->>>>>>> Added triggers and lots of backend //Repeated code needs to be fixed! if (useableAbilities.Count != 0) { @@ -67,18 +42,10 @@ namespace Slimecing.Characters } } } -<<<<<<< HEAD - - private void Update() - { - GetAbilityInput(); - CheckAbilitiesOnCooldown(); -======= private void Update() { CheckAbilitiesOnCooldown(); CheckAbilityEffects(); ->>>>>>> Added triggers and lots of backend CheckTimedAbilityEffects(); } @@ -86,29 +53,7 @@ namespace Slimecing.Characters { return currentAbilityEffects.Count != 0 || currentTimedAbilityEffects.Count != 0; } -<<<<<<< HEAD - - - //USE INPUT MANAGER - private void GetAbilityInput() - { - if (useableAbilities.Count == 0) return; - foreach (var abilities in useableAbilities) - { - CheckAbility(abilities); - if (Input.GetButtonDown(abilities.ability.AbilityButton)) - { - abilities.ability.StartAbility(this); - } - } - } - -======= - private void DoAbilityAction(Ability ability) - { - ability.StartAbility(this); - } ->>>>>>> Added triggers and lots of backend + private void CheckTimedAbilityEffects() { for (int i = currentTimedAbilityEffects.Count - 1; i >= 0; i--) @@ -120,9 +65,7 @@ namespace Slimecing.Characters } } } - -<<<<<<< HEAD -======= + private void CheckAbilityEffects() { for (int i = currentAbilityEffects.Count - 1; i >= 0; i--) @@ -133,8 +76,7 @@ namespace Slimecing.Characters } } } - ->>>>>>> Added triggers and lots of backend + private void CheckAbilitiesOnCooldown() { //COPY PASTED CODE FROM CHECKTIMEDABILITY EFFECTS! SINGLE RESPONSIBLILITY @@ -151,12 +93,8 @@ namespace Slimecing.Characters //Something feels wrong about this there might be a better way. Put in ability processor (struct) private void CheckAbility(AbilityPackage abilityPack) { -<<<<<<< HEAD - if (ReferenceEquals(abilityPack.ability, null)) -======= Ability ability = abilityPack.ability; if (ReferenceEquals(ability, null)) ->>>>>>> Added triggers and lots of backend { //Make a void factory that dishes out void objects/ classes and stuff //it is slow to create an instance of an object ~13ms maybe make an IAbility and make a void that @@ -166,10 +104,6 @@ namespace Slimecing.Characters { abilityPack.Initialize(this); } -<<<<<<< HEAD - -======= ->>>>>>> Added triggers and lots of backend } //CHANGE THESE THREE METHODS TO SCRIPTIBLEOBJECT EVENTS @@ -199,9 +133,7 @@ namespace Slimecing.Characters { abilitiesOnCooldown.Add(cooldownData); } - -<<<<<<< HEAD -======= + public AbilityEffect GetAbilityEffect(AbilityEffect abilityEffect) { return currentAbilityEffects.FirstOrDefault(effect => effect.Equals(abilityEffect)); @@ -211,8 +143,7 @@ namespace Slimecing.Characters { return currentTimedAbilityEffects.FirstOrDefault(effect => effect.Equals(timedAbilityEffect)); } - ->>>>>>> Added triggers and lots of backend + public void AddAbility(Ability ability) { foreach (var abilities in useableAbilities) diff --git a/Assets/Scripts/Slimecing/Characters/CharacterMovementController.cs b/Assets/Scripts/Slimecing/Characters/CharacterMovementController.cs @@ -1,9 +1,5 @@ -<<<<<<< HEAD -using Slimecing.SimpleComponents.Movement; -======= -using System; +using System; using Slimecing.SimpleComponents.Movement; ->>>>>>> Added triggers and lots of backend using UnityEngine; namespace Slimecing.Characters @@ -13,32 +9,6 @@ namespace Slimecing.Characters [RequireComponent(typeof(Collider))] public abstract class CharacterMovementController : MonoBehaviour { -<<<<<<< HEAD - [SerializeField] protected float movementSpeed; - [SerializeField] protected Vector3 gravityDirection = Vector3.down; - [SerializeField] protected float gravityForce; - [SerializeField] protected float simulatedMass; - [SerializeField] protected float groundDistance; - [SerializeField] protected float slopeDistance; - [SerializeField] protected float maxAngle; - [SerializeField] protected float minVelocityMagnitude; - - protected Rigidbody rb; - protected Rotatable rotatable; - protected Vector2 move; - protected Vector3 calculatedGravity; - protected bool isGrounded; - - private Collider _collider; - [SerializeField] private LayerMask groundLayerMask; - - public Vector2 MoveInput => move; - protected void Awake() - { - _collider = GetComponent<Collider>(); - rb = GetComponent<Rigidbody>(); - rotatable = GetComponent<Rotatable>(); -======= [Header("Components")] [SerializeField] protected Rigidbody rb; public Rigidbody PlayerRigidbody => rb; @@ -101,7 +71,6 @@ namespace Slimecing.Characters protected void Awake() { ->>>>>>> Added triggers and lots of backend calculatedGravity = gravityDirection * gravityForce; } @@ -112,14 +81,7 @@ namespace Slimecing.Characters { rb.AddForce(direction.normalized * amount, ForceMode.Impulse); } - -<<<<<<< HEAD - private void Update() - { - isGrounded = Grounded(gravityDirection, groundDistance); - var position = transform.position; - Debug.DrawLine(position, position + slopeDistance * 2 * Forward(), Color.magenta); -======= + private void OnDrawGizmos() { Gizmos.color = Color.cyan; @@ -135,37 +97,25 @@ namespace Slimecing.Characters Debug.DrawLine(transform.position, transform.position + PlayerUpVector() * 2, Color.cyan); Debug.DrawLine(transform.position, transform.position + Forward() * 2, Color.yellow); ->>>>>>> Added triggers and lots of backend } protected virtual void FixedUpdate() { -<<<<<<< HEAD -======= GroundCheck(groundProbingDistance, groundingSphereCastRadius); - ->>>>>>> Added triggers and lots of backend + float deltaTime = Time.deltaTime; Rotate(deltaTime); Move(deltaTime); -<<<<<<< HEAD - - if (!isGrounded) rb.AddForce(simulatedMass * calculatedGravity); -======= if (!_isGrounded && useGravity) rb.AddForce(simulatedFallingMass * calculatedGravity); ->>>>>>> Added triggers and lots of backend if (rb.velocity.magnitude < minVelocityMagnitude) { rb.velocity = Vector3.zero; } -<<<<<<< HEAD -======= _isGrounded = false; ->>>>>>> Added triggers and lots of backend } protected abstract void Move(float deltaTime); @@ -174,16 +124,6 @@ namespace Slimecing.Characters public float GetGroundAngle() { -<<<<<<< HEAD - if (!isGrounded) return 90f; - return Vector3.Angle(SlopeCheck(gravityDirection, slopeDistance).normal, transform.forward); - } - - protected Vector3 Forward() - { - if (!isGrounded) return transform.forward; - return Vector3.Cross(transform.right, SlopeCheck(gravityDirection, slopeDistance).normal); -======= if (!_isGrounded) return 90f; return Vector3.Angle(_internalGroundHit.normal, transform.forward); } @@ -204,29 +144,12 @@ namespace Slimecing.Characters if (!_isGrounded) return transform.forward; if (_internalSlopeHit.transform == null) return transform.forward; return Vector3.Cross(transform.right, _internalSlopeHit.normal); ->>>>>>> Added triggers and lots of backend } public void SetBackToNormalForces() { rb.velocity = new Vector3(move.x * movementSpeed, rb.velocity.y, move.y * movementSpeed); } -<<<<<<< HEAD - public bool Grounded(Vector3 direction, float length) - { - return Physics.CheckSphere(transform.position, length, groundLayerMask, QueryTriggerInteraction.Ignore); - } - - public RaycastHit SlopeCheck(Vector3 direction, float length) - { - RaycastHit hit; - Physics.Raycast(transform.position, direction, out hit, length, groundLayerMask, - QueryTriggerInteraction.Ignore); - return hit; - } - private bool ValidateColliderForCollisions(Collider coll) - { - return coll != null && coll != _collider; -======= + public void GroundCheck(float length, float radius) { var ray = @@ -382,7 +305,6 @@ namespace Slimecing.Characters } return false; ->>>>>>> Added triggers and lots of backend } } diff --git a/Assets/Scripts/Slimecing/Characters/SlimeMovementController.cs b/Assets/Scripts/Slimecing/Characters/SlimeMovementController.cs @@ -1,10 +1,4 @@ -<<<<<<< HEAD -using Slimecing.Character; -using Slimecing.SimpleComponents.Movement; using UnityEngine; -======= -using UnityEngine; ->>>>>>> Added triggers and lots of backend namespace Slimecing.Characters { @@ -16,18 +10,12 @@ namespace Slimecing.Characters protected override void Move(float deltaTime) { if (move == Vector2.zero && rb.velocity == Vector3.zero) return; - -<<<<<<< HEAD - bool grounded = Grounded(calculatedGravity, groundDistance); - Vector3 moveInputVector = new Vector3(move.x, 0, move.y).normalized; - Vector3 up = transform.up; -======= bool grounded = IsGrounded(); Vector3 moveInputVector = new Vector3(move.x, 0, move.y).normalized; Vector3 up = PlayerUpVector(); ->>>>>>> Added triggers and lots of backend + Vector3 velocity = rb.velocity; Vector3 inputRight = Vector3.Cross(moveInputVector, up); @@ -45,12 +33,7 @@ namespace Slimecing.Characters protected override void Rotate(float deltaTime) { - -<<<<<<< HEAD - rotatable.RotateToVector(new Vector3(move.x, 0 , move.y), deltaTime); -======= rotatable.RotateToVector(transform, new Vector3(move.x, 0 , move.y), deltaTime); ->>>>>>> Added triggers and lots of backend } public override void GetMoveInputH(float h) diff --git a/Assets/Scripts/Slimecing/Characters/SlopeCharacter.cs b/Assets/Scripts/Slimecing/Characters/SlopeCharacter.cs @@ -1,5 +1,4 @@ using System; -using Slimecing.Character; using UnityEngine; namespace Slimecing.Characters diff --git a/Assets/Scripts/Slimecing/Dependency/Timer.cs b/Assets/Scripts/Slimecing/Dependency/Timer.cs @@ -1,67 +1,9 @@ -<<<<<<< HEAD using System; -======= -using System; ->>>>>>> Added triggers and lots of backend namespace Slimecing.Dependency { public class Timer { -<<<<<<< HEAD - public float RemainingSec { get; private set; } - public float TrueDuration { get; private set; } - public float RemainingLoop { get; private set; } - public bool LoopInf { get; private set; } - - public event Action OnTimerEnd; - - public Timer(float duration) - { - RemainingSec = duration; - } - - public Timer(float duration, float loopfor, bool li) - { - RemainingSec = duration; - TrueDuration = duration; - RemainingLoop = loopfor; - LoopInf = li; - } - - - public void Tick(float deltaTime) - { - if (RemainingSec == 0f) - { - return; - - } - - RemainingSec -= deltaTime; - - CheckForEnd(); - } - - private void CheckForEnd() - { - if (RemainingSec > 0f) - { - return; - } - - RemainingSec = 0f; - - if (RemainingLoop > 0) - { - RemainingSec = TrueDuration; - } - else if (LoopInf) - { - RemainingSec = TrueDuration; - } -======= - public int loopCount { get; private set; @@ -102,8 +44,7 @@ namespace Slimecing.Dependency // Will restart timer if the current 'loops' is 1 or greater remainingSeconds = loopCount-- > 0?initialRemainingSeconds:0f; ->>>>>>> Added triggers and lots of backend - + OnTimerEnd?.Invoke(); } } diff --git a/Assets/Scripts/Slimecing/InputSystem/PlayerInput.cs b/Assets/Scripts/Slimecing/InputSystem/PlayerInput.cs @@ -1,13 +1,11 @@ -using System; -using Slimecing.Character; -using Slimecing.Characters; +using Slimecing.Characters; using UnityEngine; using UnityEngine.InputSystem; namespace Slimecing.InputSystem { [RequireComponent(typeof(CharacterMovementController))] - public class PlayerInput : MonoBehaviour, SlimeControls.IVSGameplayActions + public class PlayerInput : MonoBehaviour, SlimeControls.IVsGameplayActions { [SerializeField] private SlimeControls playerControls; @@ -16,7 +14,7 @@ namespace Slimecing.InputSystem private void Awake() { playerControls = new SlimeControls(); - playerControls.VSGameplay.SetCallbacks(this); + playerControls.VsGameplay.SetCallbacks(this); _characterMovementController = GetComponent<CharacterMovementController>(); } diff --git a/Assets/Scripts/Slimecing/InputSystem/SlimeControls.cs b/Assets/Scripts/Slimecing/InputSystem/SlimeControls.cs @@ -17,22 +17,13 @@ namespace Slimecing.InputSystem ""name"": ""SlimeControls"", ""maps"": [ { -<<<<<<< HEAD - ""name"": ""VSGameplay"", - ""id"": ""24f634ee-5f8f-4707-89a7-23e8b1ecbcf4"", -======= ""name"": ""VsGameplay"", ""id"": ""a0766e30-e847-4bfe-b5bc-cde1c9883be5"", ->>>>>>> Added triggers and lots of backend ""actions"": [ { ""name"": ""Horizontal"", ""type"": ""Button"", -<<<<<<< HEAD - ""id"": ""550962d9-e533-414f-aa32-f29e5dfa9019"", -======= ""id"": ""8abfc885-0de5-41b1-8abb-45b2ff94793e"", ->>>>>>> Added triggers and lots of backend ""expectedControlType"": """", ""processors"": """", ""interactions"": """" @@ -40,11 +31,7 @@ namespace Slimecing.InputSystem { ""name"": ""Vertical"", ""type"": ""Button"", -<<<<<<< HEAD - ""id"": ""e4869e00-a1d9-457d-98b7-3520944918a3"", -======= ""id"": ""795a2a8f-8cdf-4247-8e61-45697d87c257"", ->>>>>>> Added triggers and lots of backend ""expectedControlType"": """", ""processors"": """", ""interactions"": """" @@ -53,11 +40,7 @@ namespace Slimecing.InputSystem ""bindings"": [ { ""name"": ""1D Axis"", -<<<<<<< HEAD - ""id"": ""8e69cdda-7fed-470f-acaa-8a3ab63a63c2"", -======= ""id"": ""24e32e59-8146-430e-84f2-a1b70931ae4d"", ->>>>>>> Added triggers and lots of backend ""path"": ""1DAxis"", ""interactions"": """", ""processors"": """", @@ -68,167 +51,95 @@ namespace Slimecing.InputSystem }, { ""name"": ""negative"", -<<<<<<< HEAD - ""id"": ""dff2a34d-d502-4dfe-8227-94a0f5ac22aa"", - ""path"": ""<Keyboard>/a"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", -======= ""id"": ""704f98c2-def6-4d1f-919a-f55afc789a69"", ""path"": ""<Gamepad>/leftStick/left"", ""interactions"": """", ""processors"": """", ""groups"": ""Gamepad"", ->>>>>>> Added triggers and lots of backend ""action"": ""Horizontal"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""positive"", -<<<<<<< HEAD - ""id"": ""7bf42d99-f48b-4b91-ad01-155c5eeebb07"", - ""path"": ""<Keyboard>/d"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", -======= ""id"": ""7930672c-a277-4b7d-abd4-36e6dc8a2f60"", ""path"": ""<Gamepad>/leftStick/right"", ""interactions"": """", ""processors"": """", ""groups"": ""Gamepad"", ->>>>>>> Added triggers and lots of backend ""action"": ""Horizontal"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""1D Axis"", -<<<<<<< HEAD - ""id"": ""faa9dfee-c3af-4ef1-a36f-7ae201db94d2"", -======= ""id"": ""1795ec87-9b67-4d39-9dc3-1340cb616993"", ->>>>>>> Added triggers and lots of backend ""path"": ""1DAxis"", ""interactions"": """", ""processors"": """", ""groups"": """", -<<<<<<< HEAD - ""action"": ""Horizontal"", -======= ""action"": ""Vertical"", ->>>>>>> Added triggers and lots of backend ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""negative"", -<<<<<<< HEAD - ""id"": ""f69a983c-d4f8-4dbe-bdce-ee54ee4e8fe7"", - ""path"": ""<Gamepad>/leftStick/left"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Horizontal"", -======= ""id"": ""0935a6f8-0eef-416b-a799-3bd4bf1a7427"", ""path"": ""<Gamepad>/leftStick/down"", ""interactions"": """", ""processors"": """", ""groups"": ""Gamepad"", ""action"": ""Vertical"", ->>>>>>> Added triggers and lots of backend ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""positive"", -<<<<<<< HEAD - ""id"": ""492c4265-7d82-4a79-b795-e5117a26d1ff"", - ""path"": ""<Gamepad>/leftStick/right"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Horizontal"", -======= ""id"": ""5b09c630-5af5-43d1-9aa5-53f006f852db"", ""path"": ""<Gamepad>/leftStick/up"", ""interactions"": """", ""processors"": """", ""groups"": ""Gamepad"", ""action"": ""Vertical"", ->>>>>>> Added triggers and lots of backend ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""1D Axis"", -<<<<<<< HEAD - ""id"": ""ef047899-ff11-4d90-9e60-7ce7683a25a9"", -======= ""id"": ""81786b8d-0478-4026-822f-27bbb95d6069"", ->>>>>>> Added triggers and lots of backend ""path"": ""1DAxis"", ""interactions"": """", ""processors"": """", ""groups"": """", -<<<<<<< HEAD - ""action"": ""Vertical"", -======= ""action"": ""Horizontal"", ->>>>>>> Added triggers and lots of backend ""isComposite"": true, ""isPartOfComposite"": false }, { ""name"": ""negative"", -<<<<<<< HEAD - ""id"": ""f3cd3157-c5b2-440e-88ea-46fedd54b294"", - ""path"": ""<Keyboard>/s"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Vertical"", -======= ""id"": ""c7c2af17-1134-4d80-894b-b672947e3154"", ""path"": ""<Keyboard>/a"", ""interactions"": """", ""processors"": """", ""groups"": ""Keyboard & Mouse"", ""action"": ""Horizontal"", ->>>>>>> Added triggers and lots of backend ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""positive"", -<<<<<<< HEAD - ""id"": ""5ea49ba6-e713-4cc1-8260-d0459a6f549b"", - ""path"": ""<Keyboard>/w"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", - ""action"": ""Vertical"", -======= ""id"": ""45d948f8-6196-4d84-b6d2-910feb90be8d"", ""path"": ""<Keyboard>/d"", ""interactions"": """", ""processors"": """", ""groups"": ""Keyboard & Mouse"", ""action"": ""Horizontal"", ->>>>>>> Added triggers and lots of backend ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""1D Axis"", -<<<<<<< HEAD - ""id"": ""82cb051e-4445-4323-be39-c955e64a53ca"", -======= ""id"": ""f63e4496-f181-4d11-b089-95ea60655e50"", ->>>>>>> Added triggers and lots of backend ""path"": ""1DAxis"", ""interactions"": """", ""processors"": """", @@ -239,53 +150,27 @@ namespace Slimecing.InputSystem }, { ""name"": ""negative"", -<<<<<<< HEAD - ""id"": ""8385a5f7-d192-4142-a50c-7bf9c4d408f0"", - ""path"": ""<Gamepad>/leftStick/down"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", -======= ""id"": ""043fe824-d52a-42b9-82c3-12aec1a16dd5"", ""path"": ""<Keyboard>/s"", ""interactions"": """", ""processors"": """", ""groups"": ""Keyboard & Mouse"", ->>>>>>> Added triggers and lots of backend ""action"": ""Vertical"", ""isComposite"": false, ""isPartOfComposite"": true }, { ""name"": ""positive"", -<<<<<<< HEAD - ""id"": ""1abd2da0-6ed5-446b-88ba-1d1c22fcb787"", - ""path"": ""<Gamepad>/leftStick/up"", - ""interactions"": """", - ""processors"": """", - ""groups"": """", -======= ""id"": ""7898eedc-f9ff-4760-b4f4-e701c57d1998"", ""path"": ""<Keyboard>/w"", ""interactions"": """", ""processors"": """", ""groups"": ""Keyboard & Mouse"", ->>>>>>> Added triggers and lots of backend ""action"": ""Vertical"", ""isComposite"": false, ""isPartOfComposite"": true } ] -<<<<<<< HEAD - } - ], - ""controlSchemes"": [] -}"); - // VSGameplay - m_VSGameplay = asset.FindActionMap("VSGameplay", throwIfNotFound: true); - m_VSGameplay_Horizontal = m_VSGameplay.FindAction("Horizontal", throwIfNotFound: true); - m_VSGameplay_Vertical = m_VSGameplay.FindAction("Vertical", throwIfNotFound: true); -======= }, { ""name"": ""AbilityButtons"", @@ -399,7 +284,6 @@ namespace Slimecing.InputSystem m_AbilityButtons = asset.FindActionMap("AbilityButtons", throwIfNotFound: true); m_AbilityButtons_DashAbility = m_AbilityButtons.FindAction("DashAbility", throwIfNotFound: true); m_AbilityButtons_JumpAbility = m_AbilityButtons.FindAction("JumpAbility", throwIfNotFound: true); ->>>>>>> Added triggers and lots of backend } public void Dispose() @@ -445,37 +329,7 @@ namespace Slimecing.InputSystem { asset.Disable(); } - -<<<<<<< HEAD - // VSGameplay - private readonly InputActionMap m_VSGameplay; - private IVSGameplayActions m_VSGameplayActionsCallbackInterface; - private readonly InputAction m_VSGameplay_Horizontal; - private readonly InputAction m_VSGameplay_Vertical; - public struct VSGameplayActions - { - private @SlimeControls m_Wrapper; - public VSGameplayActions(@SlimeControls wrapper) { m_Wrapper = wrapper; } - public InputAction @Horizontal => m_Wrapper.m_VSGameplay_Horizontal; - public InputAction @Vertical => m_Wrapper.m_VSGameplay_Vertical; - public InputActionMap Get() { return m_Wrapper.m_VSGameplay; } - public void Enable() { Get().Enable(); } - public void Disable() { Get().Disable(); } - public bool enabled => Get().enabled; - public static implicit operator InputActionMap(VSGameplayActions set) { return set.Get(); } - public void SetCallbacks(IVSGameplayActions instance) - { - if (m_Wrapper.m_VSGameplayActionsCallbackInterface != null) - { - @Horizontal.started -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnHorizontal; - @Horizontal.performed -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnHorizontal; - @Horizontal.canceled -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnHorizontal; - @Vertical.started -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnVertical; - @Vertical.performed -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnVertical; - @Vertical.canceled -= m_Wrapper.m_VSGameplayActionsCallbackInterface.OnVertical; - } - m_Wrapper.m_VSGameplayActionsCallbackInterface = instance; -======= + // VsGameplay private readonly InputActionMap m_VsGameplay; private IVsGameplayActions m_VsGameplayActionsCallbackInterface; @@ -504,7 +358,6 @@ namespace Slimecing.InputSystem @Vertical.canceled -= m_Wrapper.m_VsGameplayActionsCallbackInterface.OnVertical; } m_Wrapper.m_VsGameplayActionsCallbackInterface = instance; ->>>>>>> Added triggers and lots of backend if (instance != null) { @Horizontal.started += instance.OnHorizontal; @@ -516,10 +369,6 @@ namespace Slimecing.InputSystem } } } -<<<<<<< HEAD - public VSGameplayActions @VSGameplay => new VSGameplayActions(this); - public interface IVSGameplayActions -======= public VsGameplayActions @VsGameplay => new VsGameplayActions(this); // AbilityButtons @@ -590,18 +439,15 @@ namespace Slimecing.InputSystem } } public interface IVsGameplayActions ->>>>>>> Added triggers and lots of backend { void OnHorizontal(InputAction.CallbackContext context); void OnVertical(InputAction.CallbackContext context); } -<<<<<<< HEAD -======= + public interface IAbilityButtonsActions { void OnDashAbility(InputAction.CallbackContext context); void OnJumpAbility(InputAction.CallbackContext context); } ->>>>>>> Added triggers and lots of backend } } diff --git a/Assets/Scripts/Slimecing/InputSystem/SlimeInput.cs b/Assets/Scripts/Slimecing/InputSystem/SlimeInput.cs @@ -1,5 +1,4 @@ -using System; -using Slimecing.Characters; +using Slimecing.Characters; using UnityEngine; using UnityEngine.InputSystem; diff --git a/Assets/Scripts/Slimecing/MainScripts(old)/SwordScript.cs b/Assets/Scripts/Slimecing/MainScripts(old)/SwordScript.cs @@ -149,26 +149,6 @@ public class SwordScript : MonoBehaviour { else { //Generate a plane horizontally from the player position to get raycast hits Plane playerPlane = new Plane(Vector3.up, center); -<<<<<<< HEAD - Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //ray from camera angle diraction from mouse position - float hitdist = 0.0f; //hit distance - //when ray hits generated plane - if (playerPlane.Raycast(ray, out hitdist)) { - //location where raycast hit - Vector3 targetPoint = ray.GetPoint(hitdist); - //Debug.Log(targetPoint); - //set offset (basically radius) - offset = transform.position - center; - //set the height to static variable - //Rotate sword towards ray hit position based on speed - Vector3 swordTarget = Vector3.RotateTowards(offset, (targetPoint - center), swordMouseSpeed, 0f); - swordTarget.y = center.y + theY; - //Set position to that rotated towards - transform.position = center + swordTarget.normalized * Radius; - - } - -======= if (Camera.main != null) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //ray from camera angle diraction from mouse position @@ -189,7 +169,6 @@ public class SwordScript : MonoBehaviour { } } ->>>>>>> Added triggers and lots of backend } //Keep static height transform.position = new Vector3(transform.position.x, (theY + center.y), transform.position.z); diff --git a/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/RotatableLogic.cs b/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/RotatableLogic.cs @@ -5,31 +5,10 @@ namespace Slimecing.SimpleComponents.Movement.Rotatable_Types public abstract class RotatableLogic : ScriptableObject { [SerializeField] protected float rotSpeed; -<<<<<<< HEAD - protected Rigidbody rb; - protected Transform objectTransform; - protected bool stoppedAngVel; - - public virtual void Initialize(Rigidbody rbody, Transform body) - { - rb = rbody; - objectTransform = body; - } - - public virtual void Initialize(Transform body) - { - objectTransform = body; - } - - public abstract void RotateToVector(Vector3 desiredLookAt, float deltaTime); - - public void StopAngularVelocity() -======= protected bool stoppedAngVel; public abstract void RotateToVector(Transform objectBody, Vector3 desiredLookAt, float deltaTime); public void StopAngularVelocity(Rigidbody rb) ->>>>>>> Added triggers and lots of backend { if (rb == null) return; rb.angularVelocity = Vector3.zero; diff --git a/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/SimpleRotatableLogicSO.cs b/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/SimpleRotatableLogicSO.cs @@ -5,11 +5,7 @@ namespace Slimecing.SimpleComponents.Movement.Rotatable_Types [CreateAssetMenu(fileName = "SimpleRotater", menuName = "Movement/Rotation/SimpleRotater")] public class SimpleRotatableLogicSO : RotatableLogic { -<<<<<<< HEAD - public override void RotateToVector(Vector3 desiredLookAt, float deltaTime) -======= public override void RotateToVector(Transform objectTransform, Vector3 desiredLookAt, float deltaTime) ->>>>>>> Added triggers and lots of backend { if (desiredLookAt == Vector3.zero || !(rotSpeed > 0f)) return; Vector3 smoothedLookAtDirection = Vector3.Slerp(objectTransform.forward, desiredLookAt, diff --git a/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/TorqueRotatableLogicSO.cs b/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable Types/TorqueRotatableLogicSO.cs @@ -9,36 +9,18 @@ namespace Slimecing.SimpleComponents.Movement.Rotatable_Types [SerializeField] private float maxAngularVelocity; private bool _slowedAngVel; -<<<<<<< HEAD - - public override void Initialize(Rigidbody rbody, Transform body) - { - rb = rbody; - objectTransform = body; - rb.maxAngularVelocity = maxAngularVelocity; - } - - public override void RotateToVector(Vector3 desiredLookAt, float deltaTime) - { - if (desiredLookAt == Vector3.zero || !(rotSpeed > 0f)) return; -======= public override void RotateToVector(Transform objectTransform, Vector3 desiredLookAt, float deltaTime) { if (desiredLookAt == Vector3.zero || !(rotSpeed > 0f)) return; Rigidbody rb = objectTransform.gameObject.GetComponent<Rigidbody>(); ->>>>>>> Added triggers and lots of backend Quaternion targetRotation = Quaternion.LookRotation(desiredLookAt); if (Quaternion.Angle(objectTransform.rotation, targetRotation) < 13) { if (!_slowedAngVel) { -<<<<<<< HEAD - SlowAngularVelocity(); -======= SlowAngularVelocity(rb); ->>>>>>> Added triggers and lots of backend } objectTransform.rotation = Quaternion.Slerp(objectTransform.rotation, targetRotation, rotSpeed); return; @@ -68,12 +50,8 @@ namespace Slimecing.SimpleComponents.Movement.Rotatable_Types return relativeAngles; } - -<<<<<<< HEAD - private void SlowAngularVelocity() -======= + private void SlowAngularVelocity(Rigidbody rb) ->>>>>>> Added triggers and lots of backend { rb.angularVelocity *= 0.5f; _slowedAngVel = true; diff --git a/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable.cs b/Assets/Scripts/Slimecing/SimpleComponents/Movement/Rotatable.cs @@ -1,7 +1,5 @@ -using System; -using Slimecing.SimpleComponents.Movement.Rotatable_Types; +using Slimecing.SimpleComponents.Movement.Rotatable_Types; using UnityEngine; -using UnityEngine.Serialization; namespace Slimecing.SimpleComponents.Movement { @@ -9,41 +7,11 @@ namespace Slimecing.SimpleComponents.Movement { [SerializeField] private RotatableLogic rotatableLogic; -<<<<<<< HEAD - private RotatableLogic _currentRotatableLogic; - - private void Awake() - { - InitializeRotatableLogic(); - } - - private void InitializeRotatableLogic() - { - if (rotatableLogic == null) return; - _currentRotatableLogic = rotatableLogic; - - if (GetComponent<Rigidbody>() != null) - { - rotatableLogic.Initialize(GetComponent<Rigidbody>(), transform); - } - else - { - rotatableLogic.Initialize(transform); - } - } - - public void RotateToVector(Vector3 desiredLookAt, float deltaTime) - { - if (rotatableLogic == null) return; - if (rotatableLogic != _currentRotatableLogic) InitializeRotatableLogic(); - rotatableLogic.RotateToVector(desiredLookAt, deltaTime); -======= public void RotateToVector(Transform objectTransform, Vector3 desiredLookAt, float deltaTime) { if (rotatableLogic == null) return; rotatableLogic.RotateToVector(objectTransform, desiredLookAt, deltaTime); ->>>>>>> Added triggers and lots of backend } } } diff --git a/Assets/Scripts/Slimecing/SimpleComponents/TimerBehaviour.cs b/Assets/Scripts/Slimecing/SimpleComponents/TimerBehaviour.cs @@ -22,7 +22,7 @@ namespace Slimecing.SimpleComponents { return _timer; } - _timer = new Timer(durationOfTick, loopFor, loopInfinite); + //_timer = new Timer(durationOfTick, loopFor, loopInfinite); return _timer; } } diff --git a/Assets/Scripts/Slimecing/StateMachine/StateChangers/InputCondition.cs b/Assets/Scripts/Slimecing/StateMachine/StateChangers/InputCondition.cs @@ -1,11 +1,5 @@ -<<<<<<< HEAD -using Slimecing.Character; using Slimecing.Characters; -======= -using Slimecing.Characters; ->>>>>>> Added triggers and lots of backend using UnityEngine; -using UnityEngine.Serialization; namespace Slimecing.StateMachine.StateChangers { diff --git a/Assets/Scripts/Slimecing/StateMachine/StateChangers/UsingAbilityCondition.cs b/Assets/Scripts/Slimecing/StateMachine/StateChangers/UsingAbilityCondition.cs @@ -1,8 +1,4 @@ -<<<<<<< HEAD -using Slimecing.Character; -======= -using Slimecing.Characters; ->>>>>>> Added triggers and lots of backend +using Slimecing.Characters; using UnityEngine; namespace Slimecing.StateMachine.StateChangers @@ -14,10 +10,7 @@ namespace Slimecing.StateMachine.StateChangers public override bool IsMet() { -<<<<<<< HEAD -======= if (abilityUser == null) return false; ->>>>>>> Added triggers and lots of backend return abilityUser.CheckForEffects() == isUsingAbility; } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset @@ -519,7 +519,16 @@ PlayerSettings: webGLLinkerTarget: 1 webGLThreadsSupport: 0 webGLWasmStreaming: 0 - scriptingDefineSymbols: {} + scriptingDefineSymbols: + 1: UNITY_POST_PROCESSING_STACK_V2 + 7: UNITY_POST_PROCESSING_STACK_V2 + 13: UNITY_POST_PROCESSING_STACK_V2 + 19: UNITY_POST_PROCESSING_STACK_V2 + 21: UNITY_POST_PROCESSING_STACK_V2 + 25: UNITY_POST_PROCESSING_STACK_V2 + 27: UNITY_POST_PROCESSING_STACK_V2 + 28: UNITY_POST_PROCESSING_STACK_V2 + 29: UNITY_POST_PROCESSING_STACK_V2 platformArchitecture: {} scriptingBackend: {} il2cppCompilerConfiguration: {}