flagflag  If you want to see English page, please click "English" Button at Left.
  
現: 2015-08-22 (土) 15:32:55 iseki ソース
Line 1: Line 1:
 +*** Underwater_u5 スクリプト [#sf393a6a] 
 + using UnityEngine; 
 + using System.Collections; 
 +  
 + public class Underwater_u5 : MonoBehaviour 
 + { 
 +   //This script enables underwater effects. Attach to main camera. 
 +  
 +   //Define variable 
 +   public int underwaterLevel = 0; 
 +  
 +   //The scene's default fog settings 
 +   private bool defaultFog; 
 +   private Color defaultFogColor; 
 +   private float defaultFogDensity; 
 +   private Material defaultSkybox; 
 +  
 +   void Start () 
 +   { 
 +        //Set the background color 
 +       defaultFog = RenderSettings.fog; 
 +       defaultFogColor = RenderSettings.fogColor; 
 +       defaultFogDensity = RenderSettings.fogDensity; 
 +     defaultSkybox = RenderSettings.skybox; 
 +     GetComponent<Camera>().backgroundColor = new Color(0, 0.4f, 0.7f, 1); 
 +   } 
 +  
 +   // 
 +   void Update () 
 +   { 
 +       if (transform.position.y < underwaterLevel) 
 +       { 
 +           RenderSettings.fog = true; 
 +           RenderSettings.fogColor = new Color(0, 0.4f, 0.7f, 0.6f); 
 +           RenderSettings.fogDensity = 0.04f; 
 +     RenderSettings.skybox = null; 
 +       } 
 +       else 
 +       { 
 +           RenderSettings.fog = defaultFog; 
 +           RenderSettings.fogColor = defaultFogColor; 
 +           RenderSettings.fogDensity = defaultFogDensity; 
 +     RenderSettings.skybox = defaultSkybox; 
 +       } 
 +   } 
 + }
  

  • OAR Converter/Unity3D/Underwater_u5 のバックアップ差分(No. All)
    • 現: 2015-08-22 (土) 15:32:55 iseki

トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

97 人のユーザが現在オンラインです。 (18 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 97

もっと...

アクセスカウンタ

今日 : 4685468546854685
昨日 : 7722772277227722
総計 : 2343616623436166234361662343616623436166234361662343616623436166
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com