public void Onclicked() { Debug.Log("ミス"); score = GameObject.Find("player1_point"); point_holder p1 = score.GetComponent <point_holder> (); p1.attack_miss(); }
// public void OnSortiePointClick(BaseEventData data){ // var eventData = (PointerEventData)data; // Debug.Log ("clicked"); // } public void OnClicked() { // Debug.Log ("クリックされた"); Invoke("hit", 0.0f); //ここで待ってるのはマテリアル変更を見せるのと、待つため。 score = GameObject.Find("player1_point"); //ここでマテリアルを変更させる point_holder p1 = score.GetComponent <point_holder>(); p1.attack_success(); }
void timeout() //こっちは座標の処理も必要 { if (this.transform.position.y >= 0) //0より小さければ下降を初めているので { StartCoroutine("DownMethod"); score = GameObject.Find("player2_point"); //ここでマテリアルを変更させる point_holder p2 = score.GetComponent <point_holder>(); p2.miss_target(); } }
// // Use this for initialization // void Start () { // // } // // // Update is called once per frame // void Update () { // // } public void init() { Score_p1 = GameObject.Find("player1_point"); point_holder p1 = Score_p1.GetComponent <point_holder>(); point1 = p1.get_point(); Score_p2 = GameObject.Find("player2_point"); point_holder p2 = Score_p2.GetComponent <point_holder>(); point2 = p2.get_point(); }