added TeleportPlayerAction class, updated UnfreezePlayerAction and SequenceActionDrawer to include teleport functionality

This commit is contained in:
Данил Ярош 2025-12-24 09:05:39 +03:00
parent c3290d80dd
commit 384a8fad82
10 changed files with 253956 additions and 360564 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
using System.Collections;
using RR.Game2D.Core.Managers;
using UnityEngine;
namespace RR.Common.Behaviour
{
public class TeleportPlayerAction : SequenceAction
{
[SerializeField] private bool useRelativePosition = false;
[SerializeField] private Vector3 position;
public override IEnumerator Execute(Sequencer context, GameObject target)
{
GameObject playerObj = target;
if (!playerObj || !playerObj.CompareTag("Player")) playerObj = GameManager.Instance.PlayerObj;
if (useRelativePosition)
{
playerObj.transform.position += position;
}
else
{
playerObj.transform.position = position;
}
yield return null;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f9eb68ed1fbf484583461c4a858f6bd2
timeCreated: 1766491262

View File

@ -1,8 +1,10 @@
using System;
using System.Collections;
using UnityEngine;
namespace RR.Common.Behaviour
{
[Serializable]
public class UnfreezePlayerAction : SequenceAction
{
public override IEnumerator Execute(Sequencer context, GameObject target)

View File

@ -15,6 +15,7 @@ namespace RR.Common.InspectorOverrides
{ "Удалить объект", typeof(DeleteGameObjectAction) },
{ "Поведение игрока/Заморозить игрока", typeof(FreezePlayerAction) },
{ "Поведение игрока/Разморозить игрока", typeof(UnfreezePlayerAction) },
{ "Поведение игрока/Телепортировать игрока", typeof(TeleportPlayerAction) },
{ "Поведение диалога/Добавить сообщение", typeof(AddMessageAction) },
{ "Поведение сообщения/Появление сообщения", typeof(MessageAppearAction) },
{ "Поведение сообщения/Исчезновение сообщения", typeof(MessageDisappearAction) },

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ad0add7ebdc975d40aabb0cb7e06770e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: bb456ced8ebe5c14682d1e8345303da6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: