flagflag  If you want to see English page, please click "English" Button at Left.
4: 2015-06-21 (日) 01:19:38 iseki ソース 現: 2015-07-13 (月) 14:01:38 iseki ソース
Line 6: Line 6:
- http://docs.unity3d.com/jp/current/Scrip​tReference/ModelImporter.html - http://docs.unity3d.com/jp/current/Scrip​tReference/ModelImporter.html
- http://baba-s.hatenablog.com/entry/2015/​06/09/104109 - http://baba-s.hatenablog.com/entry/2015/​06/09/104109
 +- http://ft-lab.ne.jp/cgi-bin-unity/wiki.c​gi?page=unity_first
 +#br
 +*** Scripts [#t1147094]
 +**** Input.GetKeyDown(), Input.GetKeyUp() の取りこぼし [#t95d08ba]
 +- GetKeyDown(), GetKeyUp() 系は1フレームのみの通知なので,FixedUpdate() ではなく Update() に記述する.
#br #br
- using UnityEngine; 
- using UnityEditor; 
- using System.IO; 
- 
- public sealed class SelectColladaShader : AssetPostprocessor 
- { 
-    Material OnAssignMaterialModel(Material material,Renderer renderer) 
-    { 
-     string currentDir = Path.GetDirectoryName (assetPath); 
-     if (!AssetDatabase.IsValidFolder (currentDir + "/Materials")) { 
-     AssetDatabase.CreateFolder (currentDir, "Materials"); 
-     } 
- 
-     if (material.mainTexture == null) { 
-     return null; 
-     } 
-     string textureName = material.mainTexture.name; 
-     string materialPath = string.Format("{0}/Materials/{1}.mat", currentDir, textureName); 
- 
-     Material mt = AssetDatabase.LoadAssetAtPath<Material>(​materialPath) as Material; 
- 
-     if (mt==null) { 
-     material.shader = Shader.Find("Legacy Shaders/Transparent/Diffuse"); 
-     AssetDatabase.CreateAsset(material, materialPath); 
-     Debug.Log(string.Format("CustomModelImporterの処理により、以下の場所に[{1}]シェーダーのマテリアルを作成しました。\n{0}",materialPath,material.shader.name)); 
-     // 
-     mt = material; 
-     } 
- 
-     return mt; 
-    } 
- } 


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

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月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
<今日>

オンライン状況

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

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

もっと...

アクセスカウンタ

今日 : 7294729472947294
昨日 : 1529415294152941529415294
総計 : 2340199423401994234019942340199423401994234019942340199423401994
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com