Git Product home page Git Product logo

com.stansassets.foundation's Introduction

Foundation Library

Foundation Library is a free open source product that contains lots of useful APIs, Utilities and Extension methods. We do not provide any articles or tutorials for these plugins. But we do try to keep every public API documented and self-explanatory.

NPM Package openupm Licence Issues Codacy Badge

API Reference | Wiki | Unity Forum | Asset Store

Quick links to explore the library:

Install from NPM

  • Navigate to the Packages directory of your project.
  • Adjust the project manifest file manifest.json in a text editor.
  • Ensure https://registry.npmjs.org/ is part of scopedRegistries.
    • Ensure com.stansassets is part of scopes.
    • Add com.stansassets.foundation to the dependencies, stating the latest version.

A minimal example ends up looking like this. Please note that the version X.Y.Z stated here is to be replaced with the latest released version which is currently NPM Package.

{
  "scopedRegistries": [
    {
      "name": "npmjs",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "com.stansassets"
      ]
    }
  ],
  "dependencies": {
    "com.stansassets.foundation": "X.Y.Z",
    ...
  }
}
  • Switch back to the Unity software and wait for it to finish importing the added package.

Install from OpenUPM

  • Install openupm-cli npm install -g openupm-cli or yarn global add openupm-cli
  • Enter your unity project folder cd <YOUR_UNITY_PROJECT_FOLDER>
  • Install package openupm add com.stansassets.foundation

Install from a Git URL

Yoy can also install this package via Git URL. To load a package from a Git URL:

  • Open Unity Package Manager window.
  • Click the add + button in the status bar.
  • The options for adding packages appear.
  • Select Add package from git URL from the add menu. A text box and an Add button appear.
  • Enter the https://github.com/StansAssets/com.stansassets.foundation.git Git URL in the text box and click Add.
  • You may also install a specific package version by using the URL with the specified version.
    • https://github.com/StansAssets/com.stansassets.foundation.git#X.Y.X
    • Please note that the version X.Y.Z stated here is to be replaced with the version you would like to get.
    • You can find all the available releases here.
    • The latest available release version is Last Release

For more information about what protocols Unity supports, see Git URLs.

About Us

We are committed to developing high quality and engaging entertainment software. Our mission has been to bring a reliable and high-quality Unity Development service to companies and individuals around the globe. At Stan's Assets, we make Plugins, SDKs, Games, VR & AR Applications. Do not hesitate do get in touch, whether you have a question, want to build something, or just to say hi :) Let's Talk!

Website | LinkedIn | Youtube | Github | AssetStore

com.stansassets.foundation's People

Contributors

alexey-yaremenko avatar alexwargon avatar foritari avatar konargus avatar kostiantyn-koretskyi avatar lytvynenko-danylo avatar mend-bolt-for-github[bot] avatar nikita-mordik avatar pavlo-klymentenko avatar pavlo-klymentenko-legacy avatar roman-effrimov avatar stan-osipov avatar tinaynox avatar vdenysiuk-sa avatar yurii-lunha-stansassets avatar yurii-tor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

com.stansassets.foundation's Issues

Add Rect Transfrom exetnssions

public static void SetLeft(this RectTransform rt, float left)
{
rt.offsetMin = new Vector2(left, rt.offsetMin.y);
}

 public static void SetRight(this RectTransform rt, float right)
 {
     rt.offsetMax = new Vector2(-right, rt.offsetMax.y);
 }

 public static void SetTop(this RectTransform rt, float top)
 {
     rt.offsetMax = new Vector2(rt.offsetMax.x, -top);
 }

 public static void SetBottom(this RectTransform rt, float bottom)
 {
     rt.offsetMin = new Vector2(rt.offsetMin.x, bottom);
 }

TimeUtility relies on DateTime

s_Timers[name] = DateTime.Now.Ticks;

the TimeUtility class is based on DateTime, which means it breaks when pausing the play mode in the editor (timers should not proceed while paused).

Relying on Time.time OR Time.unscaledTime would pause if the game is paused in the editor (or even paused via timeScale in game, for Time.time)

Also the class is missing a "RuntimeInitializeOnLoad" to clear the static dictionary, which means timers would survive the playmode if the faster-playmode-options are used (https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3)

Extend/explain Conventional Commits standard

During tech meeting team noticed that we should add more info about Conventional Commits standard that should help new developers start using it and make their commits under world-wide known standard across different projects.

TransformExtensions code review

public static Transform Clear(this Transform transform, bool activeOnly = false)
{
if (transform.childCount == 0)
return transform;
var children = transform.GetComponentsInChildren<Transform>();
foreach (var child in children)
{
if (child == transform || child == null) continue;
if (activeOnly && !child.gameObject.activeSelf) continue;
Object.DestroyImmediate(child.gameObject);
}
return transform;

using GetComponent is kinda inefficient. you can do this:

for(int i = transform.childCount-1; i >= 0; --i){
    Object.DestroyImmediate(transform.GetChild(i));
}

part.parent = transform;
part.Reset();

if you'd use part.SetParent(transform, false) you could skip the part.Reset() call.

EnumUtility (kinda code-review)

Just stumbled upon this project.

was looking through the code a bit and found the Enum Utility:

public static class EnumUtility

A bit of code-review:

  • all methods should have generic constraints: where T : struct, Enum
  • there already is a Enum.TryParse<T> method in .net standard 2.1 (https://docs.microsoft.com/en-us/dotnet/api/system.enum.tryparse?view=netcore-2.1), it should be faster than catching an exception.
  • CanBeParsedToEnum is the same as Enum.TryParse("my string", out _) (the _ omitting the result if not needed)
  • ParseEnum should be named ParseOrDefault the name does not need to contain the word "Enum" as the static class already has the word "Enum" in it. also an optional parameter of type T to be able to define the default would be good. Also using the Enum.TryParse method instead of handling exceptions should result in a cleaner code.

Vector3Extensions/Vector2Extensions kinda CodeReview

Mismatched version for 1.0.0 release

The version in package.json of tag/1.0.0 is still 0.0.1. Align the version then re-tag will fix it. If your package is already published to the NPM registry, where republishing an existed version is disallowed, you have to bump the version to 1.0.1 to fix it.

The issue is captured by OpenUPM build pipelines (the build issues section). OpenUPM is an alternative to the NPM registry, which is dedicated to open-source UPM packages. It monitors the new Git tag and builds a package release from it automatically. After your fix, our build pipelines will process a build, in roughly 5-10 minutes. Feel free to submit your packages to the platform.

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.