12 第1页 | 共2 页下一页
返回列表 发新帖
查看: 6598|回复: 13
打印 上一主题 下一主题

Awesomium结合Unity3D实现显示网页的效果简介教程

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2011-11-5 11:30:00 |只看该作者 |倒序浏览


            
         



           在unity3d中显示网页的效果实现又多了一个不错的选择,下面是一个简介的使用教程!
           

            This a quick introductory tutorial to using Awesomium with Unity3D.
         



           We’ll walk you through the basics and demonstrate how to display a simple web-page in your 3D scene.
         

            
           


            
           

           Web-Page Displayed in Unity3D using Awesomium
         

           Checklist
           

           Before we start, you will need the following things:
         

           Unity Editor (Basic or Pro)
           

           Awesomium SDK
           

           UnityAwe ZIP — Unity3d Wrapper for Awesomium
           

            
         

           Adding Awesomium to Unity3D on Windows:
           

           We will first need to install the Awesomium SDK and then copy over some files so our scripts will***n within the Unity3D editor:
         

           Install the Awesomium SDK using the default settings (should create a new folder on your Desktop)
           

           Open the awesomium
           


            _
           
           v1.6.x
           
            _
           
           sdk
           
            _
           
           win folder and navigate to buildin
elease.
           

           Copy everything from the release folder  to Crogram FilesUnityEditor (or for 64-bit Windows, copy it to Crogram Files (x86)UnityEditor)
           

           Now the Unity Editor has access to Awesomium, allowing you to use it while you debug scenes.
         

           Adding Awesomium to Unity3D on Mac:
           

           We will first need to install the Awesomium SDK and then copy over some files so our scripts will***n within the Unity3D editor:
         

           Install and mount the Awesomium SDK
           

           Open up the mounted SDK folder and navigate to build/bin/release
           

           Copy Awesomium.framework to /Applications/Unity/Unity.app/Contents/Frameworks(you’ll need to right-click Unity -> Show Package Contents)
           

           Now the Unity Editor has access to Awesomium, allowing you to use it while you debug scenes.
         

           Setting Up Your Unity3D Project:
           

           Now it’s time to setup a new Unity3D project, add our plane object and directional light object.
         

           Create a new folder on your Desktop and name it UnityAweDemo
           

           Open Unity3D, go to File -> New Project -> Browse -> select the UnityAweDemo folder ->Create
           

           Create a plane object by clicking GameObject -> Create Other -> Plane
           

           Edit the plane’s properties in the Inspector pane (see screenshot below)
           

            
         

            
           




           The plane's Inspector properties
         

           We now need to create a light source for our scene.
         

           Click GameObject -> Create Other -> Directional Light
           

           Edit the directional light’s properties in the Inspector pane (see screenshot below)
           

            
           

           The directional light's Inspector properties
         

            
           


           Adding Our Scripts:
           

           Last, we’ll need to add AwesomiumMono.dll and the C# scripts included in the UnityAwe wrapper to our Unity3D project.
         

           Download UnityAwe from
           
            https://github.com/khrona/UnityAwe/zipball/master
           


           Unzip the UnityAwe archive.
           

           Open it up and find the correct AwesomiumMono.dll for your platform (we have two separate builds for Windows and Mac).
           

           Click and drag AwesomiumMono.dll to the Project pane in the Unity Editor.
           

           Click and drag WebTexture.cs and WebCoreHelper.cs to the Project pane in the Unity3D editor.
           

           Sweet, now your project is all set-up to use Awesomium! To actually make our plane display a web-page we just need to do two final steps:
         

           Click and drag the WebTexture.cs script from the Project pane onto the Plane game object in the Hierarchy pane.
           

           You should now see a Web Texture (Script) section in the Inspector pane, feel free to modify any of the default fields (such as Initial URL).
           

           Awesome, you’re done!
         

           Press the Play button and you should see a your Plane displaying a web-page. You should be able to interact with it like normal (mouse clicks, keyboard, etc.).
         

            
           






           An Interactive webpage inside the Unity Editor
         

           Extra Tips and Tricks:
           

           You can click and drag WebTexture.cs to almost any Game Object to make it display a web-page as its texture.
           

           When adding it to a GUI Element make sure to make the Width and Height (see the Pixel Inset) matches the values defined in your Web Texture (Script).
           

           When adding it to any other object (like a Cylinder or Sphere), make sure that it uses a Mesh Collider so that mouse input works correctly.
           

           We will be continuing this tutorial in Part 2 with a more advanced example (scripting and HTML GUI goodness).
         
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2012-1-24 23:22:37 |只看该作者
新年狂欢,挥手过往,尘埃落定。迎接新年,快乐无敌。放松心情,能量积蓄。共盼美好,祝福真切。闪亮人生,精彩同行。祝春节愉快!
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

板凳
发表于 2012-2-2 23:31:49 |只看该作者
赞一个,哈哈
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

地板
发表于 2012-2-18 23:28:17 |只看该作者
人过留名!
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

5#
发表于 2012-3-15 23:27:43 |只看该作者
呵呵,很漂亮啊
回复

使用道具 举报

643

主题

1

听众

9937

积分

高级设计师

Rank: 6Rank: 6

纳金币
9935
精华
1

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-3-16 17:55:54 |只看该作者
不错值得学习
回复

使用道具 举报

797

主题

1

听众

1万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
5568
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

7#
发表于 2012-3-16 18:59:36 |只看该作者
  学习
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

8#
发表于 2012-4-3 13:07:15 |只看该作者
其实楼主所说的这些,俺支很少用!
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

9#
发表于 2012-4-9 23:32:22 |只看该作者
提醒猪猪,千万不能让你看见
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

10#
发表于 2012-5-8 23:20:54 |只看该作者
不错 非常经典  实用
回复

使用道具 举报

12 第1页 | 共2 页下一页
返回列表 发新帖
您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-8-1 20:12 , Processed in 0.066616 second(s), 28 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部