- Home /
[Windows Store Apps] About Hashtable and Mix of unityscript and C#
I am working on a game for windows store app but there are some problems. My unity version is 4.2.2 and using visual studio 2012. I have two questions:
1.When I have used unity to build and run a solution of type XAML C#. The result of visual studio after compiling said that
error WMC9999: Cannot find type System.Collections.Hashtable in module mscorlib.dll
I have already check another answer for that but it doesn't work for me. If I delete the reference of Boo.lang.dll; then there will be more errors about that.
2.Following that answer, I can compile the D3D11 C# sln in visual studio 2012. But I can only see my game menu but do nothing else, I cannot touch it. So,I checked the exceptions TypeInitializationException about some codes before simulator works and I found some difference about that. It might be no use to the C# classes inherited from a js class?
I have a C# class A inherited form js class B, and B is inherited from MonoBehaviour. Is that possible the functionality of js class B or MonoBehaviour could not be seen in the class A? I am not so sure. Is that better or necessarily to convert js class to C# class? Does it affect the game? The followings are some codes about TypeInitializationException.
//Some Exceptions code sample
//in C# class MenuView, MenuView is inherited from a js class BasicView which is inherited from MonoBehaviour.
public static void create ()
{
if (MenuView.delegates() == null)
ViewPlay.delegates.gameObject.AddComponent<MenuView>();
MenuView.delegates().expireView();
}
//in ViewPlay.cs
void Awake ()
{
delegates = this;
//This code has TypeInitializationException and MainInfoView is inherited from the js class BasicView
gameObject.AddComponent<MainInfoView>();
//This code is normal, BackGroundView is inherited from C# class only.
gameObject.AddComponent<BackGroundView>();
}
Answer by RudinUnity · Oct 29, 2013 at 10:21 AM
Maybe I responds something after that.
By the Unity document, it seems that you should not use Js as a superclass of a C# subclass. It seems to block the community between them. I think you should use all of Js/Boo or C# over all of your script. I spent two days to rewrite the code of Js into C#. Then, it looks better! At least it can respond to my touch and there is no TypeInitializationException before running.
Your answer
![](https://koobas.hobune.stream/wayback/20220613120455im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Upgraded to 2017.1.0f3 and now getting Hashtable reference error Windows Store App 0 Answers
Hashtable used as associative array - how to fetch element value? 2 Answers
Causing a chain reaction and hashtable errors 0 Answers
Return a Hashtable. Warning: Implicit downcast from Object to String. 0 Answers
js to C# - 0 Answers