Beispiel #1
0
    void SetDataPlayer(EPlayerController p, int i)
    {
        if (p != null)
        {
            UIContainerAnonymous anony = kickButton[i].gameObject.GetComponent <UIContainerAnonymous>();
            if (anony == null)
            {
                anony = kickButton[i].gameObject.AddComponent <UIContainerAnonymous>();
            }
            anony.intermediary = p;
        }

        Texture avatar = null;

        if (p != null)
        {
            p.AvatarTexture(delegate(Texture _texture) { avatar = _texture; });
        }

        string username = p != null ? p.username : "";

        kickAvatar[i].mainTexture = swappedAvatar[i].mainTexture = avatar;

        Color white = Color.white;

        if (p == null)
        {
            white.a = 0f;
        }
        kickAvatar[i].color = swappedAvatar[i].color = white;

        kickUsername[i].text = swappedUsername[i].text = username;

        kickButton[i].gameObject.SetActive(p != null);
        kickAvatar[i].gameObject.SetActive(p != null);

        int slot = GameModelChan.YourController.slotServer;

        slot += (i + 1);
        if (slot >= 4)
        {
            slot -= 4;
        }

        swappedAvatar[i].gameObject.GetComponent <UIContainerAnonymous>().valueInt = slot;
    }
    public virtual void SetDataPlayer(EPlayerController p, int i)
    {
        if (p != null)
        {
            UIContainerAnonymous anony = kickButton[i].gameObject.GetComponent <UIContainerAnonymous>();
            if (anony == null)
            {
                anony = kickButton[i].gameObject.AddComponent <UIContainerAnonymous>();
            }
            anony.intermediary = p;
        }

        Texture avatar = null;

        if (p != null)
        {
            p.AvatarTexture(delegate(Texture _texture) { avatar = _texture; });
        }

        string username = p != null ? p.username : "";

        kickAvatar[i].mainTexture = swappedAvatar[i].mainTexture = avatar;

        Color white = Color.white;

        if (p == null)
        {
            white.a = 0f;
        }
        kickAvatar[i].color = swappedAvatar[i].color = white;

        kickUsername[i].text = swappedUsername[i].text = username;

        kickButton[i].gameObject.SetActive(p != null);
        kickAvatar[i].gameObject.SetActive(p != null);
    }