Second commit
This commit is contained in:
commit
36840f3ad4
999 files changed
+61364
No files matched your search
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
namespace TinyGoose.Tremble
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for [PrefabEntityEntity], [BrushEntity], and [PointEntity] classes, to
|
||||
/// perform additional processing after import from a map file.
|
||||
///
|
||||
/// If these modifications after import are complicated, need to occur using Editor
|
||||
/// functionality, or refer to other objects you may wish to consider instead
|
||||
/// using a custom Map Processor for your map to process them at the top level.
|
||||
/// </summary>
|
||||
public interface IOnImportFromMapEntity
|
||||
{
|
||||
// Change ITrembleBaseClass if this changes!!
|
||||
void OnImportFromMapEntity(MapBsp mapBsp, BspEntity entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91fd71f9e91f4033a8c4ee1bb7cfd9d6
|
||||
timeCreated: 1700514722
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 277805
|
||||
packageName: Tremble - Map Importer
|
||||
packageVersion: 1.11.1
|
||||
assetPath: Assets/Tremble/Interfaces/IOnImportFromMapEntity.cs
|
||||
uploadId: 939664
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
namespace TinyGoose.Tremble
|
||||
{
|
||||
// Custom LiveUpdate
|
||||
public interface IOnLiveUpdate
|
||||
{
|
||||
void OnLiveUpdated();
|
||||
}
|
||||
|
||||
// Simple LiveUpdate - just call OnDestroy followed by Start!
|
||||
public interface IOnLiveUpdate_Simple
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bcd0f6915f34e92968ea5066ba1848a
|
||||
timeCreated: 1710424030
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 277805
|
||||
packageName: Tremble - Map Importer
|
||||
packageVersion: 1.11.1
|
||||
assetPath: Assets/Tremble/Interfaces/IOnLiveUpdate.cs
|
||||
uploadId: 939664
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// This file is part of the Tremble package by Tiny Goose.
|
||||
// Copyright (c) 2024-2026 TinyGoose Ltd., All Rights Reserved.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
namespace TinyGoose.Tremble
|
||||
{
|
||||
public interface ITrembleBaseClass
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static class TrembleBaseClassDefault
|
||||
{
|
||||
public static ITrembleBaseClass CreateDefault(Type baseClass)
|
||||
{
|
||||
AssemblyName assName = new("Tremble.Editor.BaseClasses");
|
||||
AssemblyBuilder assBuilder = AssemblyBuilder.DefineDynamicAssembly(assName, AssemblyBuilderAccess.Run);
|
||||
ModuleBuilder moduleBuilder = assBuilder.DefineDynamicModule(assName + ".dll");
|
||||
TypeBuilder typeBuilder = moduleBuilder.DefineType(baseClass.Name + "Test");
|
||||
typeBuilder.AddInterfaceImplementation(baseClass);
|
||||
|
||||
MethodBuilder importMethod = typeBuilder.DefineMethod(nameof(IOnImportFromMapEntity.OnImportFromMapEntity),
|
||||
MethodAttributes.Public | MethodAttributes.Virtual,
|
||||
CallingConventions.HasThis,
|
||||
null,
|
||||
new[] { typeof(MapBsp), typeof(BspEntity) });
|
||||
|
||||
ILGenerator ilGenerator = importMethod.GetILGenerator();
|
||||
ilGenerator.Emit(OpCodes.Nop);
|
||||
ilGenerator.Emit(OpCodes.Ret);
|
||||
|
||||
Type type = typeBuilder.CreateType();
|
||||
return (ITrembleBaseClass)Activator.CreateInstance(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53a4ed95b3924b65b8ff49bd3174edb2
|
||||
timeCreated: 1710851762
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 277805
|
||||
packageName: Tremble - Map Importer
|
||||
packageVersion: 1.11.1
|
||||
assetPath: Assets/Tremble/Interfaces/ITrembleBaseClass.cs
|
||||
uploadId: 939664
|
||||
Reference in new issue
Block a user