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 提供了额外的知识ÿ…