Skip to content

Commit d220967

Browse files
committed
Removed usage of G3_USING_UNITY preprocessor definition, and added an assembly reference to UnityEngine.dll
1 parent 7982934 commit d220967

28 files changed

Lines changed: 552 additions & 144 deletions

.idea/.idea.geometry3Sharp.dir/.idea/contentModel.xml

Lines changed: 358 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/.idea/projectSettingsUpdater.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/.idea/workspace.xml

Lines changed: 153 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.geometry3Sharp.dir/riderModule.iml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Open-Source (Boost-license) C# library for geometric computing.
44

5-
geometry3Sharp is compatible with Unity. Set the G3_USING_UNITY Scripting Define and you will have transparent interop between g3 and Unity vector types (*see details at the very bottom of this README*). Although the library is written for C# 4.5, if you are using the .NET 3.5 Unity runtime, it will still work, just with a few missing features.
5+
geometry3Sharp is compatible with Unity.
66

77
Currently there is a small amount of unsafe code, however this code is only used in a few fast-buffer-copy routines, which can be deleted if you need a safe version (eg for Unity web player).
88

@@ -381,10 +381,8 @@ Several tutorials for using g3Sharp have been posted on the Gradientspace blog:
381381
# Unity Interop
382382

383383
geometry3Sharp supports transparent conversion with Unity types.
384-
To enable this, define **G3_USING_UNITY** in your Unity project, by adding this
385-
string to the **Scripting Define Symbols** box in the **Player Settings**.
386384

387-
Once enabled, code like this will work transparently:
385+
Code like this will work transparently:
388386

389387
~~~~
390388
Vector3 unityVec;

color/Colorb.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
22

3-
#if G3_USING_UNITY
43
using UnityEngine;
5-
#endif
64

75
namespace g3
86
{
@@ -33,7 +31,6 @@ public byte this[int key]
3331
}
3432

3533

36-
#if G3_USING_UNITY
3734
public static implicit operator Colorb(UnityEngine.Color32 c)
3835
{
3936
return new Colorb(c.r, c.g, c.b, c.a);
@@ -42,7 +39,6 @@ public static implicit operator Color32(Colorb c)
4239
{
4340
return new Color32(c.r, c.g, c.b, c.a);
4441
}
45-
#endif
4642

4743
}
4844
}

color/Colorf.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
using System.Collections.Generic;
33
using System.Text;
44

5-
#if G3_USING_UNITY
65
using UnityEngine;
7-
#endif
86

97
namespace g3
108
{
@@ -244,7 +242,6 @@ public static implicit operator Colorf(Vector3f c)
244242

245243

246244

247-
#if G3_USING_UNITY
248245
public static implicit operator Colorf(UnityEngine.Color c)
249246
{
250247
return new Colorf(c.r, c.g, c.b, c.a);
@@ -258,7 +255,6 @@ public static implicit operator Color32(Colorf c)
258255
Colorb cb = c.ToBytes();
259256
return new Color32(cb.r, cb.g, cb.b, cb.a);
260257
}
261-
#endif
262258

263259
}
264260
}

0 commit comments

Comments
 (0)