2014年6月2日月曜日

エクセル Excel 関連 [Excel]

1.行の高さを自動調整する

ツールバーの[書式]-[行]-[行の高さの自動調整]を選択すると自動調整される

※セルの連結してるとならないっぽい
※ツールバーとは上のほうに[ファイル][編集][表示][挿入][書式]...とか表示されている個所のこと

三角関数 角度を求める [Unity C#]

球の発射系では発射位置が固定されていると思うが、その際に発射角度を求めたい場合。

float Angle;
float x;
float y;

//角度を求める
Angle = Mathf.Atan ( y / x ) * Mathf.Rad2Deg;

//対象の角度を変更
対象.transform.localRotation = Quaternion.Euler(0,0,angle);

で角度が変更出来る



2014年5月30日金曜日

オブジェクトのコンポーネント(Script)を取得 [Unity C#]

スクリプト名「SampleClass」
SampleClassの変数宣言
public string str = "";

//親オブジェクトを取得
GameObject objParent = this.transform.parent.gameObject;
//親オブジェクトのコンポーネント(Script)を取得
SampleClass SC = objParent.GetComponent<SampleClass>();
SC.str = "AAA";



2014年5月14日水曜日

子オブジェクトの取得 [Unity C#]

//オブジェクト取得
GameObject Play1;
Play1 = GameObject.Find("Character1");
Play1.transform.localPosition = new Vector3(0 , 0 , 0);

//子オブジェクト取得
GameObject Play2;
Play2 = GameObject.FindChild("Character").gameObject;
Play2.transform.localPosition = new Vector3(0 , 0 , 0);


など

2014年4月18日金曜日

親オブジェクトの取得 [Unity C#]


GameObject Parent;
Parent=  gameObject.transform.parent.gameObject;


2014年4月16日水曜日

数値の正・負の符号を反転させる [Unity C#]

■ケース1
Debug.Log ((5).ToString ());
Debug.Log (-(5).ToString ());
◆結果
5
-5


□ケース2
Debug.Log ((-5).ToString ());
Debug.Log (-(-5).ToString ());
◇結果
-5
5

2014年4月14日月曜日

Unityで一時停止処理 [Unity C#]

ゲームの最中に一時停止を行う方法(Physic)

1.Time.timeScaleを0に設定
 Time.timeScale = 0;

2.Physic以外の処理を停止させたい場合は
 各動作処理の際にTime.timeScale>0を追加する
 Time.timeScaleが0以上の場合に処理(動作させる)を行う


上記で一時停止となる。