public static void InitializePlayerMods(VRC_PlayerMods mods) { CyanEmuPlayerModsHelper helper = mods.gameObject.AddComponent <CyanEmuPlayerModsHelper>(); helper.mods_ = mods; if (mods.isRoomPlayerMods) { if (roomMods != null) { helper.LogWarning("Multiple room player mods!"); } roomMods = helper; } }
private void Start() { Camera refCamera = null; if (descriptor_.ReferenceCamera != null) { refCamera = descriptor_.ReferenceCamera.GetComponent <Camera>(); } if (refCamera == null) { refCamera = Camera.main; } if (refCamera == null) { GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); if (mainCamera != null) { refCamera = mainCamera.GetComponent <Camera>(); } } CopyCameraValues(refCamera, camera_); if (CyanEmuCombatSystemHelper.instance != null) { CyanEmuCombatSystemHelper.instance.CreateVisualDamage(); } // Go through all ui shapes to update canvas cameras? foreach (var ui in FindObjectsOfType <VRC_UiShape>()) { Canvas canvas = ui.GetComponent <Canvas>(); if (canvas == null) { continue; } canvas.worldCamera = camera_; } #if VRC_SDK_VRCSDK2 CyanEmuPlayerModsHelper.ApplyRoomMods(this); #endif }