using System.Collections; using System.Collections.Generic; using UnityEngine; //ボールが各ゴールポストに入った時の判定とゴール処理 public class Goal : MonoBehaviour { void Start () { } // Update is called once per frame void Update () { } //ゴール用コライダーにボールが当たれば得点処理 void OnTriggerEnter(Collider other) { GameObject.Find("Manager").GetComponent().shootsuccess = false; //レイヤー名を取得し、ボールであれば下の処理を行う string layerName = LayerMask.LayerToName(other.gameObject.layer); if (layerName != "ball") return; ///=================================================================================================================================================== /// /// 8/31 以下のものをコピペして by三井 /// //カメラを戻す if (GameObject.Find("Main Camera").GetComponent().cameraType != 0) { GameObject.Find("Main Camera").GetComponent().cameraType = 0; } ///=================================================================================================================================================== //どちらのゴールに入ったかの判定 if (transform.tag == "Goal1") { Score s = GameObject.Find("Manager").GetComponent(); s.S1add(); } else if(transform.tag == "Goal2") { Score s = GameObject.Find("Manager").GetComponent(); s.S2add(); } } }