You should really learn to code first, before you are messing with Unity. Your code gives you errors because:
You declared a methode in a methode
You declared const vars in a methode
You give vars in a methode privatie settings
Here is your code corrected:
using UnityEngine;
using System.Collections;
public class NetworkController : MonoBehaviour
{
private const string typeName = "TestGame";
private const string gameName = "Room1";
// Use this for initialization
void Start()
{
StartServer();
}
private void StartServer()
{
Network.InitializeServer(4, 25000, !Network.HavePublicAddress());
MasterServer.RegisterHost(typeName, gameName);
}
// Update is called once per frame
void Update()
{
}
}
I don't really recommend it, as a simple loop would be more readable and more efficient, but this fits your one line requirement using System.Linq LightSources.ForEach(light => light.enabled = false); still just a loop on the backend
You can have it :)
– BabilinAppsI don't really recommend it, as a simple loop would be more readable and more efficient, but this fits your one line requirement using System.Linq LightSources.ForEach(light => light.enabled = false); still just a loop on the backend
– roojerry