Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
1
Question by Qixis · Aug 09, 2017 at 05:04 PM · errorcs0246

Error CS0246

alt text

 using UnityEngine;
 
 
 public class LCVRSwapHMD : MonoBehaviour
 {
     [SerializeField] private LCVRPopupLabel label;
 
     private int hmdIndex = 0; // 0:hacosco dx 1:google cardboard 2:hacosco(single view)
 
     private void setHMDType(Camera eye, LCVRLens.HMD_TYPE hmdType){
         LCVRLens lens = eye.gameObject.GetComponent<LCVRLens>();
         if (lens != null) lens.HMDType = hmdType;
     }
 
     private void setViewModeAndHMDType(LCVRHead.VIEW_MODE viewMode, LCVRLens.HMD_TYPE hmdType){
         foreach (LCVRHead head in LCVR.Instance.Heads){
             head.ViewMode = viewMode;
 
             if (head.  LeftEye) setHMDType(head.  LeftEye, hmdType);
             if (head.CenterEye) setHMDType(head.CenterEye, hmdType);
             if (head. RightEye) setHMDType(head. RightEye, hmdType);
         }
     }
 
     private void updateHMD(){
         LCVRHead.VIEW_MODE viewMode = LCVRHead.VIEW_MODE.SIDE_BY_SIDE;
         LCVRLens.HMD_TYPE  hmdType  = LCVRLens.HMD_TYPE.HACOSCO_DX;
 
         string  name = null;
 
         switch (hmdIndex){
         case 0: name = "HACOSCO DX"      ; break;
         case 1: name = "Google Cardboard"; hmdType = LCVRLens.HMD_TYPE.GOOGLE_CARDBOARD; break;
         case 2: name = "HACOSCO (Single)"; hmdType = LCVRLens.HMD_TYPE.HACOSCO         ; viewMode = LCVRHead.VIEW_MODE.SINGLE; break;
         }
 
         setViewModeAndHMDType(viewMode, hmdType);
 
         label.Show(name);
     }
 
     public void OnClicked(){
         hmdIndex = (hmdIndex + 1) % 3;
         updateHMD();
     }
 
     private void Start(){ updateHMD(); }
 }

Please explain what the problem is and help fix it.

screenshot-22.jpg (94.6 kB)
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 agariogame2000 · Feb 16, 2018 at 06:25 PM 1
Share

Was you fix it?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Aeleck · Aug 09, 2017 at 05:08 PM

I suggest looking at this post

http://answers.unity3d.com/answers/154757/view.html

As they said, you could be missing the files, or if a namespace is declared, you will need to include it.

Hope it helps!

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

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Compiler errors? 2 Answers

Assets/Editor/CopyMoodBox.cs(7,12): error CS0246: The type or namespace name `MoodBoxData' could not be found. Are you missing a using directive or an assembly reference? 2 Answers

Im getting this error CS0246 2 Answers

I am getting a error CS0246: 1 Answer

Error CS0246 of plugins everytime the project is opened for the first time. 2 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