2024年4月3日发(作者:)

static var

defaultScreenHeight

: int

Description

描述

Default vertical dimension of stand-alone player window.

独立版窗口的默认垂直方向。

Custom player settings.

自定义播放器设置。

// Simple Script that saves and loads custom

// Stand-alone/Web player screen settings among

// Unity Projects

//保存和加载Unity项目的自定义

狗刨学习网

独立版/Web播放器设置

class CustomSettings extends EditorWindow {

function OnGUI() {

compName = eld("Company Name:",

@MenuItem("Examples/Custom Settings")

static function Init() {

}

var window = GetWindow(CustomSettings);

();

var compName : String = "";

var prodName : String = "";

var screenWidth : int = 640;

var screenHeight : int = 480;

var webScreenWidth : int = 640;

var webScreenHeight : int = 480;

var fullScreen : boolean = false;

compName);

prodName = eld("Product Name:",

prodName);

orizontal();

screenWidth = ld("Width:",

screenWidth);

screenHeight = ld("Web Height:",

screenHeight);

izontal();

();

orizontal();

webScreenWidth = ld("Web Width:",

webScreenWidth);

webScreenHeight = ld("Web

Height:", webScreenHeight);

izontal();

fullScreen = ("Full

Screen:",fullScreen);

function SaveSettings() {

yName = compName;

tName = prodName;

tScreenWidth = screenWidth;

tScreenHeight = screenHeight;

tWebScreenWidth = webScreenWidth;

}

orizontal();

if(("Save Values"))

SaveSettings();

if(("Load Values"))

LoadSettings();

izontal();

tWebScreenHeight =

webScreenHeight;

ing("CompName", compName);

ing("ProdName", prodName);

("ScreenWidth", screenWidth);

("ScreenHeight", screenHeight);

("WebScreenWidth", webScreenWidth);

("WebScreenHeight",

tIsFullScreen = fullScreen;

webScreenHeight);

}

function LoadSettings() {

compName = ing("CompName","");

prodName = ing("ProdName","");

screenWidth = ("ScreenWidth", 640);

screenHeight = ("ScreenHeight",480);

webScreenWidth =

("WebScreenWidth",640);

webScreenHeight =

("WebScreenHeiht",480);

}

}