// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.Utilities;
namespace FlaxEditor.Surface
{
///
/// Represents parameter in the Surface.
///
[HideInEditor]
public class SurfaceParameter
{
///
/// The default prefix for drag data used for .
///
public const string DragPrefix = "SURFPARAM!?";
///
/// Parameter type
///
[NoSerialize, HideInEditor]
public ScriptType Type;
///
/// Parameter unique ID
///
public Guid ID;
///
/// Parameter name
///
public string Name;
///
/// True if is exposed outside
///
public bool IsPublic;
///
/// Parameter value
///
public object Value;
///
/// The metadata.
///
[NoSerialize, HideInEditor]
public readonly SurfaceMeta Meta = new SurfaceMeta();
///
/// Creates the new parameter of the given type.
///
/// The type.
/// The name.
/// The created parameter.
public static SurfaceParameter Create(ScriptType type, string name)
{
return new SurfaceParameter
{
ID = Guid.NewGuid(),
IsPublic = true,
Name = name,
Type = type,
Value = TypeUtils.GetDefaultValue(type),
};
}
}
}