void OnTriggerEnter(Collider objeto) { gameObject.GetComponentInParent <Rigidbody> ().isKinematic = true; victim = objeto.gameObject; // Cortar el elemento con el que se colisionado si es una fruta if (victim.tag.Equals("Fruit") /*&& victim.GetComponent<SwordHit>().isCutting*/) { if (!victim.name.Equals("left side")) { GoalChecker.checkFruit(victim.name); } pieces = BLINDED_AM_ME.MeshCut.Cut(victim, transform.position, transform.up, capMaterial); if (!pieces [1].GetComponent <Rigidbody> ()) { pieces [1].AddComponent <Rigidbody> (); } if (!pieces [0].GetComponent <Rigidbody> ()) { pieces [0].AddComponent <Rigidbody> (); } pieces [0].GetComponent <Rigidbody> ().useGravity = true; pieces [0].GetComponent <FruitBehaviour>().cutted = true; pieces [1].GetComponent <Rigidbody> ().useGravity = true; pieces [1].AddComponent <SphereCollider> (); //victim.GetComponent<SwordHit> ().isCutting = false; Invoke("destroyPart", 5f); } }
/// <summary> /// ゴール生成 /// </summary> private void GenerateGoal() { GameObject goal = Instantiate(goalPrefab); GoalChecker goalHouse = goal.GetComponent <GoalChecker>(); goalHouse.SetUpGoalHouse(this); }
void Start() { GameObject go = GameObject.Find("GoalObj"); Assert.IsNotNull(go); goalChecker = go.GetComponent <GoalChecker>(); Assert.IsNotNull(goalChecker); }
/// <summary> /// ゴール地点の生成 /// </summary> private void GenerateGoal() { // ゴール地点を生成 GoalChecker goalHouse = Instantiate(goalHousePrefab); // TODO ゴール地点の初期設定 Debug.Log("ゴール地点 生成"); }
/// <summary> /// ゴール地点の生成 /// </summary> private void GenerateGoal() { // ゴール地点を生成 GoalChecker goalHouse = Instantiate(goalHousePrefab); // ゴール地点の初期設定 goalHouse.SetUpGoalHouse(this); }
/// <summary> /// ゴール地点の生成 /// </summary> private void GenerateGoal() { Debug.Log("ゴール地点 生成"); // ゴール地点を生成 GoalChecker goalHouse = Instantiate(goalHousePrefab); // ゴール地点の設定 goalHouse.SetUpGoalHouse(this); }
void Start() { var result = GoalChecker.getResult(); resultText.text = result + ""; }