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 John-Lisenby · Oct 22, 2014 at 01:51 PM · c#windows 8

UnityEngine.WSA Not found

Hello,

I am building a Windows Store application using the below script. I am getting error Error 5 The type or namespace name 'WSA' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) I am still learning Unity and C#, but I once had the same issue in another app but some how I got it working. How do I get the WSA added into the UnityEngine?

Thanks,

John

code:

 using UnityEngine;
 #if UNITY_WINRT
 using System;
 using System.Collections;
 using System.Threading;
 using System.IO;
 
 
 
 /// <summary>
 /// Windows specific and interop between Unity and Windows Store or Windows Phone 8
 /// </summary>
 public static class WindowsGateway
 {
     //notes
     static WindowsGateway()
     {
 #if UNITY_METRO
         // unity now supports handling size changed in 4.3
         //UnityEngine.WSA.Application.windowSizeChanged += WindowSizeChanged;
         UnityEngine.WSA.Application.windowSizeChanged += WindowSizeChanged;
 #endif
 
         // create blank implementations to avoid errors within editor
         UnityLoaded = delegate { };
 
         //blank implementation for our Share function
         ShareHighScore = delegate { };
 
     }
 
     /// <summary>
     /// Called from Unity when the app is responsive and ready for play
     /// </summary>
     public static Action UnityLoaded;
 
     //called when we want to Share a high score
     public static Action ShareHighScore;
 
 #if UNITY_METRO
     /// <summary>
     /// Deal with windows resizing
     /// </summary>
     public static void WindowSizeChanged(int width, int height)
     {
         if (width <= GameManager.Instance.startingScreenSize.Width / 2)
         {
             //GameManager.Instance.paused();
             Pause.paused = true;
 
         }
         else
         {
             //GameManager.Instance.unpaused();
             Pause.paused = false;
         }
 
     }
 #endif
 
 }
 
 #endif

Comment
Add comment · Show 1
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 BoiseBaked · Jan 28, 2015 at 06:30 PM 0
Share

John, did you figure out how to resolve this issue? I'm having the same issue with Unity Pro for Windows 4.5.5p5.

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by BoiseBaked · Jan 28, 2015 at 10:25 PM

Using "Unity Pro for Windows" 4.5.5.p5.

I'm trying a hack workaround. I don't like it but there no other option.

The problem is that even though the Unity Editor is setup for the Windows Store platform, XAML C# Solution Type and Phone 8.1 SDK, the wrong UnityEngine.dll is deployed to "[Unity project dir]\Library\UnityAssemblies\" directory. The UnityEngine.dll found in the directory does not contain the UnityEngine.WSA namespace. I found the correct .dll file in the following path: "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\metrosupport\Tools\" directory. So what else could I do, in the UnityAssemblies directory, I renamed the existing UnityEngine.dll and UnityEngine.xml files, and copied the correct .dll file to the UnityAssemblies directory. A correct UnityEngine.xml file gets generated in when rebuilding Unity Editor code.

I'm going to have do this copy hack every time I re-import all.

Please, could we get some real Unity support/help here.

John W.

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 John-Lisenby · Jan 28, 2015 at 11:32 PM

Hi,

I used the same workaround you used from above. I just pointed/added in the dll(UnityEngine.dll)in Unity program files folder. I got it working.

Sorry for the late reply long day at work.

John L

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 gyygyygyy · Sep 27, 2018 at 11:44 AM

Assets/Utilities/Scripts/Anchor.cs(5,22): error CS0234: The type or namespace name WSA' does not exist in the namespace UnityEngine.VR'. Are you missing an assembly reference?

The above is the problem I encountered.But i can not understand the answer that mentioned above how to implement.I select the universal windows platform and unity version is 2017.4.1.can you help me? thanks very much!,i meet the same problem,but i can not understand how the above answer is implemented,can you answer for me? thanks!

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

I can't get Unity to recognise Random.Range C# 1 Answer

Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer

Flip over an object (smooth transition) 3 Answers


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