- Home /
error CS0246
Assets/LCVRKit/Core/Samples/Scripts/LCVRSwapHMD.cs(16,27): error CS0246: The type or namespace name `LCVRPopupLabel' could not be found. Are you missing an assembly reference?
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(); }
}
Comment
Answer by Palaniichuk · Jul 19, 2018 at 12:09 PM
the same error, looks like does not have reference to unity in project,the same error, looks like I do not have reference from unity in project
Your answer
Follow this Question
Related Questions
Im getting this error CS0246 2 Answers
I am getting a error CS0246: 1 Answer
Compiler errors? 2 Answers
Error CS0246 of plugins everytime the project is opened for the first time. 2 Answers