Unity5 development note

本文介绍了在Unity中导入Google VR包后遇到的构建错误,并提供了详细的解决方案。错误出现在尝试构建为Web Player目标平台时,涉及到EmulatorClientSocket.cs文件中的System.Diagnostics.Process类使用问题。文章指导用户如何通过更改构建目标来解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. After import GoogleVRForUnity.unitypackage, when build the project, some error occurs.

Error log:

Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs(79,17): error CS1061: Type `System.Diagnostics.Process' does not contain a definition for `Close' and no extension method `Close' of type `System.Diagnostics.Process' could be found (are you missing a using directive or an assembly reference?)

 Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs(74,46): error CS0120: An object reference is required to access non-static member `System.Diagnostics.Process.Start()'

Solution:

http://answers.unity3d.com/questions/1203476/google-cardboard-sdk-script-errors.html

Because the default build target in Unity5 is Web player, you can change the build target into Android to solve this problem.

(File - Build Settings - Platform - 'select Android' - switch platform)




FUNC (Std_ReturnType, PDUR_CODE) PduR_GenericIfTransmit ( PduIdType TxPduId, P2CONST(PduInfoType, AUTOMATIC, PDUR_APPL_DATA) PduInfoPtr, uint8 RTabUpIfConfigIdx ) { /* initialize return value */ Std_ReturnType RetVal = E_NOT_OK; /* pointer to configuration */ CONSTP2CONST(PduR_RTabUpIfTxConfigType, AUTOMATIC, PDUR_APPL_CONST) pRTabUpIfTxConfig = &PduR_GConfigPtr->PduR_RTabUpIfTxConfig[RTabUpIfConfigIdx]; DBG_PDUR_GENERICIFTRANSMIT_ENTRY(TxPduId, PduInfoPtr, RTabUpIfConfigIdx); /* check if PDU Router is initialized */ if(PduR_State == PDUR_UNINIT) { /* according to PDUR330, no routing shall be performed in the uninitialized state */ #if (PDUR_DEV_ERROR_DETECT == STD_ON) /* reported to Det in development mode */ PDUR_DET_REPORT_ERROR(PDUR_SID_UP_TX, PDUR_E_INVALID_REQUEST); } /* range check of PDU ID */ else if (TxPduId >= pRTabUpIfTxConfig->RTabTxCount) { PDUR_DET_REPORT_ERROR(PDUR_SID_UP_TX, PDUR_E_PDU_ID_INVALID); } /* check if input parameter is not NULL */ else if (PduInfoPtr == NULL_PTR) { PDUR_DET_REPORT_ERROR(PDUR_SID_UP_TX, PDUR_E_NULL_POINTER); #endif /* #if (PDUR_DEV_ERROR_DETECT == STD_ON) */ } else { /* pointer to routing table */ CONSTP2CONST(PduR_RTabUpIfTxType, AUTOMATIC, PDUR_APPL_CONST) pIfRTabUpTx = PDUR_GET_CONFIG_ADDR(PduR_RTabUpIfTxType, pRTabUpIfTxConfig->RTabTxRef); #if (PDUR_ROUTINGPATHGROUPS_SUPPORT == STD_ON) /* get destination PDU routing path group ID from routing table */ const PduR_RoutingPathGroupIdType GroupId = pIfRTabUpTx[TxPduId].RPathGroupId; /* destination is either enabled or not referenced by a routing path group, Note: Order of OR condition on purpose for faster evaluation and preventing call of PduR_IsRoutingPathGroupEnabled with PDUR_ROUTINGPATHGROUP_GO_THROUGH_ID */ /* Deviation MISRAC2012-1 */ if((GroupId == PDUR_ROUTINGPATHGROUP_GO_THROUGH_ID) || (PduR_IsRoutingPathGroupEnabled(GroupId) != FALSE)) #endif /* (PDUR_ROUTINGPATHGROUPS_SUPPORT == STD_ON) */ { /* reference to set of target If-module API-functions */ const PduR_RefToModuleAPI TargetAPIRef = pIfRTabUpTx[TxPduId].TargetModuleAPIRef; /* pointer to Transmit function */ const PduR_TransmitFpType TransmitFp = PduR_IfModuleAPI[TargetAPIRef].IfTransmit; #if (PDUR_DEV_ERROR_DETECT == STD_ON) /* check if target function pointer is equal to null pointer */ /* CHECK: NOPARSE */ if(NULL_PTR == TransmitFp) { /* in the sense of defensive programming, call assertion if * target function pointer is equal to null pointer */ PDUR_UNREACHABLE_CODE_ASSERT(PDUR_SID_UP_TX); /* RetVal is still E_NOT_OK */ } else /* CHECK: PARSE */ #endif /* #if (PDUR_DEV_ERROR_DETECT == STD_ON) */ { /* get target PDU ID */ const PduR_PduIdType TargetPduId = pIfRTabUpTx[TxPduId].TargetPduId; /* call Transmit function */ RetVal = TransmitFp(TargetPduId, PduInfoPtr); } } } DBG_PDUR_GENERICIFTRANSMIT_EXIT(RetVal, TxPduId, PduInfoPtr, RTabUpIfConfigIdx); return RetVal; }
最新发布
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值