These are chat archives for CoraleStudios/Colore

8th
Mar 2016
Nico
@njbmartin
Mar 08 2016 09:43
@/all Does anyone use the WPF color conversion within Colore?
Adam Hellberg
@Sharparam
Mar 08 2016 12:59
@njbmartin Is it not working?
Nico
@njbmartin
Mar 08 2016 13:00
it's not compatible with Unity
[10:00:09] Nico: it's because it's referencing the PresentationCore
[10:00:32] Nico: which Unity's subversion of the .net framework doesn't have
[10:00:43] Nico: and there's no way to reference it
Adam Hellberg
@Sharparam
Mar 08 2016 13:01
hm
Nico
@njbmartin
Mar 08 2016 13:01
so there are two immediate options
Adam Hellberg
@Sharparam
Mar 08 2016 13:01
if you remove the implicit converters and only leave the From* static methods, does it work without referencing presentationcore?
and does unity define any preprocessor flags?
Nico
@njbmartin
Mar 08 2016 13:02
it's a limitation within unity
i modified Colore to remove all reference to WPFcolor
let me see if leaving the assembly reference will work
Adam Hellberg
@Sharparam
Mar 08 2016 13:04
when the types are only used in static methods it shouldn't require referencing the library unless the methods are used. (implicit and i guess explicit conversion operators are considered in use probably)
Nico
@njbmartin
Mar 08 2016 13:06
yeah, leaving the reference works fine
i believe Unity uses reflection
Adam Hellberg
@Sharparam
Mar 08 2016 13:08
so when removing only the implicit operators it works without doing anything else?
Nico
@njbmartin
Mar 08 2016 13:09
FromWpfColor needs to go etc.
Adam Hellberg
@Sharparam
Mar 08 2016 13:09
Unity doesn't seem to follow .NET standards then
Nico
@njbmartin
Mar 08 2016 13:10
no it doesn't, it specifically removes certain references
Adam Hellberg
@Sharparam
Mar 08 2016 13:11
so it claims to use .NET x.xx but then doesn't actually include .NET x.xx but only a subset of it?
Nico
@njbmartin
Mar 08 2016 13:11
particularly around input
precisely
Adam Hellberg
@Sharparam
Mar 08 2016 13:13
and if you create a regular C# project, does it currently require manually referencing presentation core even if not using the wpf methods?
Nico
@njbmartin
Mar 08 2016 13:16
manually reference
Adam Hellberg
@Sharparam
Mar 08 2016 13:16
and if leaving only the static methods?
(removing the implicit cast operators)
Nico
@njbmartin
Mar 08 2016 13:18
one sec
methods need removing too
smaller error message though
:P
Adam Hellberg
@Sharparam
Mar 08 2016 13:22
that's weird
when it's isolated to a method it should only require a reference if the code in some way makes use of them (directly or indirectly)
Nico
@njbmartin
Mar 08 2016 13:22

File name: 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)

Adam Hellberg
@Sharparam
Mar 08 2016 13:22
what is the error
Nico
@njbmartin
Mar 08 2016 13:23
CompleteProject.EnemyHealth.ChromaDevicesSet(Corale.Colore.Core.Color) ---> System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
so even with the methods, reflection is still trying to dynamically load the dependencies
for each method
Adam Hellberg
@Sharparam
Mar 08 2016 13:24
where is the reflection coming from
Nico
@njbmartin
Mar 08 2016 13:24
Unity
Adam Hellberg
@Sharparam
Mar 08 2016 13:24
i was saying to test in a normal project :P
we already established unity derps out on the references
i'd test myself but i'm at uni
Nico
@njbmartin
Mar 08 2016 13:25
it would work fine with a normal project because it's not loaded the same way Unity loads it
Adam Hellberg
@Sharparam
Mar 08 2016 13:25
we had issues with it not working when done as constructors so we moved to the static From* method design instead
but i'm not sure about the implicit cast operators
Nico
@njbmartin
Mar 08 2016 13:32
so using Assembly.LoadFile("N:\Development\Colore\Corale.Colore\bin\Debug\Corale.Colore.dll"); behaves normally in a simple console application
even when targetting .net 2.0
Adam Hellberg
@Sharparam
Mar 08 2016 13:33
stupid unity
what's the best way to do this then
Nico
@njbmartin
Mar 08 2016 13:33
so, options
Brandon Scott
@brandonscott
Mar 08 2016 13:33
Specific Unity build?
Adam Hellberg
@Sharparam
Mar 08 2016 13:33
cover wpf/winforms code in #ifdef's to check for unity or a completely separate build?
Nico
@njbmartin
Mar 08 2016 13:33
btw, we need to get this fixed before GDC haha
Adam Hellberg
@Sharparam
Mar 08 2016 13:33
and how do we manage the separate build
when is GDC
maybe move this to slack
Nico
@njbmartin
Mar 08 2016 13:34
weekend i believe
Brandon Scott
@brandonscott
Mar 08 2016 13:34
slack