コード例 #1
0
    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);
        }
    }
コード例 #2
0
    /// <summary>
    /// ゴール生成
    /// </summary>
    private void GenerateGoal()
    {
        GameObject  goal      = Instantiate(goalPrefab);
        GoalChecker goalHouse = goal.GetComponent <GoalChecker>();

        goalHouse.SetUpGoalHouse(this);
    }
コード例 #3
0
    void Start()
    {
        GameObject go = GameObject.Find("GoalObj");

        Assert.IsNotNull(go);
        goalChecker = go.GetComponent <GoalChecker>();
        Assert.IsNotNull(goalChecker);
    }
コード例 #4
0
    /// <summary>
    /// ゴール地点の生成
    /// </summary>
    private void GenerateGoal()
    {
        // ゴール地点を生成
        GoalChecker goalHouse = Instantiate(goalHousePrefab);

        // TODO ゴール地点の初期設定
        Debug.Log("ゴール地点 生成");
    }
コード例 #5
0
ファイル: GameDirector.cs プロジェクト: yuki095/BallonFlight
    /// <summary>
    /// ゴール地点の生成
    /// </summary>
    private void GenerateGoal()
    {
        // ゴール地点を生成
        GoalChecker goalHouse = Instantiate(goalHousePrefab);

        // ゴール地点の初期設定
        goalHouse.SetUpGoalHouse(this);
    }
コード例 #6
0
    /// <summary>
    /// ゴール地点の生成
    /// </summary>
    private void GenerateGoal()
    {
        Debug.Log("ゴール地点 生成");

        // ゴール地点を生成
        GoalChecker goalHouse = Instantiate(goalHousePrefab);

        // ゴール地点の設定
        goalHouse.SetUpGoalHouse(this);
    }
コード例 #7
0
    void Start()
    {
        var result = GoalChecker.getResult();

        resultText.text = result + "";
    }