Esempio n. 1
0
 void Start()
 {
     dots  = ".";
     lings = GameObject.FindObjectOfType <LiNGSClientManager>();
     reconnectButton.OnAction += reconnectButton_OnAction;
     exitButton.OnAction      += exitButton_OnAction;
 }
Esempio n. 2
0
 void Start()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 void disconnectButton_OnAction(MenuButton button, MenuButton.ButtonState newState)
 {
     if (newState == MenuButton.ButtonState.Normal)
     {
         LiNGSClientManager lings = GameObject.FindObjectOfType <LiNGSClientManager>();
         if (lings != null)
         {
             lings.Client.Disconnect();
         }
     }
 }
Esempio n. 5
0
    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);
    }
Esempio n. 6
0
    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;
        }
    }
Esempio n. 7
0
 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);
     }
 }