Hey there,
I have the following class
public class SignalSender : MonoBehaviour
{
public bool onlyOnce;
public ReceiverItem[ ] receivers;
private bool hasFired = false;
public void SendSignals ( MonoBehaviour sender )
{
if (hasFired == false || onlyOnce == false) {
for (int i = 0; i < receivers.Length; i++)
{
sender.StartCoroutine (receivers*.SendWithDelay(sender));*
}
hasFired = true;
}
}
}
public class ReceiverItem : MonoBehaviour
{
public GameObject receiver;
public string action = “OnSignal”;
public float delay;
public void Init ()
{
receiver = null;
action = “OnSignal”;
delay = 0;
}
public IEnumerator SendWithDelay ( MonoBehaviour sender )
{
yield return new WaitForSeconds (delay);
if (receiver)
receiver.SendMessage (action);
else
Debug.LogWarning (“No receiver of signal "”+action+“" on object “+sender.name+” (”+sender.GetType().Name+“)”, sender);
}
}
And I want SignalSender to look like this in inspector:
Same code as a both in Javascript does exact what I want but somehow converted to C# it looks like this
Can someonehelp me?