解决问题:
因为该SDK已经自动会识别用户手机类型,因为我需要为摄像机添加OutlineEffect这个脚本,以实现高亮显示,该脚本要求一次只能添加在一个摄像机上。
简单写个脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using cakeslice;//用于高亮显示的插件命名空间引用
public GameObject ARSessionHuaWei;
public GameObject ARSessionAndroidCam;
private void Start()
{
if (ARSessionHuaWei.activeSelf)
{
ARSessionHuaWei.transform.GetChild(0).gameObject.AddComponent<OutlineEffect>();
//通过Transform 类 获取物体第一个子对象,转换成游戏物体,在为其添加脚本组件
Debug.Log("用户使用的是华为手机");
}
if (ARSessionAndroidCam.activeSelf)
{
Debug.Log("用户使用的是其他安卓手机,添加outline effect");