以下の内容はhttps://baba-s.hatenablog.com/entry/2020/09/18/233000より取得しました。


【Unity】Paste Component As New をスクリプトから呼び出す方法

概要

using UnityEditor;
using UnityEditorInternal;

public static class Example
{
    [MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        var gameObject = Selection.activeGameObject;
        ComponentUtility.PasteComponentAsNew( gameObject );
    }
}

ComponentUtility.PasteComponentAsNew を使用する




以上の内容はhttps://baba-s.hatenablog.com/entry/2020/09/18/233000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14