All Projects → mlnv → Energysuite

mlnv / Energysuite

Simple real-time energy based system for your Unity3d game

Projects that are alternatives of or similar to Energysuite

Realtime Csg For Unity
Realtime-CSG, CSG level editor for Unity
Stars: ✭ 281 (+806.45%)
Mutual labels:  unity3d-plugin, unity-asset, unity-3d
Savegamepro
A Complete and Powerful Save Game Solution for Unity (Game Engine)
Stars: ✭ 30 (-3.23%)
Mutual labels:  unity3d-plugin, unity-asset, unity-3d
UnityDebug
A wrapper script for Unity debug calls to use conditional attributes in order to avoid debug code being compiled into release builds.
Stars: ✭ 29 (-6.45%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
Dlibfacelandmarkdetector
FaceLandmark Detector using Dlib (Unity Asset Plugin)
Stars: ✭ 80 (+158.06%)
Mutual labels:  unity3d-plugin, unity-asset, unity-3d
UnityGlobalTextSystem
Allow the user to 'change' the default font in Unity from "Arial" to a font of their liking.
Stars: ✭ 21 (-32.26%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
JsonFormatter
Easy, Fast and Lightweight Json Formatter. (Serializer and Deserializer)
Stars: ✭ 26 (-16.13%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
unity-firebase-realtime-database
Unity Firebase Realtime Database REST
Stars: ✭ 24 (-22.58%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
Apple Signin Unity
Unity plugin to support Sign In With Apple Id
Stars: ✭ 228 (+635.48%)
Mutual labels:  unity3d-plugin, unity-asset, unity-3d
UnityHexagonLibrary2d
A library to manage 2D hexagonal tiles in Unity.
Stars: ✭ 58 (+87.1%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
TsukiSuite
A toolsuite created to make Unity development easier
Stars: ✭ 23 (-25.81%)
Mutual labels:  unity-asset, unity-3d, unity3d-plugin
Opencvforunity
OpenCV for Unity (Untiy Asset Plugin)
Stars: ✭ 359 (+1058.06%)
Mutual labels:  unity3d-plugin, unity-asset, unity-3d
Savegamefree
Save Game Free is a free and simple but powerful solution for saving and loading game data in unity.
Stars: ✭ 279 (+800%)
Mutual labels:  unity3d-plugin, unity-asset
Nativewebsocket
🔌 WebSocket client for Unity - with no external dependencies (WebGL, Native, Android, iOS, UWP)
Stars: ✭ 273 (+780.65%)
Mutual labels:  unity3d-plugin, unity-asset
Mapssdk Unity
This repository contains samples, documentation, and supporting scripts for Maps SDK, a Microsoft Garage project.
Stars: ✭ 307 (+890.32%)
Mutual labels:  unity3d-plugin, unity-3d
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+11641.94%)
Mutual labels:  unity3d-plugin, unity-asset
Radialprogressbar
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
Stars: ✭ 714 (+2203.23%)
Mutual labels:  unity-asset, unity-3d
Jengine
JEngine是针对Unity开发者设计的开箱即用的框架,封装了强大的功能,小白也能快速上手,轻松制作可以热更新的游戏 | JEngine is a streamlined and easy-to-use framework designed for Unity Programmers which contains powerful features, beginners can start up quickly and making hot update-able games easily
Stars: ✭ 564 (+1719.35%)
Mutual labels:  unity3d-plugin, unity-3d
Unity Game Hacking
A guide for hacking unity games
Stars: ✭ 710 (+2190.32%)
Mutual labels:  unity-asset, unity-3d
Restclient
🦄 Simple HTTP and REST client for Unity based on Promises, also supports Callbacks! 🎮
Stars: ✭ 675 (+2077.42%)
Mutual labels:  unity3d-plugin, unity-asset
Unity3d Rainbow Folders
This asset allows you to set custom icons for any folder in unity project browser.
Stars: ✭ 519 (+1574.19%)
Mutual labels:  unity3d-plugin, unity-asset

EnergySuite

This is a simple time system for your Unity3D game to manage different kinds of goods that depend on time. It works without internet connection and does not depend on the system time of the device (if user change device system time - it won't change anything for this system), tested on iOS / Android.

Example screenshot

Installation

  • Apply last available unitypackage to your project
  • Place EnergySuiteBehaviour prefab on your first scene (it's DontDestroyOnLoad script)
  • Edit Password and PasswordSalt fields in EnergySuiteConfig.cs
  • Add your time values to TimeValue enum
  • Place you time values to StoredInfo field in EnergySuiteConfig.cs
  • PROFIT

Example Code

Don't forget to add this at the top of the script:

using EnergySuite;

Get current time value amount:

EnergySuiteManager.GetAmount(timeValueType)

Get max time value amount:

EnergySuiteManager.GetMaxAmount(timeValueType)

Manually add amount of time value:

EnergySuiteManager.Add(timeValueType, amount);

Manually use amount of time value:

(returns false if currentAmount < amountToUse)

EnergySuiteManager.Use(timeValueType, amount);

Subscribe on time value amount changed action:

EnergySuiteManager.OnAmountChanged += OnAmountChanged;

void OnAmountChanged(int amount, TimeBasedValue timeBasedValue) {
	string text = amount + "/" + timeBasedValue.MaxAmount;
	
	switch (timeBasedValue.Type) {
		case TimeValue.Life:
			CurrentLifeAmountText.text = text;
			break;
		case TimeValue.Key:
			CurrentKeyAmountText.text = text;
			break;
		default:
			break;
	}
}

Subscribe on time left tick action :

(updated every sec if not full)

EnergySuiteManager.OnTimeLeftChanged += OnTimeLeftChanged;

void OnTimeLeftChanged(TimeSpan timeLeft, TimeBasedValue timeBasedValue) {
	
	string formatString = string.Format("{0:00}:{1:00}", timeLeft.Minutes, timeLeft.Seconds);
  
  	switch (timeBasedValue.Type) {
		case TimeValue.Life:
			LifeTimeLeftText.text = formatString;
			break;
		case TimeValue.Key:
			KeyTimeLeftText.text = formatString;
			break;
		default:
			break;
	}
}

Convert time left value to slider value:

TimeLeftSlider.value = EnergySuiteManager.ConvertToSliderValue(timeLeft, timeBasedValue);

All examples you can find at Example folder.

TODO

  • [x] Encrypted PlayerPrefs
  • [x] Native iOS/Android time check
  • [x] Make system handle many simultaneous timers
  • [ ] Add Custom Editor
  • [ ] Simple handler solution for web server
  • [ ] Native iOS/Android notification system

Contribution

Yes, please

Dependencies

This asset use Secured PlayerPrefs and StateKit, so if you already have one of this asset in your project - just delete one copy of it.

Developed By

Maksym Yemelianov

Follow me on Twitter

License

Attribution-NonCommercial-ShareAlike 3.0 Unported with simple explanation with the attribution clause waived. You are free to use EnergySuite in any and all games that you make. You cannot sell EnergySuite directly or as part of a larger game asset.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].