INTERNAL COMPILER ERROR IN UNITY3D

0 votes
I have used  the dll from sample because it contained the warp client   but on accessing my javascript variable in app42's

C# sharp file i recieve an internal compiler error.

I'd like to add this it also says about method oncollison enter,stay or exit.
asked Jul 3, 2014 in AppWarp by souravsachdeva73 (10 points)
edited Jul 3, 2014 by souravsachdeva73
Hey,

Can you share the details of error that you are getting? Also please provide us more details on how are you using our SDK in your project.
Internal compiler error: $OnCollisionEnter$4 (CS0584)
(Assembly- Error CS1061: Type `object' does not contain a definition for `x' and no extension method `x' of type `object' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Assembly-CSharp)


and the error goes away as soon as comment the function On Collision Enter,stay or exit.



and this is my simple code of on collision enter




function OnCollisionEnter(collideswithtable:Collision)
{
 
    if(collideswithtable.collider.tag=="table")
           {
           if(isSoundOn)
           {
           audio.clip=P1HitTable;
           Debug.Log("playing sound");
           audio.Play();
           yield WaitForSeconds(2);
           audio.Stop();
           isSoundOn=false;
           
          }
          
      }
      }

1 Answer

0 votes

Hey,

The sample that we made were, written in C#, therefore you might be getting issues. But our SDK is fully compatible with JavaScript for Unity too. All you need to do is write your code dealing with appwarp also in Javascript. You can also use our sample as reference and re-write the code in Javascript. 

Here I am posting a code snippet to show how you can write code in JavaScript
 

#pragma strict
 
import com.shephertz.app42.gaming.multiplayer.client;
import com.shephertz.app42.gaming.multiplayer.client.listener;
import com.shephertz.app42.gaming.multiplayer.client.events;
 
public var APP_KEY = "YOUR APP KEY";
public var SECRET_KEY = "YOUR SECRET KEY";
private var USER = "YOUR USERNAME";
 
public class Listener implements ConnectionRequestListener
{
         public function onConnectDone(eventObj:ConnectEvent){
         Debug.Log("onConnectDone : " + eventObj.getResult ());
}
 
public function onDisconnectDone(eventObj:ConnectEvent){}
 
public function onInitUDPDone(resultCode:byte){}
}
 
function Start () {
         WarpClient.initialize (APP_KEY, SECRET_KEY);
         WarpClient.GetInstance().AddConnectionRequestListener(new Listener());
         USER = System.DateTime.UtcNow.Ticks.ToString();
         WarpClient.GetInstance ().Connect (USER);
}
 
function Update () {
         WarpClient.GetInstance().Update();
}
I hope this will solve your problem. If the problem continues, please also share your code snippets and provide more details on how are you integrating AppWarp SDK in your project. 
answered Jul 4, 2014 by Suyash Mohan (900 points)
I have found that error shows up on yield statement inside oncollision enter.
trying to find a reason.
i'm talking the dll file from sample project  and putting it in my current project , as the dll from the site is not having a warp client and i don't know how to add one.
can you help me with a little code snippet of listener file too.
What error do you face while using the DLL from our web site? Also what are you using AppWarp Cloud or AppWarp S2?

In the above code snippet you can see how to implement a listener in JavaScript what else do you want to know about implementing listeners?

As the above code you posted for OnCollisionEnter does not have any AppWarp related code, I don't think the issue is related to AppWarp and for Unity related issues you should post it them on Unity forum.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...