[過去ログ]
【3Dゲームエンジン】Unity質問スレッド33 (1002レス)
【3Dゲームエンジン】Unity質問スレッド33 http://mevius.5ch.net/test/read.cgi/gamedev/1513643755/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
130: 名前は開発中のものです。 [sage] 2017/12/27(水) 01:16:54.26 ID:2+M/n1Lm ROM的な機能は、ScriptableObjectの方だったか 全オブジェクトからアクセスできる関数(メソッド)作成はStaticが良いかもしれない どのスクリプトからでも @RGB→HSL変換できるメソッド:RGBto.HSL(R, G, B, out H, out S, out L) ARGB→HSV変換できるメソッド:RGBto.HSV(R, G, B, out H, out S, out V) を作ってみた http://mevius.5ch.net/test/read.cgi/gamedev/1513643755/130
131: 名前は開発中のものです。 [sage] 2017/12/27(水) 01:19:10.80 ID:2+M/n1Lm public static class RGBto { public static void HSL(int R, int G, int B, out int H, out int S, out int L){ int Max = Mathf.Max (R, G, B); int Min = Mathf.Min (R, G, B); if (Max == Min) { H = 360; } else if (G == Max) { H = 60 * (B - R) / (Max - Min) + 120; } else if (B == Max) { H = 60 * (R - G) / (Max - Min) + 240; } else { H = 60 * (G - B) / (Max - Min); if (H < 0) H = H + 360; } if (Max == 0 || Min == 255){ S = 0; } else { S = 255 * (Max - Min) / (255 - Mathf.Abs(Max + Min - 255)); } L = (Max + Min)/2; } http://mevius.5ch.net/test/read.cgi/gamedev/1513643755/131
132: 名前は開発中のものです。 [sage] 2017/12/27(水) 01:19:30.81 ID:2+M/n1Lm public static void HSV(int R, int G, int B, out int H, out int S, out int V){ int Max = Mathf.Max (R, G, B); int Min = Mathf.Min (R, G, B); if (Max == Min) { H = 360; } else if (G == Max) { H = 60 * (B - R) / (Max - Min) + 120; } else if (B == Max) { H = 60 * (R - G) / (Max - Min) + 240; } else { H = 60 * (G - B) / (Max - Min); if (H < 0) H = H + 360; } if (Max == 0){ S = 0; } else { S = 255 * (Max - Min) / Max; } V = Max; } } Hを求めるところはもっとまとめられるかも・・・ Hのみ0〜360(360で色相未定義) RGB,SLVは0〜255 http://mevius.5ch.net/test/read.cgi/gamedev/1513643755/132
173: 名前は開発中のものです。 [sage] 2017/12/27(水) 23:56:23.72 ID:2+M/n1Lm >遷移後のシーンに配置されているボタンから、objAのメソッド@を呼び出す 本当に呼び出せている? Find以前の問題だったりして・・・ http://mevius.5ch.net/test/read.cgi/gamedev/1513643755/173
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.028s