OcCubeValuables
Adds my friends ocs as cubes
模組介紹 作者原文
using System;
using System.Collections;
using System.Collections.Generic;
using Photon.Pun;
using UnityEngine;
using UnityEngine.AI;
public class ValuableObject: MonoBehaviour
{
[Serializable]
public class ExtractionPointTracking
{
public GameObject extractionPoint;
public int closestRingReached;
public float localPlayerHaulToExtraction;
public ExtractionPointTracking(GameObject _extractionPoint)
{
extractionPoint = _extractionPoint;
closestRingReached = -1;
localPlayerHaulToExtraction = 0f;
}
}
[Space(40f)]
[Header("Presets")]
public Durability durabilityPreset;
public Value valuePreset;
public PhysAttribute physAttributePreset;
public PhysAudio audioPreset;
[Range(0.5f, 3f)]
public float audioPresetPitch = 1f;
public Gradient particleColors;
[Space(70f)]
public ValuableVolume.Type volumeType;
public bool debugVolume = true;
private PhysGrabObjectImpactDetector impactDetector;
[Space(20f)]
internal float dollarValueOriginal = 100f;
internal float dollarValueCurrent = 100f;
internal bool dollarValueSet;
internal int dollarValueOverride;
private Rigidbody rb;
private PhotonView photonView;
private NavMeshObstacle navMeshObstacle;
private bool inStartRoom;
private float inStartRoomCheckTimer;
internal RoomVolumeCheck roomVolumeCheck;
internal PhysGrabObject physGrabObject;
internal bool discovered;
internal bool discoveredReminder;
private float discoveredReminderTimer;
private List extractionPointTrackings = new List();
private bool extractionTrackingInitialized;
private Vector3 lastExtractionTrackingPosition;
private Dictionary playerGrabbedTime = new Dictionary();
private Dictionary> cartSnapshots = new Dictionary>();
private float lastGrabbedTimeUpdate;
[SerializeField]
private DebugValuableMeshes debugValuableMeshes;
private void Awake()
{
photonView = GetComponent();
}
private void Start()
{
physGrabObject = GetComponent();
roomVolumeCheck = GetComponent();
impactDetector = GetComponent();
float num = Mathf.Max(base.transform.localScale.x, base.transform.localScale.y, base.transform.localScale.z);
if (num > 1f)
{
float t = Mathf.Clamp01((num - 1f) / 1f);
audioPresetPitch = Mathf.Lerp(audioPresetPitch, 0.65f, t);
}
navMeshObstacle = GetComponent();
if ((bool)navMeshObstacle)
{
Debug.LogError(base.gameObject.name + " has a NavMeshObstacle component. Please remove it.");
}
StartCoroutine(DollarValueSet());
rb = GetComponent();
if ((bool)physAttributePreset)
{
if ((bool)rb)
{
rb.mass = physAttributePreset.mass;
}
if ((bool)physGrabObject)
{
physGrabObject.massOriginal = physAttributePreset.mass;
}
}
else if ((bool)rb || (bool)physGrabObject || (bool)impactDetector)
{
Debug.LogError(base.gameObject.name + " is missing a PhysAttributePreset.", base.gameObject);
}
if (!LevelGenerator.Instance.Generated)
{
ValuableDirector.instance.valuableSpawnAmount++;
}
ValuableDirector.instance.valuableList.Add(this);
if (volumeType () &&!RoundDirector.instance.dollarHaulList.Contains(base.gameObject))
{
RoundDirector.instance.dollarHaulList.Add(base.gameObject);
}
}
[PunRPC]
public void AddToDollarHaulListRPC(PhotonMessageInfo _info = default(PhotonMessageInfo))
{
if (SemiFunc.MasterOnlyRPC(_info) && (bool)GetComponent() &&!RoundDirector.instance.dollarHaulList.Contains(base.gameObject))
{
RoundDirector.instance.dollarHaulList.Add(base.gameObject);
}
}
private void RemoveFromDollarHaulList()
{
if (GameManager.instance.gameMode == 1)
{
photonView.RPC("RemoveFromDollarHaulListRPC", RpcTarget.All);
}
else if ((bool)GetComponent() && RoundDirector.instance.dollarHaulList.Contains(base.gameObject))
{
RoundDirector.instance.dollarHaulList.Remove(base.gameObject);
}
}
[PunRPC]
public void RemoveFromDollarHaulListRPC(PhotonMessageInfo _info = default(PhotonMessageInfo))
{
if (SemiFunc.MasterOnlyRPC(_info) && (bool)GetComponent() && RoundDirector.instance.dollarHaulList.Contains(base.gameObjec
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: