unityunity 按键事件无法识别

VMware 虚拟机unity模式怎么不可用,按键呈灰色显示应该如何开启和使用?请详细解答,谢谢。_百度知道
VMware 虚拟机unity模式怎么不可用,按键呈灰色显示应该如何开启和使用?请详细解答,谢谢。
我有更好的答案
1、请查看你的虚拟机是否激活呢?2、你的电脑联网是否安装过VMware
TOOLs ,安装方法为菜单页——管理——安装VMware
TOOLS。注意:如果安装VMware
TOOLS是需要联网的!
采纳率:66%
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。unity3d游戏开发之键盘事件的获取
unity3d游戏开发之键盘事件的获取
浏览次数:3305
浏览次数:871
浏览次数:964
浏览次数:1232
浏览次数:1357
如果你对以下课程意犹未尽,,查看全部课程
HTML5全栈开发
HTML5最新课程
156 人在学
c#编程概述
C#快速入门
简单又好玩
120 人在学
没有账号?
s后重新发送
已有账号?
已有账号?
验证码确认
话题标题:
400-877-8190
登录后反馈他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)按PLAY键无法播放场景,代码看不懂。。。【unity3d吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:82,089贴子:
按PLAY键无法播放场景,代码看不懂。。。收藏
SiKi学院上有大量的项目案例课程,可以让学员随时随地学习!通过案例来从入门到深入的学习Unity!
using Susing UnityEnamespace UnityStandardAssets.ImageEffects{
public enum LensflareStyle34
Ghosting = 0,
Anamorphic = 1,
Combined = 2,
public enum TweakMode34
Basic = 0,
Complex = 1,
public enum HDRBloomMode
public enum BloomScreenBlendMode
Screen = 0,
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu(&Image Effects/Bloom and Glow/BloomAndFlares (3.5, Deprecated)&)]
public class BloomAndFlares : PostEffectsBase
public TweakMode34 tweakMode = 0;
public BloomScreenBlendMode screenBlendMode = BloomScreenBlendMode.A
public HDRBloomMode hdr = HDRBloomMode.A
private bool doHdr =
public float sepBlurSpread = 1.5f;
public float useSrcAlphaAsMask = 0.5f;
public float bloomIntensity = 1.0f;
public float bloomThreshold = 0.5f;
public int bloomBlurIterations = 2;
public bool lensflares =
public int hollywoodFlareBlurIterations = 2;
public LensflareStyle34 lensflareMode = (LensflareStyle34)1;
public float hollyStretchWidth = 3.5f;
public float lensflareIntensity = 1.0f;
public float lensflareThreshold = 0.3f;
public Color flareColorA = new Color(0.4f, 0.4f, 0.8f, 0.75f);
public Color flareColorB = new Color(0.4f, 0.8f, 0.8f, 0.75f);
public Color flareColorC = new Color(0.8f, 0.4f, 0.8f, 0.75f);
public Color flareColorD = new Color(0.8f, 0.4f, 0.0f, 0.75f);
public Texture2D lensFlareVignetteM
public Shader lensFlareS
private Material lensFlareM
public Shader vignetteS
private Material vignetteM
public Shader separableBlurS
private Material separableBlurM
public Shader addBrightStuffOneOneS
private Material addBrightStuffBlendOneOneM
public Shader screenBlendS
private Material screenB
public Shader hollywoodFlaresS
private Material hollywoodFlaresM
public Shader brightPassFilterS
private Material brightPassFilterM
public override bool CheckResources()
CheckSupport(false);
screenBlend = CheckShaderAndCreateMaterial(screenBlendShader, screenBlend);
lensFlareMaterial = CheckShaderAndCreateMaterial(lensFlareShader, lensFlareMaterial);
vignetteMaterial = CheckShaderAndCreateMaterial(vignetteShader, vignetteMaterial);
separableBlurMaterial = CheckShaderAndCreateMaterial(separableBlurShader, separableBlurMaterial);
addBrightStuffBlendOneOneMaterial = CheckShaderAndCreateMaterial(addBrightStuffOneOneShader, addBrightStuffBlendOneOneMaterial);
hollywoodFlaresMaterial = CheckShaderAndCreateMaterial(hollywoodFlaresShader, hollywoodFlaresMaterial);
brightPassFilterMaterial = CheckShaderAndCreateMaterial(brightPassFilterShader, brightPassFilterMaterial);
if (!isSupported)
ReportAutoDisable();
return isS
void OnRenderImage(RenderTexture source, RenderTexture destination)
if (CheckResources() == false)
Graphics.Blit(source, destination);
// screen blend is not supported when HDR is enabled (will cap values)
if (hdr == HDRBloomMode.Auto)
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent&Camera&().
doHdr = hdr == HDRBloomMode.On;
doHdr = doHdr && supportHDRT
BloomScreenBlendMode realBlendMode = screenBlendM
if (doHdr)
realBlendMode = BloomScreenBlendMode.A
var rtFormat = (doHdr) ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.D
RenderTexture halfRezColor = RenderTexture.GetTemporary(source.width / 2, source.height / 2, 0, rtFormat);
RenderTexture quarterRezColor = RenderTexture.GetTemporary(source.width / 4, source.height / 4, 0, rtFormat);
RenderTexture secondQuarterRezColor = RenderTexture.GetTemporary(source.width / 4, source.height / 4, 0, rtFormat);
RenderTexture thirdQuarterRezColor = RenderTexture.GetTemporary(source.width / 4, source.height / 4, 0, rtFormat);
float widthOverHeight = (1.0f * source.width) / (1.0f * source.height);
float oneOverBaseSize = 1.0f / 512.0f;
// downsample
Graphics.Blit(source, halfRezColor, screenBlend, 2); // &- 2 is stable downsample
Graphics.Blit(halfRezColor, quarterRezColor, screenBlend, 2); // &- 2 is stable downsample
RenderTexture.ReleaseTemporary(halfRezColor);
// cut colors (thresholding)
BrightFilter(bloomThreshold, useSrcAlphaAsMask, quarterRezColor, secondQuarterRezColor);
quarterRezColor.DiscardContents();
// blurring
if (bloomBlurIterations & 1) bloomBlurIterations = 1;
for (int iter = 0; iter & bloomBlurI iter++)
float spreadForPass = (1.0f + (iter * 0.5f)) * sepBlurS
separableBlurMaterial.SetVector(&offsets&, new Vector4(0.0f, spreadForPass * oneOverBaseSize, 0.0f, 0.0f));
RenderTexture src = iter == 0 ? secondQuarterRezColor : quarterRezC
Graphics.Blit(src, thirdQuarterRezColor, separableBlurMaterial);
src.DiscardContents();
separableBlurMaterial.SetVector(&offsets&, new Vector4((spreadForPass / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit(thirdQuarterRezColor, quarterRezColor, separableBlurMaterial);
thirdQuarterRezColor.DiscardContents();
// lens flares: ghosting, anamorphic or a combination
if (lensflares)
if (lensflareMode == 0)
BrightFilter(lensflareThreshold, 0.0f, quarterRezColor, thirdQuarterRezColor);
quarterRezColor.DiscardContents();
// smooth a little, this needs to be resolution dependent
separableBlurMaterial.SetVector (&offsets&, Vector4 (0.0ff, (2.0ff) / (1.0ff * quarterRezColor.height), 0.0ff, 0.0ff));
Graphics.Blit (thirdQuarterRezColor, secondQuarterRezColor, separableBlurMaterial);
separableBlurMaterial.SetVector (&offsets&, Vector4 ((2.0ff) / (1.0ff * quarterRezColor.width), 0.0ff, 0.0ff, 0.0ff));
Graphics.Blit (secondQuarterRezColor, thirdQuarterRezColor, separableBlurMaterial);
// no ugly edges!
Vignette(0.975f, thirdQuarterRezColor, secondQuarterRezColor);
thirdQuarterRezColor.DiscardContents();
BlendFlares(secondQuarterRezColor, quarterRezColor);
secondQuarterRezColor.DiscardContents();
// (b) hollywood/anamorphic flares?
// thirdQuarter has the brightcut unblurred colors
// quarterRezColor is the blurred, brightcut buffer that will end up as bloom
hollywoodFlaresMaterial.SetVector(&_threshold&, new Vector4(lensflareThreshold, 1.0f / (1.0f - lensflareThreshold), 0.0f, 0.0f));
hollywoodFlaresMaterial.SetVector(&tintColor&, new Vector4(flareColorA.r, flareColorA.g, flareColorA.b, flareColorA.a) * flareColorA.a * lensflareIntensity);
Graphics.Blit(thirdQuarterRezColor, secondQuarterRezColor, hollywoodFlaresMaterial, 2);
thirdQuarterRezColor.DiscardContents();
Graphics.Blit(secondQuarterRezColor, thirdQuarterRezColor, hollywoodFlaresMaterial, 3);
secondQuarterRezColor.DiscardContents();
hollywoodFlaresMaterial.SetVector(&offsets&, new Vector4((sepBlurSpread * 1.0f / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
hollywoodFlaresMaterial.SetFloat(&stretchWidth&, hollyStretchWidth);
Graphics.Blit(thirdQuarterRezColor, secondQuarterRezColor, hollywoodFlaresMaterial, 1);
thirdQuarterRezColor.DiscardContents();
hollywoodFlaresMaterial.SetFloat(&stretchWidth&, hollyStretchWidth * 2.0f);
Graphics.Blit(secondQuarterRezColor, thirdQuarterRezColor, hollywoodFlaresMaterial, 1);
secondQuarterRezColor.DiscardContents();
hollywoodFlaresMaterial.SetFloat(&stretchWidth&, hollyStretchWidth * 4.0f);
Graphics.Blit(thirdQuarterRezColor, secondQuarterRezColor, hollywoodFlaresMaterial, 1);
thirdQuarterRezColor.DiscardContents();
if (lensflareMode == (LensflareStyle34)1)
for (int itera = 0; itera & hollywoodFlareBlurI itera++)
separableBlurMaterial.SetVector(&offsets&, new Vector4((hollyStretchWidth * 2.0f / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit(secondQuarterRezColor, thirdQuarterRezColor, separableBlurMaterial);
secondQuarterRezColor.DiscardContents();
separableBlurMaterial.SetVector(&offsets&, new Vector4((hollyStretchWidth * 2.0f / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit(thirdQuarterRezColor, secondQuarterRezColor, separableBlurMaterial);
thirdQuarterRezColor.DiscardContents();
AddTo(1.0f, secondQuarterRezColor, quarterRezColor);
secondQuarterRezColor.DiscardContents();
// (c) combined
for (int ix = 0; ix & hollywoodFlareBlurI ix++)
separableBlurMaterial.SetVector(&offsets&, new Vector4((hollyStretchWidth * 2.0f / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit(secondQuarterRezColor, thirdQuarterRezColor, separableBlurMaterial);
secondQuarterRezColor.DiscardContents();
separableBlurMaterial.SetVector(&offsets&, new Vector4((hollyStretchWidth * 2.0f / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit(thirdQuarterRezColor, secondQuarterRezColor, separableBlurMaterial);
thirdQuarterRezColor.DiscardContents();
Vignette(1.0f, secondQuarterRezColor, thirdQuarterRezColor);
secondQuarterRezColor.DiscardContents();
BlendFlares(thirdQuarterRezColor, secondQuarterRezColor);
thirdQuarterRezColor.DiscardContents();
AddTo(1.0f, secondQuarterRezColor, quarterRezColor);
secondQuarterRezColor.DiscardContents();
// screen blend bloom results to color buffer
screenBlend.SetFloat(&_Intensity&, bloomIntensity);
screenBlend.SetTexture(&_ColorBuffer&, source);
Graphics.Blit(quarterRezColor, destination, screenBlend, (int)realBlendMode);
RenderTexture.ReleaseTemporary(quarterRezColor);
RenderTexture.ReleaseTemporary(secondQuarterRezColor);
RenderTexture.ReleaseTemporary(thirdQuarterRezColor);
private void AddTo(float intensity_, RenderTexture from, RenderTexture to)
addBrightStuffBlendOneOneMaterial.SetFloat(&_Intensity&, intensity_);
Graphics.Blit(from, to, addBrightStuffBlendOneOneMaterial);
private void BlendFlares(RenderTexture from, RenderTexture to)
lensFlareMaterial.SetVector(&colorA&, new Vector4(flareColorA.r, flareColorA.g, flareColorA.b, flareColorA.a) * lensflareIntensity);
lensFlareMaterial.SetVector(&colorB&, new Vector4(flareColorB.r, flareColorB.g, flareColorB.b, flareColorB.a) * lensflareIntensity);
lensFlareMaterial.SetVector(&colorC&, new Vector4(flareColorC.r, flareColorC.g, flareColorC.b, flareColorC.a) * lensflareIntensity);
lensFlareMaterial.SetVector(&colorD&, new Vector4(flareColorD.r, flareColorD.g, flareColorD.b, flareColorD.a) * lensflareIntensity);
Graphics.Blit(from, to, lensFlareMaterial);
private void BrightFilter(float thresh, float useAlphaAsMask, RenderTexture from, RenderTexture to)
if (doHdr)
brightPassFilterMaterial.SetVector(&threshold&, new Vector4(thresh, 1.0f, 0.0f, 0.0f));
brightPassFilterMaterial.SetVector(&threshold&, new Vector4(thresh, 1.0f / (1.0f - thresh), 0.0f, 0.0f));
brightPassFilterMaterial.SetFloat(&useSrcAlphaAsMask&, useAlphaAsMask);
Graphics.Blit(from, to, brightPassFilterMaterial);
private void Vignette(float amount, RenderTexture from, RenderTexture to)
if (lensFlareVignetteMask)
screenBlend.SetTexture(&_ColorBuffer&, lensFlareVignetteMask);
Graphics.Blit(from, to, screenBlend, 3);
vignetteMaterial.SetFloat(&vignetteIntensity&, amount);
Graphics.Blit(from, to, vignetteMaterial);
看不懂,不知道
有懂的大神么
与其这样感觉还不如都打包发出来,说不定还有感兴趣的下载下来仔细看看,这样子看着真累
看完这个能累死
有毒啊这个长度还这样发出来,应该是继承类PostEffectsBase没有找到,自己看看是不是没有这个类
登录百度帐号推荐应用}

我要回帖

更多关于 unity3d 虚拟按键 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信