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: 818, today: 2, yesterday: 1
最終更新: 2015-08-22 (土) 15:32:55 (JST) (3162d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
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
<今日>

オンライン状況

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

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

もっと...

アクセスカウンタ

今日 : 6355635563556355
昨日 : 8008800880088008
総計 : 2328199123281991232819912328199123281991232819912328199123281991
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com