Unity blog with examples
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Unity Community Index // Gossip
View previous topic :: View next topic  
Author Message
dreamora



Joined: 05 Apr 2008
Posts: 13707
Location: Zürich, Switzerland

PostPosted: Sun Dec 07, 2008 7:14 pm    Post subject: Reply with quote
There is one thing to keep in mind: Unity iPhone only supports .NET 1.1, so if you have a fully fledged Unity .Net 2.0 DLL it won't work on the iPhone version at all.
_________________
Contract work: Past work, experience, technologies
Blog: UnityVersum
Back to top
View user's profile Send private message Visit poster's website
cjcurrie



Joined: 27 Nov 2008
Posts: 231
Location: Boise, United States

PostPosted: Sun Dec 21, 2008 9:09 pm    Post subject: JavaScript Implementation Reply with quote
Hi,

Maybe this is the wrong place for this, but I was wondering if there was any way to implement AngryAnt's Behave using Javascript, or if you have to use C# or Boo only for Agent Interfaces.

Basically, I don't know either C# or Boo very well Wink I'm a JavaScripter.

_________________
CJ Currie
Co-Owner, Black Storms Studios, LLC.

Check out my Unity development blog:
http://cjcurrie.net/
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Arges



Joined: 05 Oct 2008
Posts: 287

PostPosted: Mon Dec 22, 2008 1:03 am    Post subject: Reply with quote
This might be of assistance in implementing interfaces, but I haven't tried it myself:

http://www.unifycommunity.com/wiki/index.php?title=JavaScript_Type_Inference#.28.21.29_A_Word_of_Caution_About_Interfaces

Someone else was having trouble with it on the forums, so perhaps a comment on that thread would bring some pointers:

http://forum.unity3d.com/viewtopic.php?t=15134

Not sure how you'd handle the enum comparison, since Unity's quasi-Javascript doesn't seem to support them, but you might be fine when simply comparing it against the predefined values.

As an aside I'm not very partial to Unity's "Javascript", and in general it seems to be there mostly to provide an easy point of entry. It might be worth to pick up one of the other languages if you're getting into more complex code.

_________________
Ricardo J. Méndez
http://www.arges-systems.com/
Back to top
View user's profile Send private message Visit poster's website
Eric5h5



Joined: 19 Jul 2006
Posts: 10851

PostPosted: Mon Dec 22, 2008 2:37 am    Post subject: Reply with quote
Arges wrote:
Not sure how you'd handle the enum comparison, since Unity's quasi-Javascript doesn't seem to support them, but you might be fine when simply comparing it against the predefined values.


Code:
enum FileType {SceneLoad, HeightmapLoad, TextureLoad, SceneSave, HeightmapSave, SplatmapSave, ColormapSave, ObjSave}
private var fileType : FileType;

function FileWindow () {
   // some stuff
   if (fileType <= FileType.TextureLoad) {
      // do loading stuff here
   }
   else {
      // do saving stuff here
   }
}


That's from Fractscape, which is in Javascript, and not lacking in complexity. Wink

--Eric
Back to top
View user's profile Send private message Visit poster's website
Arges



Joined: 05 Oct 2008
Posts: 287

PostPosted: Mon Dec 22, 2008 5:21 am    Post subject: Reply with quote
Hi Eric,

So it can use enums, thanks for the tip. I understood you couldn't declare them, is that correct?

_________________
Ricardo J. Méndez
http://www.arges-systems.com/
Back to top
View user's profile Send private message Visit poster's website
Eric5h5



Joined: 19 Jul 2006
Posts: 10851

PostPosted: Mon Dec 22, 2008 5:43 am    Post subject: Reply with quote
If by declaring them you mean something like

Code:
enum Foo {Blah = 2, Bar = 5, Zoinks = 11}


then yeah, that works too. The only thing I know of that you can't declare in Javascript is multi-dimensional built-in arrays (i.e., "var foo = new float[129,129]" fails), although you can use them through type inference (like with TerrainData.GetHeights).

--Eric
Back to top
View user's profile Send private message Visit poster's website
Arges



Joined: 05 Oct 2008
Posts: 287

PostPosted: Mon Dec 22, 2008 6:25 am    Post subject: Reply with quote
Eric5h5 wrote:
If by declaring them you mean something like

Code:
enum Foo {Blah = 2, Bar = 5, Zoinks = 11}


then yeah, that works too.


Cool, I asked on the IRC channel a couple weeks ago and got a "not supported" reply.

_________________
Ricardo J. Méndez
http://www.arges-systems.com/
Back to top
View user's profile Send private message Visit poster's website
Eric5h5



Joined: 19 Jul 2006
Posts: 10851

PostPosted: Mon Dec 22, 2008 6:33 am    Post subject: Reply with quote
Those wacky IRC people! Wink

--Eric
Back to top
View user's profile Send private message Visit poster's website
David Montgomery-Blake



Joined: 29 Aug 2005
Posts: 82

PostPosted: Mon Dec 22, 2008 6:09 pm    Post subject: Reply with quote
Nice blog. Added it to my feed.
_________________
TorquePowered.com Community Manager and all-around fan of Torque, Unity, and BlitzMax.
Back to top
View user's profile Send private message
Post new topic   Reply to topic    Unity Community Index // Gossip All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum