This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class NewMonoBehaviourScript : MonoBehaviour { | |
public List<Button> buttons = new List<Button>(); | |
void Awake() { | |
foreach (var button in buttons) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class OSRSCombatCalculator { | |
// Calculates Melee Damage | |
public static int CalculateMeleeDamage( | |
int atkLvl, int atkBonus, int strLvl, int strBonus, | |
int defLvl, int defBonus, | |
float atkPrayer = 1f, float strPrayer = 1f, | |
float defPrayer = 1f, float damageMultiplier = 1f, | |
int atkStance = 0, int strStance = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
namespace TCS.CombatFormula { | |
public static class CombatFormula { | |
public static int CalculateEffectiveStrength(int combatLevels, float prayerMultiplier = 1, float strengthBoost = 1) { | |
/* | |
*********Step 1: Calculate the Effective Strength Level********* | |
Formula: Effective Strength = floor((Base Strength + Strength Boost) * Prayer Bonus) + 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TCS.UnityUtils { | |
/// <summary> | |
/// A fast random number generator for .NET, from https://www.codeproject.com/Articles/9187/A-fast-equivalent-for-System-Random | |
/// Colin Green, January 2005 | |
/// | |
/// Key points: | |
/// 1) Based on a simple and fast xor-shift pseudo random number generator (RNG) specified in: | |
/// Marsaglia, George. (2003). Xorshift RNGs. | |
/// http://www.jstatsoft.org/v08/i14/xorshift.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nullable enable | |
using System; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using System.ComponentModel; | |
namespace TCS.Infrastructure { | |
public abstract class ObservableObject : INotifyPropertyChanged, INotifyPropertyChanging { | |
public event PropertyChangingEventHandler? PropertyChanging; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class Logger { | |
const string CLASS_NAME = "LogThisWithColor"; | |
const string LOG_COLOR = "green"; | |
static string ClassName => CLASS_NAME.SetPrefix(); | |
static string SetPrefix(this string newString) => $"<color={LOG_COLOR}>[{newString}]</color>"; | |
public static void Log(string message) => Debug.Log($"{ClassName} {message}"); | |
public static void LogWarning(string message) => Debug.LogWarning($"{ClassName} {message}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using UnityEngine; | |
using Debug = UnityEngine.Debug; | |
using Object = UnityEngine.Object; | |
namespace TCS.TestSystems.Logging { | |
public static class GameLogger { | |
// Dictionary to hold Logger instances for each system, identified by Type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Pool; | |
namespace TCS.TestSystems.AudioManager { | |
// AudioEvent class | |
public class AudioEvent { | |
public AudioClip Clip { get; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Pool; | |
public class GlobalPoolManager : MonoBehaviour { | |
// Singleton pattern to ensure only one instance of the manager | |
static GlobalPoolManager s_instance; | |
public static GlobalPoolManager Instance { | |
get { | |
if (s_instance) return s_instance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using FPSPlayerController.DamonFPS.Player; | |
using UnityEngine; | |
namespace NewGameLogic.DamageSystem.Testing | |
{ | |
[System.Serializable] | |
public class BulletPenetration | |
{ | |
[SerializeField] private float damageMultiplier = 0.5f; |
NewerOlder