// overrides

    void Start()
    {
        _debug = FindObjectOfType <DebugDesk>();

        _light     = GetComponentInChildren <Light>();
        _fpc       = GetComponent <FirstPersonController>();
        _infoPanel = FindObjectOfType <InfoDock>();

        int index;

        lock (_mutex)
        {
            index = _index++;
            if (_index >= avatars.Length)
            {
                _index = 0;
            }
        }

        CreateAvatar(index);

        if (!isLocalPlayer)
        {
            return;
        }

        Camera.main.transform.parent        = GetComponent <FirstPersonController>().transform;
        Camera.main.transform.localPosition = new Vector3(0, 0, 0.3f);

        _avatar.transform.forward = Camera.main.transform.forward;
    }
Exemple #2
0
        public static IDock DockFactory(string DockName, PageControl page)
        {
            IDock  dock;
            string str = DockName;

            if (str != null)
            {
                if (!(str == "IconDock"))
                {
                    if (str == "InfoDock")
                    {
                        dock = new InfoDock(page);
                        goto Label_0061;
                    }
                    if (str == "JScardDock")
                    {
                        dock = new JScardDock(page);
                        goto Label_0061;
                    }
                    if (str == "TongjiDock")
                    {
                        dock = new TongjiDock(page);
                        goto Label_0061;
                    }
                }
                else
                {
                    dock = new IconDock(page);
                    goto Label_0061;
                }
            }
            dock = null;
Label_0061:
            if (dock != null)
            {
                dock.Size = new Size(HeadWidth, HeadHeight);
                dock.LoadUser(UserName);
            }
            return(dock);
        }