Exemple #1
0
    private void AdjustFreshBranch()
    {
        GameObject curBranch = m_PairedBranchIndexes[0].CurIndex.Belong;
        GameObject preBranch = GameObject.Instantiate(curBranch);

        /*
         * 摧毁所有的子对象
         * 防止重复
         */
        GameObjectOperation.DestroyAllChildren(preBranch);

        Vector3[] vertices = GameObjectOperation.GetVertices(curBranch);

        //CopyVertices(curBranch.transform.InverseTransformPoint(Vector3.zero), vertices);
        CopyVertices(TreeModel.GetBranchBottomCenter(curBranch, m_PairedBranchIndexes[0].CurIndex), vertices);

        GameObjectOperation.UpdateMeshInfo(preBranch, vertices);


        AddPreObject(preBranch);
        AddCurObject(curBranch);
    }