📦Third-party packages

ready built-in packages you should know about in base/init project

Here will be listed third-party packages, you can expand each one and see examples of usage.

PrimeTween - easy way to make animations (move, rotate, scale objects and etc)

How to use:

using PrimeTween;

// Animate 'transform.position.y' from the current value to 10 in 1 second using the Ease.InOutSine
Tween.PositionY(transform, endValue: 10, duration: 1, ease: Ease.InOutSine);
// Rotate 'transform' from the current rotation to (0, 90, 0) in 1 second
Tween.Rotation(transform, endValue: Quaternion.Euler(0, 90, 0), duration: 1);
// Rotate 'transform' around the y-axis by 360 degrees in 1 second 
Tween.EulerAngles(transform, startValue: Vector3.zero, endValue: new Vector3(0, 360), duration: 1);
// Animate 'transform.position' with callback (no allocation example)
Tween.Position(transform, new Vector3(10, 0), duration: 1)
    .OnComplete(target: this, target => target.SomeMethod()); // no allocation

All methods you can find here. Also in the end of page from link there is an example how to migrate from DOTween to PrimeTween.

Alchemy - easy way to test and make inspector more flexible

You can find examples of usage in /Assets/_Examples/Alchemy Samples/.. Some examples:

// add
using Alchemy.Inspector;

// example: call function from inpector by Button
// great way to test some features
[Button, LableText("Do Something")]
private void DoSmth() {
    print("+");
}

// it also supports buttons with parameters
[Button, LableText("Function with parameter")]
private void DoSmth(string someValue) {
    print(someValue);
}

// example: show variables in inspector if bool set to true by ShowIf
[SerializedField] private bool _useRotate;
[SerializedField, ShowIf(nameof(_useRotate))]
private float _rotateSpeed = 10f;

// you also can use a lot of attributes 
// in generic classes and scriptable objects!
[System.Serializable]
public class Foo {
    [Button, LableText("Generic class button!")]
    private void DoSmth(string someValue) {
        print(someValue);
    }
}

More information and examples you can find here.

Serialized Dictionary - great way to serialize dictionaries in the inspector

More information you can find here. Unfortunately it's not work with alchemy inspector, but you can use Alchemy dictionary serialization instead (class must be marked as partial) - more information here.

FEEL.NiceVibrations - easy way to implement vibrations

We have class called VibrationManager.cs, it's singleton. Use it to trigger NiceVibration methods. Use DoVibro(HapticTypes hapticType) to trigger vibrations. You can add more methods if you need, but make sure to check hapticEnabled boolean variable (is player using haptic).

using MoreMountains.NiceVibrations;

namespace Game.Core {
    public class VibrationsManager {
        public static VibrationsManager Instance;
        public bool HapticEnabled;

        public void DoVibro(HapticPatterns.PresetType hapticType);
    }
}
// You should call vibrations like this:
VibrationsManager.Instance.DoVibro(your_haptic_type_variable_here);

Here is NiceVibrations documentation.

Google InAppReview (Android) - ready in app review popup

We use this package in InAppReviewManager.cs

// call when neccessary like this:
InAppReviewManager.Instance.ShowInAppReview()

// you can implement custom RateUs window and trigger it by method above.

This package allows to request player review without leaving game with popup. It will automaticaly freeze the game while review process running.

LeanTouch (Android) - ready to use touch system

More information in the docs.

Simple Localization by Hippo - ready to use localization system with cvs files
VContainer by hadashiA - DI library running on Unity Game Engine

See VContainer Usage in our project

Last updated