Feelcerca Game Lib - Explanation
Overview
This is a Unity-oriented game library developed by Feelcerca. This library provides tools for game developers to quickly and easily implement Audio playback, specialized 2D particles, and simple fades, among other features. This is a version excerpted from the library we use in-house and made available to the public.
Namespace: Feelcerca.System
This consists of classes related to system functionality.
-
Singleton Class
- Function: Manages the singleton pattern.
- Usage: Access the singleton instance via the
Instance
property.
-
Math Class
- Function: Supports mathematical calculations.
- Features: Includes methods related to curves, 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()
Namespace: Feelcerca.Audio
This namespace contains classes for audio playback using the Audio Mixer.
-
Manager Class
- Function: Adjusts the volume, plays music and sound effects, and manages transitions.
- Features: Upon playing, MusicPlayer and SfxPlayer classes are generated.
-
Mixer Class
- Function: Handles value assignment to the AudioMixer and executes transitions.
- Note: It is generally operated through the Manager class. Normally, there is no need to call it directly from game scripts.
-
MusicPlayer Class
- Function: Plays music.
- Note: Generally operated via the Manager class. Normally, there is 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 looped sounds, use the Stop() method of the SfxPlayer generated when played through the Manager class.
How to Use Feelcerca.Audio
Audio playback is performed using Feelcerca.Audio.Manager and Feelcerca.Audio.Mixer. The setup steps are as follows:
- Attach Feelcerca.Audio.Manager and Feelcerca.Audio.Mixer to a GameObject.
- If necessary, use
DontDestroyOnLoad()
to make the GameObject persistent.
Parameter Settings
Configure various parameters from the Inspector.
Feelcerca.Audio.Mixer
- mixer (Feelcerca.Audio.Mixer):
Set the AudioMixer to be used 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. (Being empty is not an issue).
Audio Playback and Volume Adjustment
After the above settings, audio is operated as follows:
- Audio Playback: Use
Feelcerca.Audio.Manager.Instance.PlaySfx()
or Feelcerca.Audio.Manager.Instance.PlayMusic()
.
- Volume Adjustment: Done through properties like
SfxVolume
, MusicVolume
, etc.
- Snapshot Transitions: Use
Feelcerca.Audio.Manager.Instance.TransitionToSnapshot()
.
Namespace: Feelcerca.FX
Class group for handling special particles, etc.
- ConvergingParticles2D Class: A class that creates 2D particle effects that converge on a specified point. Particles move along a Bezier curve that connects 3 or 4 points. This class can be added as a component to a GameObject, and various parameters can be set from the Inspector.
How to Use ConvergingParticles2D
Attach Feelcerca.FX.ConvergingParticles2D to a GameObject. Prefab as needed.
Parameter Settings
Set various parameters from the Inspector.
- Material: Set the material to be used for particles.
- Emit Interval: Particle emission interval (seconds)
- Emit Range: The spread range near the particle emission point
- Emit Count: Number of particles that can be emitted in one frame
- Attraction Field: The spread range near the particle arrival point
- Scale: Size of the particles
- Life Time: Time for which particles continue to emit (seconds)
- Max Rotations: Maximum rotations
Displaying Particles
Retrieve the Feelcerca.FX.ConvergingParticles2D component from the instantiated GameObject and call the Init()
method. If needed, set Actions using the AddOnParticleEmitAction()
and AddOnParticleArrivedAction()
methods 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 or not
Namespace: Feelcerca.Util
Class group for handling Ortho camera scaling and simple faders (fade-in and fade-out).
OrthoCameraScaler Class
Attach Feelcerca.Util.OrthoCameraScaler to the Camera's GameObject.
Parameter Settings
- Reference Resolution: Reference resolution (Recommended to match with Canvas settings)
- Pixels Per Unit: Basic Pixels Per Unit value
- Only On Start: true for only at Start, false for recalculating every time Update is called
SimpleFader Class
Attach Simple Fader to any GameObject.
Parameter Settings
- Image: Set a Panel (Image) to cover the entire screen, preferably at the front.
Executing Fade-in and Fade-out
Use SimpleFader.Instance.FadeIn()
and SimpleFader.Instance.FadeOut()
. You can receive the completion timing through the onDone
callback argument in the methods.
*Unity is a trademark or registered trademark of Unity Technologies.