26 lines
561 B
C#
26 lines
561 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using BITKit.Entities;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace BITFALL.Scene
|
||
|
{
|
||
|
public class ActionBasedPlayerPositionFIx : ActionBasedComponent
|
||
|
{
|
||
|
[SerializeField] private Transform reference;
|
||
|
private void Start()
|
||
|
{
|
||
|
actionBasedObject.OnStarted += OnStart;
|
||
|
}
|
||
|
|
||
|
private void OnStart()
|
||
|
{
|
||
|
if (actionBasedObject.Entity.TryGetComponent<IEntityMovement>(out var movement) is false) return;
|
||
|
movement.Position = reference.position;
|
||
|
movement.Rotation = reference.rotation;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|