Library
Feelcerca Game Lib Explanation
A Unity-oriented game library by Feelcerca. It gives developers quick, simple ways to implement audio playback, specialized 2D particles, simple fades and more — a version excerpted from the library we use in-house and made available to the public.
Namespace: Feelcerca.System
System-related classes.
-
Singleton class
- Function: manages the singleton pattern.
- Usage: access the singleton instance via the
Instanceproperty.
-
Math class
- Function: supports mathematical calculations.
- Features: includes curve-related methods such as
CalcBezierPoint().
-
Logger class
- Function: manages log output.
- Methods:
- Error log:
Error() - Warning log:
Warning() - Info log:
Info() - Trace log:
Trace() - Verbose log:
Verbose()
- Error log:
Namespace: Feelcerca.Audio
Classes for audio playback using the Audio Mixer.
-
Manager class
- Function: adjusts volume, plays music and sound effects, and manages transitions.
- Features: on playback,
MusicPlayerandSfxPlayerinstances are generated.
-
Mixer class
- Function: handles value assignment to the
AudioMixerand executes transitions. - Note: generally operated through the Manager class. There is normally no need to call it directly from game scripts.
- Function: handles value assignment to the
-
MusicPlayer class
- Function: plays music.
- Note: generally operated via the Manager class. There is normally no need for direct access from game scripts.
-
SfxPlayer class
- Function: plays sound effects.
- Usage:
- Basic playback is performed via the Manager class.
- To stop a looped sound, use the
Stop()method of theSfxPlayergenerated when played through the Manager class.
How to use Feelcerca.Audio
Audio playback is performed using Feelcerca.Audio.Manager and Feelcerca.Audio.Mixer. Setup steps:
- Attach
Feelcerca.Audio.ManagerandFeelcerca.Audio.Mixerto a GameObject. - If necessary, use
DontDestroyOnLoad()to make the GameObject persistent.
Parameter settings
Configure the parameters from the Inspector.
Feelcerca.Audio.Mixer
- mixer (Feelcerca.Audio.Mixer): set the
AudioMixerused in the game.
Feelcerca.Audio.Manager
- mixer (Feelcerca.Audio.Manager): set the attached
Feelcerca.Audio.Mixer. - Sfx Group, Music Group, Voice Group: set the appropriate Group configured in the
AudioMixer. - Sfx Volume Param, Music Volume Param, Voice Volume Param: set the name of the Volume parameter exposed in each Group.
- Sfx Group Name, Music Group Name, Voice Group Name: set the appropriate Group names configured in the
AudioMixer(empty is not an issue).
Audio playback and volume adjustment
After the settings above, audio is operated as follows:
- Audio playback: use
Feelcerca.Audio.Manager.Instance.PlaySfx()orFeelcerca.Audio.Manager.Instance.PlayMusic(). - Volume adjustment: through properties such as
SfxVolume,MusicVolume, etc. - Snapshot transitions: use
Feelcerca.Audio.Manager.Instance.TransitionToSnapshot().
Namespace: Feelcerca.FX
Classes for handling special particles and similar effects.
- ConvergingParticles2D class: creates 2D particle effects that converge on a specified point. Particles move along a Bezier curve connecting 3 or 4 points. Add it as a component to a GameObject and set the parameters from the Inspector.
How to use ConvergingParticles2D
Attach Feelcerca.FX.ConvergingParticles2D to a GameObject. Turn it into a prefab as needed.
Parameter settings
Set the parameters from the Inspector.
- Material: the material used for particles.
- Emit Interval: particle emission interval (seconds).
- Emit Range: the spread near the particle emission point.
- Emit Count: number of particles that can be emitted in one frame.
- Attraction Field: the spread near the particle arrival point.
- Scale: size of the particles.
- Life Time: how long particles keep emitting (seconds).
- Max Rotations: maximum rotations.
Displaying particles
Get the Feelcerca.FX.ConvergingParticles2D component from the instantiated GameObject and call Init(). If needed, set actions with AddOnParticleEmitAction() and AddOnParticleArrivedAction() to trigger events when particles are emitted or arrive.
Init method
public void Init(Vector3 src, Vector3 dst, int maxParticles, bool useInstancing = false);
Arguments
- src: particle emission point.
- dst: particle arrival point.
- maxParticles: maximum particle count.
- useInstancing: whether to use instancing.
Namespace: Feelcerca.Util
Classes for ortho-camera scaling and a simple fader (fade-in / fade-out).
OrthoCameraScaler class
Attach Feelcerca.Util.OrthoCameraScaler to the camera's GameObject.
Parameter settings
- Reference Resolution: reference resolution (recommended to match your Canvas settings).
- Pixels Per Unit: the base Pixels Per Unit value.
- Only On Start:
trueto run only at Start,falseto recalculate every Update.
SimpleFader class
Attach SimpleFader to any GameObject.
Parameter settings
- Image: a full-screen Panel (Image), preferably in front, that covers the whole screen.
Running fade-in and fade-out
Use SimpleFader.Instance.FadeIn() and SimpleFader.Instance.FadeOut(). You can receive the completion timing through the onDone callback argument.