- 2022.03.28 Monday
- スポンサーサイト
-
一定期間更新がないため広告を表示しています
- | スポンサードリンク | - | | - | - | pookmark |
- 2016.11.11 Friday
- 拡張子とmeta含めたrenameツール Unity AssetDatabase.RenameAsset(path, newName); can not rename extension CSharpReNameFileNameExtention_And_Meta(string path,string newName) can chenge extension
-
Unity AssetDatabase.RenameAsset(path, newName); can not rename extension CSharpReNameFileNameExtention_And_Meta(string path,string newName) can chenge extension
- | whaison | C# | 20:00 | comments(0) | - | pookmark |
- 2016.08.09 Tuesday
- Enumのアイテムをforeachでループして、文字列からEnum列挙型の型へ変換
-
Enumのアイテムをforeachでループして、文字列からEnum列挙型の型へ変換
- | whaison | C# | 19:22 | comments(0) | - | pookmark |
- 2016.05.26 Thursday
- Maya 致命的なエラーでクラッシュする`file -q -reference -shortName`ファイル名と`file -q -reference`のフルパス
-
さらにやるならファイルあるか確認しないとだめね。
- string $reference[] = `file -q -reference -shortName`;
+ //string $reference[] = `file -q -reference`;
これで落ちてた
print("//file -importReference はじめるよ¥n");
//string $reference[] = `file -q -reference`;
string $reference[] = `file -q -reference`;
print("-----$reference[]---------"+"¥n");
print($reference);
print("¥n");
print("-----$reference[]---------"+"¥n");
int $countRef = 0;
int $refMax =size($reference);
for ( $countRef = $refMax-1; $countRef >= 0; $countRef-- )
{
print("$reference["+$countRef+"]= "+$reference[$countRef]+"¥n");
// file -open $reference[$count5];
if(`file -q -writable`=="1"){
if($countRef<0){
print("ないよーマイナス1だよ¥n");
}else{
file -importReference $reference[$countRef];
}//if($countRef<0){
}// if(`file -q -writable`=="1"){
//$count5--;
};//for ( $countRef = $refMax-1; $countRef >= 0; $countRef-- )
print("//file -importReference おわったよ¥n"); - | whaison | C# | 19:51 | comments(0) | - | pookmark |
- 2016.05.26 Thursday
- C#でOpenXMLを使ったExcelの読み込み エクセル Unity
-
テラシュールさん Excelでデータを管理してUnity iOS/Androidで使うワークフローをもう少し詳しく(修正版)http://tsubakit1.hateblo.jp/entry/20130702/1372771366
OpenXMLはmsi のWindowsインストーラしかないよ。
Unity3D用のC# ライブラリーと.NET Frameworkのバージョン。設定は3.5ですよ、3.5!
C#でOpenXMLを使ったExcelの読み込み
結局こっちのサイトがいいかも?。
http://symfoware.blog68.fc2.com/blog-entry-1137.html
Open XML SDK 2.0 for Microsoft Officeのインストール
こちらから、ライブラリのインストーラーを取得し、インストールを行います。
http://www.microsoft.com/ja-jp/download/details.aspx?id=5124
OpenXMLSDKシステム要件は次のとおりです。Microsoft Office Excel® 2010- .NET Framework 3.5 SP1 ギリダメだった
Open XML 形式 SDK 1.0のインストール
https://www.microsoft.com/ja-jp/download/details.aspx?id=12546
SDK のシステム要件は以下のとおりです。Microsoft Office Excel® 2007- .NET Framework 3.0 あいけるかも。ソースが紹介いない。。。。古いから古いエクセルしか読めないとかありそう。
あー
死んだ、、、、OpenXMLなんて使えない失速
またあした
Unity は.net2.0を魔改造していて.NET 3.5系まで使用出来るので、この手のライブラリも使用出来る。
http://tsubakit1.hateblo.jp/entry/20130702/1372771366NPOI 2.0
http://npoi.codeplex.com/releases/view/112932
ということで次回
http://whaison.jugem.jp/?eid=850
- | whaison | C# | 12:38 | comments(0) | - | pookmark |
- 2016.05.21 Saturday
- c# 重複削除 linq
-
Distinct
重複する要素の除去。(2 つ目以降がなくなる)
var src = new[] {3, 3, 2, 9, 2, 6, 2};
src.Distinct(); // {3, 2, 9, 6 }
http://yohshiy.blog.fc2.com/blog-entry-274.html - | whaison | C# | 01:57 | comments(0) | - | pookmark |
- 2016.05.19 Thursday
- dictionary ループ c#
-
foreach (KeyValuePair<string, DataEffectGroup> pair in DataConst.EffectGroupList)
{
UnityEngine.Debug.Log("DataConst.EffectGroupList というディクショナリ Key : " + pair.Key + " / Value :" + pair.Value + " effectGroupID= " + pair.Value.EffectGroupID);
}
UnityEngine.Debug.Log("DataConst3DAssets.cs---Assets3D_EffectGroupList()------// エフェクトグループ登録---- DataConst.EffectGroupList というディクショナリ -----End");
参考
http://d.hatena.ne.jp/superlightbrothers/20090222/1235317985
あさらに、そのなかのディクショナリのなかのりすとをループデバッグ
foreach (KeyValuePair<string, DataEffectGroup> pair in DataConst.EffectGroupList)
{
UnityEngine.Debug.Log("DataConst.EffectGroupList というディクショナリ Key : " + pair.Key + " / Value :" + pair.Value + " effectGroupID= " + pair.Value.EffectGroupID);
DataEffectGroup inside_DataEffectGroup = pair.Value;
DataEffectRecord[] RecordsArr = inside_DataEffectGroup.Records;
UnityEngine.Debug.Log("DataConst3DAssets.cs---Assets3D_EffectGroupList()-----// エフェクトグループ登録-DataConst.EffectGroupList というディクショナリの--_DataEffectGroup.RecordsのDataEffectRecord型の--RecordsArr-----Start");
for (int rl = 0; rl < RecordsArr.Length; rl++)
{
UnityEngine.Debug.Log("RecordsArr[" + rl + "] =" + RecordsArr[rl] + ".EffectGroupID=" + RecordsArr[rl].EffectGroupID);
}
UnityEngine.Debug.Log("DataConst3DAssets.cs---Assets3D_EffectGroupList()------// エフェクトグループ登録-DataConst.EffectGroupList というディクショナリの--_DataEffectGroup.RecordsのDataEffectRecord型の--RecordsArr-----End");
}
UnityEngine.Debug.Log("DataConst3DAssets.cs---Assets3D_EffectGroupList()------// エフェクトグループ登録---- DataConst.EffectGroupList というディクショナリ -----End"); - | whaison | C# | 19:16 | comments(0) | - | pookmark |
- 2016.05.19 Thursday
- C# BackSlash(バックスラッシュ) ¥ or ¥の Slash / へ の 検索置換
-
WINDOWSでの階層コード¥だけど マック等でぐちゃぐちゃになったりする
置換前--s= D:/work/github/my_3DAsset/Assets/AssetBundleData/effect¥hoge_0000¥hoge_0000¥hoge_prefab.prefab
置換後--s= D:/work/github/my_3DAsset/Assets/AssetBundleData/effect/hoge_0000/hoge_0000/hoge_prefab.prefab
Regex.Replace メソッド (input, pattern, replacement)
Debug.Log ("Search----s= " + s);
// string strYen = "¥¥";
// string r1 = s.Replace(strYen, "/");//----NG
string input = s;
string pattern = @"¥¥";
string replacement = @"/";
string result = System.Text.RegularExpressions.Regex.Replace(input, pattern, replacement);//----OK
Debug.Log("Search--置換後-result= " + result);
https://msdn.microsoft.com/ja-jp/library/e7f5w83z(v=vs.110).aspx
System.ArgumentException: Parsing "¥" - Illegal ¥ at end of pattern.
@つけたらなおった。
http://stackoverflow.com/questions/24647804/replace-parsing-illegal-at-end-of-pattern
- | whaison | C# | 12:09 | comments(0) | - | pookmark |
- 2016.05.18 Wednesday
- Linq list c# 検索 配列 返す List.Where(list => list.SkillID==SkillID).ToArray();
-
LINQを使用するには、参照設定に
using System.Linq;
Where を使った
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using System.Linq;
//フィルタ処理を行い、5未満の要素だけの配列を作成する
//int[] ret = nums.Where(num => num < 5).ToArray();
Effect.EffectInfo[] EffectInfoArr = Effect.Instance.EffectList.Where(x => x.SkillID==SkillID).ToArray();
みたいな
(.NET Framework 3.5 SP1)では、for文で1つずつ調べる方法が圧倒的に早く、その次にFindAllメソッドで、Whereを使った方法は一番遅かったです。って 笑 まーきにしない。
参照元
http://dobon.net/vb/dotnet/programing/arrayfilter.html#section4LINQ の主要メソッド
それでは、ここから LINQ のメソッドでまず最初に覚えておいた方がよいと思われる機能について説明していきます。
高階関数を用いたデータ処理における主要な機能は次の 5 つです。- 逐次処理(each)
- 写像(map)
- フィルター(filter)
- 並び替え(sort)
- 畳み込み(fold)
http://yohshiy.blog.fc2.com/blog-entry-274.html - | whaison | C# | 16:36 | comments(0) | - | pookmark |
- 2016.04.30 Saturday
- findfile.cs HDpathToAssetsPath ,prefabNameToPrefabGameObject,
-
プレファブ名からGameObject
GameObject prefabGameObject =prefabNameToPrefabGameObject ("effect3");
こんな感じで使うわけーエディタ拡張用です。
- | whaison | C# | 18:16 | comments(0) | - | pookmark |
- 2015.07.30 Thursday
- ビーカーの計算 たすきがけ なんかわかんなくなるときの比率の計算。
-
ビーカーの計算 たすきがけ なんかわかんなくなるときの比率の計算。
/////////////////i : Ef_ref2_List.Count = 0 /1;
/////////////////
///////
//プログレスバーの計算
//i*100 /Ef_ref2_List.Count*100; 0*100=/1*100 ;
//分母が可変だけど、0から1の中で欲しい 今回の1としたい単位は1だから。それを可変の分母で割る。
Debug.Log ("######################### Ef_ref2_List.Count="+Ef_ref2_List.Count);
float tanni=1.0f /((float)Ef_ref2_List.Count+1.0f);
Debug.Log ("######################### tanni="+tanni);
float ii = (float)i+1.0f; //配列のループは最初が0だから1.0f足しておく。
Debug.Log ("######################### ii="+ii);
//今回欲しい値。
//float X=tanni/2+(tanni*i);
float X=(tanni*ii);
Debug.Log ("######################### X="+X);
animEvent2.time = X;
//ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー - | whaison | C# | 15:51 | comments(0) | - | pookmark |