5: 2015-06-21 (日) 07:23:32 iseki | 現: 2015-07-13 (月) 14:01:38 iseki | ||
---|---|---|---|
Line 6: | Line 6: | ||
- http://docs.unity3d.com/jp/current/ScriptReference/ModelImporter.html | - http://docs.unity3d.com/jp/current/ScriptReference/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.cgi?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); | ||
- | |||
- | if (mt==null) { | ||
- | material.shader = Shader.Find("Legacy Shaders/Transparent/Diffuse"); | ||
- | AssetDatabase.CreateAsset(material, materialPath); | ||
- | // | ||
- | mt = material; | ||
- | } | ||
- | |||
- | return mt; | ||
- | } | ||
- | } |
- Unity3D のバックアップ一覧
- Unity3D のバックアップの現在との差分(No. All)