コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】樹形の三角形メッシュを生成できる「unity-tetrahedron-tree」紹介

はじめに

「unity-tetrahedron-tree」を Unity プロジェクトに導入することで
樹形の三角形メッシュを生成できるようになります

使用例

f:id:baba_s:20171230205048p:plain

使い方

f:id:baba_s:20171230205148p:plain

MeshFilter と MeshRender を持つゲームオブジェクトに
「TetrahedronTree」をアタッチします

using UnityEngine;

public class Example : MonoBehaviour
{
    public TetrahedronTree tree;

    private void Awake()
    {
         tree.CreateTree();
    }
}

スクリプトから樹形の三角形メッシュを生成する場合は
上記のようなコードを記述します

関連記事