1
This commit is contained in:
29
Assets/Artists/Scripts/UnityDecalTool.cs
Normal file
29
Assets/Artists/Scripts/UnityDecalTool.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BITKit;
|
||||
using BITKit.Entities;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace BITFactory.Cutting
|
||||
{
|
||||
[CustomType(typeof(IDecalTool))]
|
||||
public class UnityDecalTool : EntityBehavior,IDecalTool
|
||||
{
|
||||
[SerializeField] private DecalProjector decalProjector;
|
||||
private void Start()
|
||||
{
|
||||
decalProjector.gameObject.SetActive(false);
|
||||
}
|
||||
public ITransform Create(string base64, float3 position = default, quaternion rotation = default, float3 scale = default)
|
||||
{
|
||||
|
||||
var decal = Instantiate(decalProjector, position, rotation);
|
||||
decal.gameObject.SetActive(true);
|
||||
return decal.transform.ToUnityTransform();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user