mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-30 15:59:09 +00:00
25 lines
691 B
C#
25 lines
691 B
C#
|
using SanAndreasUnity.Importing.RenderWareStream;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace SanAndreasUnity.Behaviours.World
|
|||
|
{
|
|||
|
public class LightSource : MonoBehaviour
|
|||
|
{
|
|||
|
public TwoDEffect.Light LightInfo { get; private set; }
|
|||
|
|
|||
|
public static LightSource Create(
|
|||
|
Transform parent,
|
|||
|
TwoDEffect.Light lightInfo)
|
|||
|
{
|
|||
|
var go = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
|||
|
go.transform.SetParent(parent);
|
|||
|
go.transform.localPosition = lightInfo.Position;
|
|||
|
|
|||
|
var lightSource = go.AddComponent<LightSource>();
|
|||
|
lightSource.LightInfo = lightInfo;
|
|||
|
|
|||
|
return lightSource;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|