Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
24 lines
721 B
C#
24 lines
721 B
C#
using System;
|
|
using System.Collections;
|
|
using RR.Game2D.Core.Managers;
|
|
using UnityEngine;
|
|
|
|
namespace RR.Common.Behaviour
|
|
{
|
|
[Serializable]
|
|
public class UnfreezePlayerAction : SequenceAction
|
|
{
|
|
public override IEnumerator Execute(Sequencer context, GameObject target)
|
|
{
|
|
GameObject playerObject = target;
|
|
|
|
if (!playerObject || !playerObject.CompareTag("Player")) playerObject = GameManager.Instance.PlayerObj;
|
|
|
|
if (!playerObject || !playerObject.CompareTag("Player")) yield break;
|
|
|
|
playerObject.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeRotation;
|
|
|
|
yield return null;
|
|
}
|
|
}
|
|
} |