300円位のジョイスティック mocute-032 を購入したが、実際のボタンの値が分からず確認の為のスクリプトを作成
おそらく、汎用的に確認できます。

この値段で充電式は、驚き!

モードはゲームモードでAndroid 

void Update()
    {
        UpdateGetKey();
        // UpdateKey();
    }    

void UpdateGetKey()
    {
        float horizontal = Input.GetAxis("Horizontal");     // joystick horizontal
        float vertical = Input.GetAxis("Vertical");      // joystick vertical

        Debug.Log("x y:" + horizontal + "," + vertical);
        foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
        {
            if (Input.GetKey(value))
            {
                String name = Enum.GetName(typeof(KeyCode), value);
                Debug.Log("Input.GetKey:" + name);
            }
            if (Input.GetKeyDown(value))
            {
                String name = Enum.GetName(typeof(KeyCode), value);
                Debug.Log("Input.GetKeyDown:" + name);
            }
            if (Input.GetKeyUp(value))
            {
                String name = Enum.GetName(typeof(KeyCode), value);
                Debug.Log("Input.GetKeyUp:" + name);
            }
        }
    }
adb logcat | grep Joy

02-24 13:42:55.463  1346  1358 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 
02-24 13:45:54.033  2993  3016 I Unity   : Input.GetKey:JoystickButton2 
02-24 13:45:54.033  2993  3016 I Unity   : Input.GetKeyDown:JoystickButton2 
02-24 13:45:54.033  2993  3016 I Unity   : Input.GetKey:Joystick1Button2 
02-24 13:45:54.033  2993  3016 I Unity   : Input.GetKeyDown:Joystick1Button2 
02-24 13:45:54.051  2993  3016 I Unity   : Input.GetKeyUp:JoystickButton2 
02-24 13:45:54.051  2993  3016 I Unity   : Input.GetKeyUp:Joystick1Button2 

02-24 13:45:55.333  2993  3016 I Unity   : Input.GetKey:JoystickButton0 
02-24 13:45:55.333  2993  3016 I Unity   : Input.GetKey:Joystick1Button0 
02-24 13:45:55.352  2993  3016 I Unity   : Input.GetKey:JoystickButton0 
02-24 13:45:55.352  2993  3016 I Unity   : Input.GetKey:Joystick1Button0 
02-24 13:45:55.367  2993  3016 I Unity   : Input.GetKey:JoystickButton0 
02-24 13:45:55.367  2993  3016 I Unity   : Input.GetKey:Joystick1Button0 
02-24 13:45:55.383  2993  3016 I Unity   : Input.GetKey:JoystickButton0 
02-24 13:45:55.383  2993  3016 I Unity   : Input.GetKey:Joystick1Button0 
02-24 13:45:55.402  2993  3016 I Unity   : Input.GetKeyUp:JoystickButton0 

 

null で更新

    public void updateScore(int id, ExeMode method, int? score) {
        string item = CommonDao.GetScoreItemName(method);
        // How to string format
        string sql = $"UPDATE LessonTable SET {item} ={(score == null ? "null" : score.ToString())} WHERE ID ={id}";

        dbManager.Execute(sql);
    }

項目を動的に変えてデータを取得

void Start()
{
	dbManager = this.GetComponentInParent();
}

public int GetScore(int id, ExeMode method)
{
	string item = CommonDao.GetScoreItemName(method);
	string sql = $"SELECT {item} FROM LessonTable WHERE ID=?";

	SimpleDataTable lists = dbManager.QueryGeneric(sql, id);

	if(lists.rows.Count ==0 ) {
		return 0;
	}
	return int.Parse(lists.rows[0][0].ToString());
}

/clang:-1: linker command failed with exit code 1 (use -v to see invocation)

ld: ‘/Users/falco/Unity/MemoPa/MemoPaiOS/Libraries/Plugins/iOS/libdivesensor.a(Native_Sensors_Plugin.o)’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Buildsettings search bitcode
EnableBitCode no

myCapsule = GameObject.FindGameObjectWithTag (“MyCapsule”);

// 親のGameObjectからTransform.Find
// 非アクティブでも取得可能
mainCamera = myCapsule.transform.Find(“Camera”).gameObject;
diveCamera = myCapsule.transform.Find(“Dive_Camera”).gameObject;

if (mainCamera != null) {
mainCamera.SetActive (true);
}
if (diveCamera != null) {
diveCamera.SetActive (false);
}

Unity で iOS のリリースと、simulator ビルドを切り替えるには?

切り替える必要があったのかぁ

Target SDK を Device or Simulator SDK を選択する

クエリーちゃんを飛ばす!

Unity 2017.3.1f1 Personal

 

クエリーちゃんを飛ばすと意気込んでみたものの、すぐには飛ばなかったorz

1.新規プロジェクト作成

 

 

 

 

 

 

 

 

2.Japanese Otaku City Import ZERIN CO.,LTD.

 

 

 

 

 

 

 

 

 

 

3.Assets より Sample_005339_08932_25_14 をダブルクリック

 

 

 

 

 

 

 

 

 

 

4.Shader Error 修正

Shader error in ‘su_Double_Clip’: ‘vert’: output parameter ‘o’ not completely initialized at line 81 (on d3d11)

 

 

 

 

 

 

 

 

 


void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o); // add
float4 VertexOutputMaster0_0_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_1_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_2_NoInput = float4(0,0,0,0);
float4 VertexOutputMaster0_3_NoInput = float4(0,0,0,0);

}

5.同様な修正を数か所

6.Step Offset must be less or equal to + * 2
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

 

 

 

 

 

 

 

 

 

 

このエラーの原因わからず2日

プロパティの Step Offset 0.3 -> 0.1 へ

7.実行

 

 

 

 

 

 

 

 

 

飛べた!

ZENRIN さん、 クエティーちゃんありがとう!

 

 

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha