Пример #1
0
 private void FixMapObjectsZ()
 {
     foreach (GameObject mapObject in MapObjects)
     {
         CurrentGame.FixZ(mapObject);
     }
 }
Пример #2
0
    private static void DisplayNotification(string text)
    {
        Displaying = true;
        GameObject noti = Instantiate(Resources.Load("Notification") as GameObject, InGameUIManager.s_Singleton.LogNotifications, false);
        //GameObject noti = (GameObject)Instantiate(Resources.Load("Notification"), Vector3.zero, Quaternion.identity);
        Notification script = noti.GetComponent <Notification>();

        script.SetText(text);
        CurrentGame.FixZ(noti);
    }
Пример #3
0
    protected void HandleBulkLocation(MessageWrapper message)
    {
        BulkLocationMessage blm = JsonUtility.FromJson <BulkLocationMessage>(message.message);

        CurrentGame.Instance.TagablePlayers = new List <string>();

        IDictionary <string, GameObject> playerObjects = CurrentGame.Instance.PlayerObjects;

        foreach (GameObject playerObj in playerObjects.Values)
        {
            playerObj.SetActive(false);
        }

        foreach (KeyValuePair <string, Point> playerLocation in blm.Taggable)
        {
            //todo these players are taggable and need to be drawn on screen
            if (playerObjects.ContainsKey(playerLocation.Key))
            {
                GameObject go = playerObjects[playerLocation.Key];
                go.SetActive(true);
                Coordinates coordinates = new Coordinates(playerLocation.Value.latitude, playerLocation.Value.longitude, 0);
                go.transform.localPosition = coordinates.convertCoordinateToVector(0);
                CurrentGame.FixZ(go);
            }
        }

        foreach (KeyValuePair <string, Point> playerLocation in blm.Locations)
        {
            //todo these players only need to be drawn on screen
            if (playerObjects.ContainsKey(playerLocation.Key))
            {
                GameObject go = playerObjects[playerLocation.Key];
                go.SetActive(true);
                Coordinates coordinates = new Coordinates(playerLocation.Value.latitude, playerLocation.Value.longitude, 1);

                //move the object
                //StartCoroutine(MoveOverSeconds(go, coordinates.convertCoordinateToVector(0), 0.75f));
                go.transform.localPosition = coordinates.convertCoordinateToVector(0);
                CurrentGame.FixZ(go);
            }
        }


        if (blm.Taggable.Count > 0)
        {
            CurrentGame.Instance.TagablePlayers = new List <string>(blm.Taggable.Keys);
            CurrentGame.Instance.UIPlayer.OnTaggablePlayers();
            //todo enable tagging of players
        }
    }