Пример #1
0
    public void MapChanged(S.MapChanged p)
    {
        foreach (var ob in ObjectList.ToArray())
        {
            Destroy(ob.Value.gameObject);
        }
        ObjectList.Clear();

        ClearAction();
        User.Player.CurrentLocation = new Vector2(p.Location.X, p.Location.Y);

        if (p.SceneName != CurrentScene.gameObject.scene.name)
        {
            FindObjectOfType <LoadScreenManager>().ChangeScene(p.SceneName, p.FileName, CurrentScene.gameObject.scene);
        }
        else
        {
            if (p.FileName != CurrentScene.FileName)
            {
                CurrentScene.LoadMap(p.FileName);
            }
            Network.Enqueue(new C.MapChanged {
            });
            UserGameObject.transform.position = CurrentScene.Cells[(int)User.Player.CurrentLocation.x, (int)User.Player.CurrentLocation.y].position;
        }
    }
Пример #2
0
    public void MapChanged(S.MapChanged p)
    {
        ClearObjects();
        ClearAction();
        User.Player.CurrentLocation = new Vector2Int(p.Location.X, p.Location.Y);

        if (p.SceneName != CurrentScene.gameObject.scene.name)
        {
            FindObjectOfType <LoadScreenManager>().ChangeScene(p.SceneName, p.FileName, CurrentScene.gameObject.scene);
        }
        else
        {
            if (p.FileName != CurrentScene.FileName)
            {
                CurrentScene.LoadMap(p.FileName);
            }
            Network.Enqueue(new C.MapChanged {
            });
            UserGameObject.transform.position = CurrentScene.Cells[User.Player.CurrentLocation.x, User.Player.CurrentLocation.y].position;
        }
    }
Пример #3
0
 public static void MapChanged(S.MapChanged p)
 {
     gameManager.MapChanged(p);
 }