Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by YoshieMaster · Jan 12, 2011 at 08:09 AM · javascriptapiintegrationkongregate

Cannot initialise Kong API

Im trying to use the Kongregate API but I can't get it working. I have uploaded the unity3d package to Kong (and of course used another script to display the results from this script) but I cannot get it to work. It just says its not connected. Please help! (What I really want is a working out of the box example package. Then I can modify the example.) Also please make your scripts in JavaScript because I actually understand that. This is my code:

var isKongregate = false; var userId = 0; var username = "Guest"; var gameAuthToken = "";

function OnKongregateAPILoaded(userInfoString : String){ // We now know we're on Kongregate isKongregate = true;

// Split the user info up into tokens var params = userInfoString.Split("|"[0]); userId = parseInt(params[0]); username = params[1]; gameAuthToken = params[2];

}

function Awake(){ // Begin the API loading process if it is available Application.ExternalEval( "if(typeof(kongregateUnitySupport) != 'undefined'){" + " kongregateUnitySupport.initAPI('MyUnityObject', 'OnKongregateAPILoaded');" + "};" );

}

function OnGUI(){ GUI.Box(Rect(0,0,100,20),isKongregate.ToString()); }

Thankyou!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Borgo · Jan 13, 2011 at 06:02 PM

Hi,

You have used the same example as me?

http://answers.unity3d.com/questions/35434/unity-kongregate-api-problem

I'm trying to resolve this too. Just follow my question and vote it up, you don't need to post the same question. I'm thinking about to start a bounty for my question.

I sent a email to Kongregate support too.

Good look!!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Borgo · Jan 14, 2011 at 10:39 AM

http://answers.unity3d.com/questions/35434/unity-kongregate-api-problem

Resolved.

In this line:
kongregateUnitySupport.initAPI('MyUnityObject', 'OnKongregateAPILoaded');

MyUnityObject is the name of object on UNITY, so you need to create a object called MyUnityObject and attach the script on it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Help with Kongregate API? 0 Answers

How do I implement the Kongregate api 4 Answers

Using the Kongregate API 1 Answer

LiveGamer Integration 0 Answers

Kongregate Shared Content API 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges