Trying to make a puzzle game where you write code to progress, i currently trying to get a platform to move based on players input.
I dont know how i can get the Vector3 class in without adding everything else, i know i can do lua.LoadCLRPackage (); and in lua import 'UnityEngine' but that will also add the GameObject class and allow the users to hijack items they are not suppose to reach.
My idea at first was to make a white-list namespace that only the classes i want is in, but my solution dident work.
using UnityEngine;
namespace Whitelist{
public class Vector3 : UnityEngine.Vector3{}
}
Because Vector3 is sealed, any one have an other idea i can try?
Ended up doing a huge blacklist file of all the classes in UnityEngine based on the API Documentation, there might be hidden classes that i have missed.
Just comment out (LUA style) the one you dont want, and run this before the input code.
using UnityEngine;
public class Blacklist
{
public static string list { get {
return @"
import 'UnityEngine'
import = function() end
AccelerationEvent = function () end
AnchoredJoint2D = function () end
AndroidInput = function () end
AndroidJavaClass = function () end
AndroidJavaObject = function () end
AndroidJavaProxy = function () end
AndroidJNI = function () end
AndroidJNIHelper = function () end
Animation = function () end
AnimationClip = function () end
AnimationClipPair = function () end
AnimationCurve = function () end
AnimationEvent = function () end
AnimationInfo = function () end
AnimationState = function () end
Animator = function () end
AnimatorClipInfo = function () end
AnimatorControllerParameter = function () end
AnimatorOverrideController = function () end
AnimatorStateInfo = function () end
AnimatorTransitionInfo = function () end
AnimatorUtility = function () end
Application = function () end
AreaEffector2D = function () end
AssetBundle = function () end
AssetBundleCreateRequest = function () end
AssetBundleManifest = function () end
AssetBundleRequest = function () end
AsyncOperation = function () end
AudioChorusFilter = function () end
AudioClip = function () end
AudioConfiguration = function () end
AudioDistortionFilter = function () end
AudioEchoFilter = function () end
AudioHighPassFilter = function () end
AudioListener = function () end
AudioLowPassFilter = function () end
AudioRenderer = function () end
AudioReverbFilter = function () end
AudioReverbZone = function () end
AudioSettings = function () end
AudioSource = function () end
Avatar = function () end
AvatarBuilder = function () end
AvatarMask = function () end
Behaviour = function () end
BillboardAsset = function () end
BillboardRenderer = function () end
BitStream = function () end
BoneWeight = function () end
BoundingSphere = function () end
Bounds = function () end
BoundsInt = function () end
PositionEnumerator = function () end
BoxCollider = function () end
BoxCollider2D = function () end
BuoyancyEffector2D = function () end
Cache = function () end
CachedAssetBundle = function () end
Caching = function () end
Camera = function () end
Enumerations = function () end
MonoOrStereoscopicEye = function () end
StereoscopicEye = function () end
Canvas = function () end
CanvasGroup = function () end
CanvasRenderer = function () end
CapsuleCollider = function () end
CapsuleCollider2D = function () end
CharacterController = function () end
CharacterInfo = function () end
CharacterJoint = function () end
CircleCollider2D = function () end
Cloth = function () end
ClothSkinningCoefficient = function () end
ClothSphereColliderPair = function () end
ClusterInput = function () end
ClusterNetwork = function () end
Collider = function () end
Collider2D = function () end
ColliderDistance2D = function () end
Collision = function () end
Collision2D = function () end
Color = function () end
Color32 = function () end
ColorUtility = function () end
CombineInstance = function () end
Compass = function () end
Component = function () end
CompositeCollider2D = function () end
Enumerations = function () end
GenerationType = function () end
GeometryType = function () end
ComputeBuffer = function () end
ComputeShader = function () end
ConfigurableJoint = function () end
ConstantForce = function () end
ConstantForce2D = function () end
ContactFilter2D = function () end
ContactPoint = function () end
ContactPoint2D = function () end
ControllerColliderHit = function () end
Coroutine = function () end
CrashReport = function () end
Cubemap = function () end
CubemapArray = function () end
CullingGroup = function () end
CullingGroupEvent = function () end
Cursor = function () end
CustomRenderTexture = function () end
CustomRenderTextureUpdateZone = function () end
CustomYieldInstruction = function () end
Debug = function () end
DetailPrototype = function () end
Display = function () end
DistanceJoint2D = function () end
DrivenRectTransformTracker = function () end
DynamicGI = function () end
EdgeCollider2D = function () end
Effector2D = function () end
EllipsoidParticleEmitter = function () end
Event = function () end
ExitGUIException = function () end
ExposedPropertyResolver = function () end
FixedJoint = function () end
FixedJoint2D = function () end
Flare = function () end
FlareLayer = function () end
Font = function () end
FrameTiming = function () end
FrameTimingManager = function () end
FrictionJoint2D = function () end
FrustumPlanes = function () end
GameObject = function () end
GeometryUtility = function () end
Gizmos = function () end
GL = function () end
Gradient = function () end
GradientAlphaKey = function () end
GradientColorKey = function () end
Graphics = function () end
Grid = function () end
GridBrushBase = function () end
Enumerations = function () end
FlipAxis = function () end
RotationDirection = function () end
Tool = function () end
GridLayout = function () end
Enumerations = function () end
CellLayout = function () end
CellSwizzle = function () end
GUI = function () end
Classes = function () end
GroupScope = function () end
ScrollViewScope = function () end
Enumerations = function () end
ToolbarButtonSize = function () end
GUIContent = function () end
GUIElement = function () end
GUILayer = function () end
GUILayout = function () end
Classes = function () end
AreaScope = function () end
HorizontalScope = function () end
ScrollViewScope = function () end
VerticalScope = function () end
GUILayoutOption = function () end
GUILayoutUtility = function () end
GUISettings = function () end
GUISkin = function () end
GUIStyle = function () end
GUIStyleState = function () end
GUIText = function () end
GUITexture = function () end
GUIUtility = function () end
Gyroscope = function () end
Handheld = function () end
Hash128 = function () end
HingeJoint = function () end
HingeJoint2D = function () end
HostData = function () end
HumanBone = function () end
HumanDescription = function () end
HumanLimit = function () end
HumanPose = function () end
HumanPoseHandler = function () end
HumanTrait = function () end
ImageConversion = function () end
Input = function () end
Joint = function () end
Joint2D = function () end
JointAngleLimits2D = function () end
JointDrive = function () end
JointLimits = function () end
JointMotor = function () end
JointMotor2D = function () end
JointSpring = function () end
JointSuspension2D = function () end
JointTranslationLimits2D = function () end
JsonUtility = function () end
Keyframe = function () end
LayerMask = function () end
LensFlare = function () end
Light = function () end
LightBakingOutput = function () end
LightmapData = function () end
LightmapSettings = function () end
LightProbeGroup = function () end
LightProbeProxyVolume = function () end
Enumerations = function () end
BoundingBoxMode = function () end
ProbePositionMode = function () end
QualityMode = function () end
RefreshMode = function () end
ResolutionMode = function () end
LightProbes = function () end
LineRenderer = function () end
LineUtility = function () end
LocationInfo = function () end
LocationService = function () end
LOD = function () end
LODGroup = function () end
Logger = function () end
MasterServer = function () end
MatchTargetWeightMask = function () end
Material = function () end
MaterialPropertyBlock = function () end
Mathf = function () end
Matrix4x4 = function () end
Mesh = function () end
MeshCollider = function () end
MeshFilter = function () end
MeshParticleEmitter = function () end
MeshRenderer = function () end
Microphone = function () end
MonoBehaviour = function () end
Motion = function () end
MovieTexture = function () end
Network = function () end
NetworkMessageInfo = function () end
NetworkPlayer = function () end
NetworkView = function () end
NetworkViewID = function () end
Object = function () end
OcclusionArea = function () end
OcclusionPortal = function () end
ParticleAnimator = function () end
ParticleCollisionEvent = function () end
ParticleEmitter = function () end
ParticlePhysicsExtensions = function () end
ParticleRenderer = function () end
ParticleSystem = function () end
Classes = function () end
Burst = function () end
CollisionModule = function () end
ColorBySpeedModule = function () end
ColorOverLifetimeModule = function () end
CustomDataModule = function () end
EmissionModule = function () end
EmitParams = function () end
ExternalForcesModule = function () end
ForceOverLifetimeModule = function () end
InheritVelocityModule = function () end
LightsModule = function () end
LimitVelocityOverLifetimeModule = function () end
MainModule = function () end
MinMaxCurve = function () end
MinMaxGradient = function () end
NoiseModule = function () end
Particle = function () end
RotationBySpeedModule = function () end
RotationOverLifetimeModule = function () end
ShapeModule = function () end
SizeBySpeedModule = function () end
SizeOverLifetimeModule = function () end
SubEmittersModule = function () end
TextureSheetAnimationModule = function () end
TrailModule = function () end
TriggerModule = function () end
VelocityOverLifetimeModule = function () end
ParticleSystemRenderer = function () end
PatchExtents = function () end
PhysicMaterial = function () end
Physics = function () end
Physics2D = function () end
PhysicsJobOptions2D = function () end
PhysicsMaterial2D = function () end
PhysicsUpdateBehaviour2D = function () end
Ping = function () end
Plane = function () end
PlatformEffector2D = function () end
PlayerPrefs = function () end
PlayerPrefsException = function () end
PointEffector2D = function () end
PolygonCollider2D = function () end
Pose = function () end
ProceduralMaterial = function () end
ProceduralPropertyDescription = function () end
ProceduralTexture = function () end
Projector = function () end
PropertyName = function () end
QualitySettings = function () end
Quaternion = function () end
Random = function () end
Classes = function () end
State = function () end
RangeInt = function () end
Ray = function () end
Ray2D = function () end
RaycastCommand = function () end
RaycastHit = function () end
RaycastHit2D = function () end
Rect = function () end
RectInt = function () end
Classes = function () end
PositionEnumerator = function () end
RectOffset = function () end
RectTransform = function () end
Enumerations = function () end
Axis = function () end
Edge = function () end
RectTransformUtility = function () end
ReflectionProbe = function () end
Enumerations = function () end
ReflectionProbeEvent = function () end
RelativeJoint2D = function () end
RemoteSettings = function () end
RenderBuffer = function () end
Renderer = function () end
RendererExtensions = function () end
RenderSettings = function () end
RenderTargetSetup = function () end
RenderTexture = function () end
RenderTextureDescriptor = function () end
Resolution = function () end
ResourceRequest = function () end
Resources = function () end
Rigidbody = function () end
Rigidbody2D = function () end
RuntimeAnimatorController = function () end
ScalableBufferManager = function () end
Screen = function () end
ScreenCapture = function () end
Enumerations = function () end
StereoScreenCaptureMode = function () end
ScriptableObject = function () end
Security = function () end
Shader = function () end
ShaderVariantCollection = function () end
Classes = function () end
ShaderVariant = function () end
SkeletonBone = function () end
SkinnedMeshRenderer = function () end
Skybox = function () end
SleepTimeout = function () end
SliderJoint2D = function () end
Social = function () end
SoftJointLimit = function () end
SoftJointLimitSpring = function () end
SortingLayer = function () end
SparseTexture = function () end
SphereCollider = function () end
SplatPrototype = function () end
SpringJoint = function () end
SpringJoint2D = function () end
Sprite = function () end
SpriteMask = function () end
SpriteRenderer = function () end
StateMachineBehaviour = function () end
StaticBatchingUtility = function () end
StreamingController = function () end
SurfaceEffector2D = function () end
SystemInfo = function () end
TargetJoint2D = function () end
Terrain = function () end
Enumerations = function () end
MaterialType = function () end
TerrainCollider = function () end
TerrainData = function () end
TerrainExtensions = function () end
TextAsset = function () end
TextGenerationSettings = function () end
TextGenerator = function () end
TextMesh = function () end
Texture = function () end
Texture2D = function () end
Enumerations = function () end
EXRFlags = function () end
Texture2DArray = function () end
Texture3D = function () end
Time = function () end
Touch = function () end
TouchScreenKeyboard = function () end
Enumerations = function () end
Status = function () end
TrailRenderer = function () end
Transform = function () end
Tree = function () end
TreeInstance = function () end
TreePrototype = function () end
UICharInfo = function () end
UILineInfo = function () end
UIVertex = function () end
Vector2 = function () end
Vector2Int = function () end
--Vector3 = function () end
Vector3Int = function () end
Vector4 = function () end
WaitForEndOfFrame = function () end
WaitForFixedUpdate = function () end
WaitForSeconds = function () end
WaitForSecondsRealtime = function () end
WaitUntil = function () end
WaitWhile = function () end
WebCamDevice = function () end
WebCamTexture = function () end
WebGLInput = function () end
WheelCollider = function () end
WheelFrictionCurve = function () end
WheelHit = function () end
WheelJoint2D = function () end
WindZone = function () end
WWW = function () end
WWWForm = function () end
YieldInstruction = function () end
";
}
}
}