void Start() { dots = "."; lings = GameObject.FindObjectOfType <LiNGSClientManager>(); reconnectButton.OnAction += reconnectButton_OnAction; exitButton.OnAction += exitButton_OnAction; }
void Start() { if (instance != null) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); }
void Start() { levelLoader.LoadLevel(Hypervisor.Default != null ? Hypervisor.Default.levelName ?? "level0" : "level0"); lings = GameObject.FindObjectOfType <LiNGSClientManager>(); lings.OnDisconnected += lings_OnDisconnected; lings.OnConnectionAccepted += lings_OnConnectionAccepted; lings.OnUnableToConnect += lings_OnUnableToConnect; lings.OnConnectionRefused += lings_OnConnectionRefused; lings.OnReceiveGameMessage += lings_OnReceiveGameMessage; connected = true; }
void disconnectButton_OnAction(MenuButton button, MenuButton.ButtonState newState) { if (newState == MenuButton.ButtonState.Normal) { LiNGSClientManager lings = GameObject.FindObjectOfType <LiNGSClientManager>(); if (lings != null) { lings.Client.Disconnect(); } } }
void Start() { lings = GameObject.FindObjectOfType <LiNGSClientManager>(); lings.OnReceiveGameMessage += lings_OnReceiveGameMessage; movementJoystick.JoystickMovedEvent += movementJoystick_JoystickMovedEvent; rotationJoystick.JoystickMovedEvent += rotationJoystick_JoystickMovedEvent; rotationJoystick.FingerTouchedEvent += rotationJoystick_FingerTouchedEvent; rotationJoystick.FingerLiftedEvent += rotationJoystick_FingerLiftedEvent; movementJoystick.gameObject.SetActive(false); movementJoystick.gameObject.SetActive(true); }
void Start() { objectTypeCache = new Dictionary <string, GameObject>() { { "Striker.Characters.NPC", NPCPrefab }, { "Striker.Characters.Player", NPCPrefab }, { "Striker.Characters.CPlayer", PlayerPrefab }, { "Striker.Elements.Bullet", BulletPrefab } }; lings = GameObject.FindObjectOfType <LiNGSClientManager>(); if (lings != null) { lings.ObjectManager = this; } }
void exitButton_OnAction(MenuButton button, MenuButton.ButtonState newState) { if (newState == MenuButton.ButtonState.Normal) { LiNGSClientManager lings = GameObject.FindObjectOfType <LiNGSClientManager>(); if (lings != null) { lings.Client.Disconnect(); } NetworkServer ns = GameObject.FindObjectOfType <NetworkServer>(); if (ns != null) { ns.Shutdown(); } Application.LoadLevel(0); } }