Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
using CavrnusSdk.API;
using CavrnusSdk.Flags;
using UnityEngine;

public class DestroyObject : MonoBehaviour
{
    public void DestroyMe()
    {
        if (GetComponent<CavrnusSpawnedObjectFlag>() == null)
            Debug.LogError("This object was not spawned via Cavrnus, cannot destroy it");

        CavrnusSpawnedObject spawnedObject = GetComponent<CavrnusSpawnedObjectFlag>().SpawnedObject;

        spawnedObject.DestroyObject();
    }
}