Пример #1
0
        public override void OnAwake()
        {
            base.OnAwake();
            //vessel spawner
            vessel_spawner = gameObject.AddComponent <VesselSpawner>();
            //add UI components
            kit_name_editor             = gameObject.AddComponent <SimpleTextEntry>();
            kit_name_editor.yesCallback = () =>
            {
                if (kit)
                {
                    KitName = kit.Name = kit_name_editor.Text;
                }
            };
            resource_manifest_view             = gameObject.AddComponent <SimpleScrollView>();
            construct_loader                   = gameObject.AddComponent <ShipConstructLoader>();
            construct_loader.process_construct = store_construct;
            //add kit hull mesh
            var obj = new GameObject("KitHullMesh", typeof(MeshFilter), typeof(MeshRenderer));

            obj.transform.SetParent(gameObject.transform);
            kit_hull_mesh = obj.GetComponent <MeshFilter>();
            var renderer = obj.GetComponent <MeshRenderer>();

            renderer.material       = Utils.no_z_material;
            renderer.material.color = kit_hull_color;
            renderer.enabled        = true;
            obj.SetActive(false);
        }
 public override void OnAwake()
 {
     base.OnAwake();
     construct_loader = gameObject.AddComponent <ShipConstructLoader>();
     construct_loader.process_construct = process_construct;
     construct_loader.Show(false);
 }