Application.ExternalEval 外部运行


static function ExternalEval (script : string) : void

Description描述

Evaluates script snippet in the containing web   page (Web Player   only).

调用包含在网页中的片段脚本函数(只用于Web   Player)。

This will execute JavaScript   snippet script in the web page that contains the web   player.

这将执行包含在网页中JavaScript片段script

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {Application.ExternalEval("history.back()");}}
// Navigates to the previous page//返回前一页Application.ExternalEval ("history.back()");

参见:Application.ExternalCall.


,