Beispiel #1
0
    public void ChangeCode(string newCode)
    {
        Code = "require 'tilelib'\n" + newCode;
        LuaEnv.DoString(Code);

        BindEvent?.Invoke();
        UStart?.Invoke();
    }
Beispiel #2
0
        public void Bind(Action <Texture2D> onClick, Texture2D texture)
        {
            this.texture = texture;
            this.onClick = onClick;

            image.texture = texture;
            button.onClick.AddListener(Button_OnClick);

            OnBind.Invoke(texture);
        }
Beispiel #3
0
        public void Bind(RoomClient client, IPeer peer, bool isMe)
        {
            ClearBinding();

            this.roomClient            = client;
            this.peer                  = peer;
            this.isMe                  = isMe;
            this.peerConnectionManager = VoipPeerConnectionManager.Find(this);

            OnBind.Invoke(client, peer);
        }
Beispiel #4
0
    // Use this for initialization
    protected void Start()
    {
        LuaEnv     = new LuaEnv();
        BindEvent += Binding;
        BindEvent += BindLocalMethod;

        UUpdate += OUpdate;
        UStart  += OStart;

        BindEvent?.Invoke();
        UStart?.Invoke();
    }
Beispiel #5
0
        public void Bind(RoomClient client, IRoom roomInfo)
        {
            Name.text      = roomInfo.Name;
            SceneName.text = roomInfo["scene-name"];

            var image = roomInfo["scene-image"];

            if (image != null && image != existing)
            {
                client.GetBlob(roomInfo.UUID, image, (base64image) =>
                {
                    if (base64image.Length > 0)
                    {
                        var texture = new Texture2D(1, 1);
                        texture.LoadImage(Convert.FromBase64String(base64image));
                        existing             = image;
                        ScenePreview.texture = texture;
                    }
                });
            }

            OnBind.Invoke(client, roomInfo);
        }