Skip to content

Commit a3a10d8

Browse files
authored
Merge pull request #2 from Chingling152/unity-package
Changes in architeture
2 parents 30ca305 + 0244b8b commit a3a10d8

File tree

10 files changed

+821
-46
lines changed

10 files changed

+821
-46
lines changed

Assets/Unity Extended/Examples/Color Test/ColorScene.unity

Lines changed: 763 additions & 0 deletions
Large diffs are not rendered by default.

Assets/Unity Extended/Examples/Color Test/ColorSceneController.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

Assets/Unity Extended/Scripts/Extensions/Vector2Extensions.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33

44
namespace UnityExtended.Extensions
55
{
6-
/// <summary>
7-
/// Class used to create more methos to Vector2 class
8-
/// </summary>
9-
public static class Vector2Extension//TODO : Vector 3 Extensions
6+
public static class Vector2Extension
107
{
118
/// <summary>
129
/// Convert the current Vector2 to absolute integer Values
@@ -61,6 +58,11 @@ public static float GetAngle(this Vector2 vector2,Vector2 target)
6158
return direction.ToAngle();
6259
}
6360

61+
/// <summary>
62+
/// Converts the current Vector 2 to angle
63+
/// </summary>
64+
/// <param name="vector2"></param>
65+
/// <returns></returns>
6466
public static float ToAngle(this Vector2 vector2)
6567
{
6668
float angle = Mathf.Atan2(vector2.y, vector2.x) * Mathf.Rad2Deg;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using UnityEngine;
3+
4+
namespace UnityExtended.Extensions
5+
{
6+
public static class Vector3Extension
7+
{
8+
public static Vector3 ToAbsolute(this Vector3 vector2)
9+
{
10+
int x = Convert.ToInt32(Math.Abs(vector2.x));
11+
int y = Convert.ToInt32(Math.Abs(vector2.y));
12+
int z = Convert.ToInt32(Math.Abs(vector2.z));
13+
return new Vector3(x, y,z);
14+
}
15+
}
16+
}

Assets/Unity Extended/Scripts/Utils/IListExtensions.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
using System.Collections.Generic;
22
using UnityEngine;
33

4-
namespace UnityExtended.Extensions
4+
namespace UnityExtended.Utils
55
{
66
public static class IListExtensions
7-
{
7+
{
88
/// <summary>
99
/// Returns a default value of a list
1010
/// </summary>
11-
/// <typeparam name="T"></typeparam>
12-
/// <param name="list"></param>
13-
/// <returns></returns>
11+
/// <typeparam name="T">The type of the current List/Array</typeparam>
12+
/// <returns>Returns a random item from <paramref name="list"/></returns>
1413
public static T GetRandom<T>(this IList<T> list)
1514
{
1615
if(list == null)return default;
1716
return list[Random.Range(0,list.Count)];
1817
}
1918

19+
/// <summary>
20+
/// Return a random Item from an array/List
21+
/// </summary>
22+
/// <typeparam name="T">The type of the current List/Array</typeparam>
23+
/// <param name="min">The min value in the list wich will be searched</param>
24+
/// <param name="max">The min value in the list wich will be searched</param>
25+
/// <returns>Returns a random item from <paramref name="list"/> between <paramref name="min"/> and <paramref name="max"/> </returns>
2026
public static T GetRandomInRange<T>(this IList<T> list,int min, int max)
2127
{
2228
if(min <= 0 && max <= 0 ) throw new System.InvalidOperationException("The min|max params must be absolute integers");

Packages/manifest.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"com.unity.2d.sprite": "1.0.0",
44
"com.unity.collab-proxy": "1.2.16",
55
"com.unity.ext.nunit": "1.0.0",
6-
"com.unity.ide.rider": "1.1.0",
7-
"com.unity.ide.vscode": "1.1.2",
8-
"com.unity.package-manager-ui": "2.2.0",
9-
"com.unity.test-framework": "1.0.13",
6+
"com.unity.ide.rider": "1.1.4",
7+
"com.unity.ide.vscode": "1.2.0",
8+
"com.unity.test-framework": "1.1.13",
109
"com.unity.textmeshpro": "2.0.1",
11-
"com.unity.timeline": "1.1.0",
10+
"com.unity.timeline": "1.2.6",
1211
"com.unity.ugui": "1.0.0",
1312
"com.unity.modules.ai": "1.0.0",
1413
"com.unity.modules.androidjni": "1.0.0",

ProjectSettings/EditorSettings.asset

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
--- !u!159 &1
44
EditorSettings:
55
m_ObjectHideFlags: 0
6-
serializedVersion: 7
6+
serializedVersion: 9
77
m_ExternalVersionControlSupport: Visible Meta Files
88
m_SerializationMode: 2
99
m_LineEndingsForNewScripts: 0
1010
m_DefaultBehaviorMode: 1
11+
m_PrefabRegularEnvironment: {fileID: 0}
12+
m_PrefabUIEnvironment: {fileID: 0}
1113
m_SpritePackerMode: 4
1214
m_SpritePackerPaddingPower: 1
1315
m_EtcTextureCompressorBehavior: 1
1416
m_EtcTextureFastCompressor: 1
1517
m_EtcTextureNormalCompressor: 2
1618
m_EtcTextureBestCompressor: 4
17-
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
19+
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref
1820
m_ProjectGenerationRootNamespace:
19-
m_UserGeneratedProjectSuffix:
2021
m_CollabEditorSettings:
2122
inProgressEnabled: 1
23+
m_EnableTextureStreamingInEditMode: 1
24+
m_EnableTextureStreamingInPlayMode: 1
25+
m_AsyncShaderCompilation: 1
26+
m_EnterPlayModeOptionsEnabled: 0
27+
m_EnterPlayModeOptions: 3
28+
m_ShowLightmapResolutionOverlay: 1
29+
m_UseLegacyProbeSampleCount: 1
30+
m_AssetPipelineMode: 1
31+
m_CacheServerMode: 0
32+
m_CacheServerEndpoint:
33+
m_CacheServerNamespacePrefix: default
34+
m_CacheServerEnableDownload: 1
35+
m_CacheServerEnableUpload: 1

ProjectSettings/ProjectVersion.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2019.2.11f1
2-
m_EditorVersionWithRevision: 2019.2.11f1 (5f859a4cfee5)
1+
m_EditorVersion: 2019.3.13f1
2+
m_EditorVersionWithRevision: 2019.3.13f1 (d4ddf0d95db9)

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Unity Extended
22
This is my unity package with useful stuff to unity game development. More stuff will be putted here as i learn more.
33

4-
## Extensions
5-
Some useful extension methods to build-in unity classes.
6-
7-
## Attributes
8-
Unity Attributes to classes and fields
9-
10-
## Utils
11-
Some extension to C# buld-in classes
4+
## Architeture
5+
[Architeture](!architeture.png)

architeture.png

39.5 KB
Loading

0 commit comments

Comments
 (0)