Call from Java Scri...
 
Notifications
Clear all

Call from Java Script (US)

3 Posts
2 Users
0 Reactions
655 Views
(@maglat)
Posts: 2
New Member
Topic starter
 

Hey hey, 

It would be nice if you could help me out using combu with Java Script.

I already moved all Combu scripts into the Plugins folder but still cant access the CombuManager by Java.

In my java script I tried this,

function Start(){
var cbManager : CombuManager = FindObjectOfType(CombuManager);
}

but Unity only gave me following error:

"Assets/Scripts/GUI_Ingame_Handler.js(43,17): BCE0018: The name 'CombuManager' does not denote a valid type ('not found'). "

How can I solve this?

 

Many thanks in advance.

 
Posted : 17/11/2015 12:43 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Are you sure you have to place the folder in Plugins? As far as I know to communicate from JS to C# you should have the C# scripts inside "Standard Assets".

Also all core classes are inside the namespace Combu, now I'm not so experienced in UnityJS but may be you should have "import Combu;" as first line in the scripts that need to access the core classes.

Besides that, I see in your sample code you're using FindObjectOfType, you don't need it but just use instance:

function Start() {
   while (!CombuManager.isInitialized)
      yield;
   // Now you can use CombuManager.instance
}

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 18/11/2015 1:23 am
(@maglat)
Posts: 2
New Member
Topic starter
 

"import Combu;" does the trick!

Many thanks it works now!

 
Posted : 18/11/2015 11:49 pm
Share: