Exemple #1
0
 void Start()
 {
     dots  = ".";
     lings = GameObject.FindObjectOfType <LiNGSClientManager>();
     reconnectButton.OnAction += reconnectButton_OnAction;
     exitButton.OnAction      += exitButton_OnAction;
 }
Exemple #2
0
 void Start()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Exemple #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;
 }
Exemple #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();
         }
     }
 }
Exemple #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);
    }
Exemple #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;
        }
    }
Exemple #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);
     }
 }