var person =newObject();// 給對象添加屬性并賦值
person.name="張小明";
person.age=10;
person.foods=["蘋果","橘子","香蕉","葡萄"];// 給對象添加功能函數
person.eat=function(){console.log(this.age+"歲的"+this.name+"喜歡吃:")for(var i =0;i<this.foods.length;i++){console.log(this.foods[i])}}//獲得對象屬性值
console.log(person.name)
console.log(person.age)//調用對象方法
person.eat();
效果
2 通過 { }形式創建對象
語法為 var person ={“屬性名”:“屬性值”,“屬性名”,“屬性值”,“函數名”:函數}
代碼
var person ={"name":"張小明","age":10,"foods":["蘋果","香蕉","橘子","葡萄"],"eat":function(){console.log(this.age+"歲的"+this.name+"喜歡吃:")for(var i =0;i<this.foods.length;i++){console.log(this.foods[i])}}}//獲得對象屬性值
console.log(person.name)
console.log(person.age)//調用對象方法
person.eat();
sherpa-onnx https://github.com/k2-fsa/sherpa-onnx 相關dll和lib庫拷進Unity,官方示例代碼稍作修改
using SherpaOnnx;
using System;
using System.IO;
using System.Runtime.InteropServices;
using UnityEngine;public class TTS : MonoBehaviour
{public st…
前情提要
檢索增強生成(RAG)技術,作為 AI 領域的尖端技術,能夠提供可靠且最新的外部知識,極大地便利了各種任務。在 AI 內容生成的浪潮中,RAG 通過其強大的檢索能力為生成式 AI 提供了額外的知識ÿ…