Feedback System
Unity easy configurable feedback system
The feedback system allow you to integrate and call feedbacks containing visual and sound effects easily with Feedback
assets and Feedback Event System
component.
How to setup a feedback
Create a Feedback
asset (“Create/Feedback”) and refer a target Particle System
and a Audio Clip
.
Add a Feedback Event System
component on the target Game Object
and add the event you want to call and their feedback asset
You can call those events with the method PlayFeedbackEvent()
referencing the Feedback Event System
in a Unity Event
or calling the Play()
function of the feedback
using UnityEngine;
using SorangonToolset.FeedbackSystem;
public class Wizard : MonoBehaviour {
[SerializeField] private Feedback _healFeedback = null;
public void OnHeal(){
_healFeedback.Play(transform.position, Quaternion.identity);
}
}
Feedback Asset
In project window : “Create/Feedback”
- Particle System - The Particle System you want to play
- Scale Multiplier - The scale ratio of the instantiated particle system (set child particle system scaling mode to Hierarchy to scale it correctly)
- Follow Owner Rotation - Does the rotation of the effect is relative to the owner
- Sound Effect - The Audio Clip you want to play
- Volume - The volume of the sound effect
- Random Pitch Range - The range of the pitch value randomly generated between a min and a max
- Spatial Blend - Blend ratio between 2D or 3D space. If 1, the sound is played in the world space with a physical behaviour
- Parent To Owner - Does parent the visual and sound effect to the parent (if one is specifyied in Play() function parameters)
Methods
To use those methods, you must include SorangonToolset.FeedbackSystem
namespace
Feedback
public void Play(Vector3 position, Transform owner = null)
Play the feedback at a position, refer the owner in the case you want your feedback depends to a parent.
public void Play(Vector3 position, Quaternion rotation, Transform owner = null)
Play the feedback at a position with a specific rotation, refer the owner in the case you want your feedback depends to a parent.
Feedback Event System
public void PlayFeedbackEvent(string eventName)
Play the the target event from the Feedback Event System