Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
763 changes: 763 additions & 0 deletions Assets/Unity Extended/Examples/Color Test/ColorScene.unity

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions Assets/Unity Extended/Examples/Color Test/ColorSceneController.cs

This file was deleted.

10 changes: 6 additions & 4 deletions Assets/Unity Extended/Scripts/Extensions/Vector2Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

namespace UnityExtended.Extensions
{
/// <summary>
/// Class used to create more methos to Vector2 class
/// </summary>
public static class Vector2Extension//TODO : Vector 3 Extensions
public static class Vector2Extension
{
/// <summary>
/// Convert the current Vector2 to absolute integer Values
Expand Down Expand Up @@ -61,6 +58,11 @@ public static float GetAngle(this Vector2 vector2,Vector2 target)
return direction.ToAngle();
}

/// <summary>
/// Converts the current Vector 2 to angle
/// </summary>
/// <param name="vector2"></param>
/// <returns></returns>
public static float ToAngle(this Vector2 vector2)
{
float angle = Mathf.Atan2(vector2.y, vector2.x) * Mathf.Rad2Deg;
Expand Down
16 changes: 16 additions & 0 deletions Assets/Unity Extended/Scripts/Extensions/Vector3Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using UnityEngine;

namespace UnityExtended.Extensions
{
public static class Vector3Extension
{
public static Vector3 ToAbsolute(this Vector3 vector2)
{
int x = Convert.ToInt32(Math.Abs(vector2.x));
int y = Convert.ToInt32(Math.Abs(vector2.y));
int z = Convert.ToInt32(Math.Abs(vector2.z));
return new Vector3(x, y,z);
}
}
}
16 changes: 11 additions & 5 deletions Assets/Unity Extended/Scripts/Utils/IListExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
using System.Collections.Generic;
using UnityEngine;

namespace UnityExtended.Extensions
namespace UnityExtended.Utils
{
public static class IListExtensions
{
{
/// <summary>
/// Returns a default value of a list
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="list"></param>
/// <returns></returns>
/// <typeparam name="T">The type of the current List/Array</typeparam>
/// <returns>Returns a random item from <paramref name="list"/></returns>
public static T GetRandom<T>(this IList<T> list)
{
if(list == null)return default;
return list[Random.Range(0,list.Count)];
}

/// <summary>
/// Return a random Item from an array/List
/// </summary>
/// <typeparam name="T">The type of the current List/Array</typeparam>
/// <param name="min">The min value in the list wich will be searched</param>
/// <param name="max">The min value in the list wich will be searched</param>
/// <returns>Returns a random item from <paramref name="list"/> between <paramref name="min"/> and <paramref name="max"/> </returns>
public static T GetRandomInRange<T>(this IList<T> list,int min, int max)
{
if(min <= 0 && max <= 0 ) throw new System.InvalidOperationException("The min|max params must be absolute integers");
Expand Down
9 changes: 4 additions & 5 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.0",
"com.unity.ide.vscode": "1.1.2",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.test-framework": "1.0.13",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.2.0",
"com.unity.test-framework": "1.1.13",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.1.0",
"com.unity.timeline": "1.2.6",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
20 changes: 17 additions & 3 deletions ProjectSettings/EditorSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,33 @@
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 9
m_ExternalVersionControlSupport: Visible Meta Files
m_SerializationMode: 2
m_LineEndingsForNewScripts: 0
m_DefaultBehaviorMode: 1
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}
m_SpritePackerMode: 4
m_SpritePackerPaddingPower: 1
m_EtcTextureCompressorBehavior: 1
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref
m_ProjectGenerationRootNamespace:
m_UserGeneratedProjectSuffix:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_ShowLightmapResolutionOverlay: 1
m_UseLegacyProbeSampleCount: 1
m_AssetPipelineMode: 1
m_CacheServerMode: 0
m_CacheServerEndpoint:
m_CacheServerNamespacePrefix: default
m_CacheServerEnableDownload: 1
m_CacheServerEnableUpload: 1
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.2.11f1
m_EditorVersionWithRevision: 2019.2.11f1 (5f859a4cfee5)
m_EditorVersion: 2019.3.13f1
m_EditorVersionWithRevision: 2019.3.13f1 (d4ddf0d95db9)
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Unity Extended
This is my unity package with useful stuff to unity game development. More stuff will be putted here as i learn more.

## Extensions
Some useful extension methods to build-in unity classes.

## Attributes
Unity Attributes to classes and fields

## Utils
Some extension to C# buld-in classes
## Architeture
[Architeture](!architeture.png)
Binary file added architeture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.