AR Foundation演示项目,使用 AR Foundation 4.1.7 并围绕某些功能演示更高级功能。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

33 行
844 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ContactPosition : MonoBehaviour
{
private Material m_TargetMaterial;
private int m_PropertyHash;
public GameObject m_TargetObject;
// Start is called before the first frame update
void Start()
{
m_PropertyHash = Shader.PropertyToID("_ContactPosition");
m_TargetMaterial = m_TargetObject.GetComponent<Renderer>().sharedMaterial;
}
// Update is called once per frame
void Update()
{
m_TargetMaterial.SetVector(m_PropertyHash, transform.position);
//if(Input.GetKey(KeyCode.A))
//{
// m_TargetMaterial.SetFloat("_IsInContact", 1.0f);
//}
//else
//{
// m_TargetMaterial.SetFloat("_IsInContact", 0);
//}
}
}