GithubHelp home page GithubHelp logo

derpychap / toottallycore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from toottally/toottallycore

0.0 1.0 0.0 5.33 MB

TootTallyAPI for Trombone Champ Modding

License: MIT License

C# 100.00%

toottallycore's Introduction

TootTallyCore

TootTallyAPI for Trombone Champ Modding

TootTally Modules

TootTally Modules are mods managed by TootTallyCore. They can be enabled / disabled dynamically without the need of restarting your game. They are use to decouple features into multiple independent components and not over "feature-ise" one single plugin. For more information on how to create a TootTally Modules, head to the toottally module template page

All current modules:

TootTally Notifs

TootTally Notifications are a convenient way to display information to the user.

  • There are 3 values needed when creating a notification: Message, Color, Lifespan (Seconds). To create a notification, use the TootTallyNotifManager static class and its DisplayNotif method as followed:
//Full constructor
TootTallyNotifManager.DisplayNotif("MyMessage", Color.white, 6f);

//Simplified constructor (default to white and 6 seconds)
TootTallyNotifManager.DisplayNotif("MyOtherMessage");

Just be mindfull that the user probably doesn't want to get spammed with notifs unless necessary :)

TootTally Animations

TootTally Animations are an easy way to create flexible animations for Unity Gameobject's properties. It uses Second degree order dynamics to create smooth and alive transitions between two points.

Warning

Keep in mind that these animation are frame rate dependent. While this makes the animations much smoother at a higher frame rate, there is a risk that the animation looks different when a a long-lasting freeze happens. Each constants affect the behavior of the animation in 3 different ways: Frequency, Damping, Initial Response.

Frequency (f)

The amplitude of the animation. Higher frequency usually results in a much faster animation.

Damping (z)

The deceleration of the animation when getting closer to the destination

  • z = 0 no damping -> vibrates forever
  • 0 < z < 1 vibrates but end up settling at destination
  • z >= 1 takes more time to settle at destination

Initial Response (r)

The starting velocity of the animation.

  • r < 0 "anticipates" the motion (moves in opposite direction for a bit before going to target like a slingshot effect)
  • 0 <= r < 1 still takes time to accelerate but less the higher the value
  • r = 1 takes no time to accelerate
  • r > 1 overshoots destination

It might feel scary at first but once you get the hang of it, your animations will feel a lot more personalized and unique.

  • There are 7 different properties that can be animated: TransformScale, TransformPosition, Position (RectTransform), SizeDelta (RT), Scale (RT), EulerAngle, Rotation
  • There are 5 parameters needed to create an animation: gameObject, targetVector, timeSpan (seconds), secondDegreeDynamicsAnimation, onFinishCallback (optional) To create a new animation, use the TootTallyAnimationManager static class and its AddAnimation methods as followed:
Vector3 targetPosition = new Vector3(5, 10, 15);
SecondDegreeDynamicsAnimation dynamics = new SecondDegreeDynamicsAnimation(1f, 0.95f, 0.5f) //Bounces one time then settles at target, accelerate faster at the start of the animation
TootTallyAnimation myAnimation = TootTallyAnimationManager.AddNewPositionAnimation(myGameObject, targetPosition, 1f, dynamics);

Animations can be disposed early if needed by calling the myAnimation.Dispose() method.

TootTally Asset Managers

PNG

To load your assets into TootTally Asset Manager, simply use the AssetManager.LoadAssets(path) method. A convenient way to store your assets is to put them with your .dll file, then use the following line as a path:

var path = Path.Combine(Path.GetDirectoryName(Instance.Info.Location), "Assets");
AssetManager.LoadAssets(path);

You can then access all the assets using the AssetManager.GetSprite(name) or AssetManager.GetTexture(name) methods.

Note

Include the extension file to the name such as "MyCoolAsset.png"

Prefabs

Same as the regular asset manager, but use the AssetBundleManager.LoadAssets(prefabFilePath) class instead. Use the AssetBundleManager.GetPrefab(name) to get your desired prefab.

Note

Do not include the .prefab extension. Just enter the name of the prefab such as "MyCoolPrefab"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.