Exemple #1
0
    private void Start()
    {
        Camera              = base.gameObject.AddComponent <Camera>();
        localPlayerMask     = LayerMask.NameToLayer("LocalPlayer");
        mainCamera          = Camera.main;
        Camera.cullingMask  = mainCamera.cullingMask;
        mainCamera.enabled  = false;
        base.gameObject.tag = "MainCamera";
        GameObject gameObject = GameObject.FindGameObjectWithTag(UIConstants.Tags.UI_Tray_Root);

        if (gameObject != null)
        {
            context = gameObject.GetComponent <StateMachineContext>();
            context.SendEvent(new ExternalEvent("Root", "noUI"));
        }
        Service.Get <EventDispatcher>().DispatchEvent(default(PlayerNameEvents.HidePlayerNames));
        DataEntityHandle        localPlayerHandle = Service.Get <CPDataEntityCollection>().LocalPlayerHandle;
        GameObjectReferenceData component         = default(GameObjectReferenceData);

        if (!localPlayerHandle.IsNull && Service.Get <CPDataEntityCollection>().TryGetComponent(localPlayerHandle, out component))
        {
            blobShadowCaster = component.GameObject.GetComponent <BlobShadowCaster>();
        }
        groupCulling = UnityEngine.Object.FindObjectOfType <GroupCulling>();
        if (groupCulling != null)
        {
            groupCulling.enabled = false;
        }
        GameObject gameObject2 = GameObject.Find("WorldChatCanvas");

        if (gameObject2 != null)
        {
            worldChatCanvas = gameObject2.GetComponent <Canvas>();
            if (worldChatCanvas != null)
            {
                worldChatCanvas.worldCamera = Camera;
            }
        }
        setLocalPlayerActive(isActive: false);
    }
 private void Awake()
 {
     avatarView       = GetComponent <AvatarView>();
     blobShadowCaster = GetComponent <BlobShadowCaster>();
 }