Coder Social home page Coder Social logo

unity-add-script-runtime's Introduction

AddScriptRuntime

AssetBundleにDLLを含め、ランタイムでコンポーネントに追加する機能のデモです。iOSを始めとするJIT不可のプラットフォームでは動作しません。

なお、「スクリプトをアタッチ済みのプレハブを読みたい」といった場合、別段特別な処理する事なく、AssetBundleにプレハブを含めれば読み込めます。(Package/clock script with prefab.unity3d参考)

###デモ

https://dl.dropboxusercontent.com/u/56297224/UnitySumple2/AssetBundle%E3%81%8B%E3%82%89%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E8%AA%AD%E3%81%BF%E5%8F%96%E3%82%8B%E3%83%87%E3%83%A2/web.html ###元ネタ

http://docs-jp.unity3d.com/Documentation/Manual/Including%20scripts%20in%20AssetBundles.html


###作成手順

1.インポートするスクリプトをDLL化し、拡張子をbytesとする

2.AssetBundleに1の手順で作成したbytesファイルを含める

###読込手順 1.WWWクラスでAssetBundleをインスタンス化

2.プレハブからTextAsset形式でbytes化したファイルを取得

3.Assembly.Load でbyteをアセンブルに読込

4.typeで型情報を取得し、addComponentで追加


unity 4.1.5で作成されています。

unity-add-script-runtime's People

Contributors

tatsuhiko-unity avatar tsubaki avatar

Watchers

James Cloos avatar Nguyễn Thanh Tú avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.