检查onClickListener Android的状态

时间:2016-11-26 22:58:07

标签: android onclicklistener

是否可以检查void FixedUpdate() { if (Input.GetMouseButton(0)) { targetPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); if (rigidBody.position != targetPoint) { reachedTargetPoint = false; if (reachedTargetPoint == false) { GetComponent<Rigidbody>().AddForce(speed); } } //zoneBeforeReachingTP should be how much units before reaching targetPoint you want to start to decrease your rigidbody velocity if (rigidBody.position == (targetPoint - zoneBeforeReachingTP)) { //speedReductionRate should be how much of speed you want to take off your rigidBody at the FixedUpdate time rate rigidBody.velocity = speedReductionRate; } if(rigidBody.position == targetPoint) { rigidBody.velocity = new Vector3(0, 0, 0); reachedTargetPoint = true; } ChangeRotationTarget(); } } 是否附加到onClickListener

在某些时候,我通过将View设置为null来禁用onClickListner中的按钮。

1 个答案:

答案 0 :(得分:0)

是的,只需使用m := MyType{value: "something"} fmt.Println(Stringer(m)) 方法。

https://developer.android.com/reference/android/view/View.html#hasOnClickListeners()