flagflag  If you want to see English page, please click "English" Button at Left.

Underwater_u5 スクリプト anchor.png

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;
       }
   }
}

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 897, today: 1, yesterday: 1
最終更新: 2015-08-22 (土) 15:32:55 (JST) (3458d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2025年 2月翌月
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
<今日>

オンライン状況

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

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

もっと...

アクセスカウンタ

今日 : 1232412324123241232412324
昨日 : 1029610296102961029610296
総計 : 2506821025068210250682102506821025068210250682102506821025068210
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com