mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 06:20:17 +00:00
30 lines
847 B
C#
30 lines
847 B
C#
using UnityEngine;
|
|
|
|
namespace SanAndreasUnity.Behaviours.World
|
|
{
|
|
[DisallowMultipleComponent]
|
|
public class FocusPoint : MonoBehaviour
|
|
{
|
|
public FocusPointParameters parameters = FocusPointParameters.Default;
|
|
|
|
|
|
public static FocusPoint Create(GameObject targetGameObject, FocusPointParameters parameters)
|
|
{
|
|
var focusPoint = targetGameObject.AddComponent<FocusPoint>();
|
|
focusPoint.parameters = parameters;
|
|
return focusPoint;
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
if (Cell.Instance != null)
|
|
Cell.Instance.RegisterFocusPoint(this.transform, this.parameters);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
if (Cell.Instance != null)
|
|
Cell.Instance.UnRegisterFocusPoint(this.transform);
|
|
}
|
|
}
|
|
}
|