I’m in the early stages of programming a sort of adventure game. It’s mostly based in java using android activities, but there’s one activity that I embed unity in so I can get some awesome battle scenes
I’m programming the unity side in c#. I’ve basically hit a bit of a mental block in my head. I know how to call c# methods from java and vice versa but I don’t know how to do this efficiently with a lot of data. As I start the unity instance I need to send it the following data:
- list of entities that the player and opponent has ‘equipped’
- list of items both of them have in their ‘bag’
Then for each entity things like:
- health
- moves the entity knows
- more things like this as game evolves
I’ve got it all nailed down as classes in java and c# but obviously I can’t send classes across different languages… So I’m stuck…
I also want to keep this all as DRY as possible, it’d be nice to not have to repeat things like item descriptions in java and the c#(as I’d like the user to be able to access their items in some android activities as well as inside unity)
Thanks
"unsure how to split code" isn't a valid title... also if you want my advice I would convert the US Scripts to C#(or the other way around)... if your new to coding this can take FOREVER(about 35minutes for CharacterMotor for newbies). the reason i do this, is that I find it an utter pain trying to get two languages to cooperate when they compile at different times and ends up being a mess.
– Fornoreason1000@Fornoreason1000 all the unity scripts are already in C#... Is that what you're saying the best choice would be?
– Roarster@Roarster Not all of them... Character Motor, FPSController, most of the image effects are in Unity Script... As for Languages there is no "Best Choice" its a personal preference. I was just saying that mixing two languages in one project can do your head in if your aren't careful. @tbkn Unity Converts both C# in US into its own language(C++?) just at different times, I assume It won't matter once the engine runs on Android since everything should be pre-compiled at that point before doing the Java buisness.
– Fornoreason1000@Fornoreason1000 right, I see, so you're saying I should recode the standard unity scripts that I'm using to c# so that everything in the project is in c#? Isn't that just overkill, considering there are so many guides for using unity in android and none of them mention this issue?
– Roarster