Hi folks,
I got this C#, but I have no experience with C#. Is there someone who can translate this C# script into JavaScript?
using UnityEngine;
using System.Collections;
public class MyUnitySingleton : MonoBehaviour {
private static MyUnitySingleton instance = null;
public static MyUnitySingleton Instance
{
get
{
return instance;
}
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(this.gameObject);
return;
}
else
{
instance = this;
}
DontDestroyOnLoad(this.gameObject);
}
}
Thanks in advance.
Have you at least tried converting it? This script is fairly easy to convert, even without C# knowledge. I will gladly help, if you write which part of this script you have problem with.
– ArkaneXThere´s another solution: forget javascript and learn the joy of C# :D
– MrVerdoux