コード例 #1
0
        public static PicoScript Load(PicoGame game, byte[] scriptData)
        {
            PicoScript script = null;

            Assembly gameAssembly = Assembly.Load(scriptData);

            Type picoScriptType = gameAssembly.GetTypes().First(

                myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(PicoScript))
                );

            if (picoScriptType != null)
            {
                script = (PicoScript)Activator.CreateInstance(picoScriptType);
                script.__SetGameReference(game);
            }

            return(script);
        }
コード例 #2
0
 public void __SetGameReference(PicoGame game)
 {
     Game = game;
 }