一、参考场景案例位置

克隆3处,sdk+Input+speed

挂上

 voicetest代码,将voicetest代码分别挂在cube和plane组件上

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class voicetest : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void talk_to_cube()
    {
        Debug.Log("立方体:你呼唤我了!!");
    }
    public void talk_to_Plane()
    {
        Debug.Log("平面:你呼唤我了!!");
    }
}

 

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐