Remove undead and inorganic enemies from Aswid diet
This commit is contained in:
parent
824622c582
commit
68dd2329dd
2 changed files with 9 additions and 17 deletions
|
|
@ -124,21 +124,26 @@ namespace RacesOfValheim
|
|||
GameObject trophyPrefab = PrefabManager.Cache.GetPrefab<ItemDrop>("TrophyGoblin")?.gameObject;
|
||||
if (trophyPrefab != null)
|
||||
{
|
||||
// instantiateInWorldSpace = false per ereditare esattamente la trasformazione base
|
||||
bool wasActive = trophyPrefab.activeSelf;
|
||||
trophyPrefab.SetActive(false);
|
||||
GameObject trophyVisual = UnityEngine.Object.Instantiate(trophyPrefab, headBone, false);
|
||||
trophyPrefab.SetActive(wasActive);
|
||||
|
||||
trophyVisual.name = "FurlingHead_Trophy";
|
||||
|
||||
// Rimuoviamo tutti gli script (HoverText, ZNetView, ItemDrop, ecc.) per evitare prompt a schermo
|
||||
foreach (var comp in trophyVisual.GetComponentsInChildren<MonoBehaviour>())
|
||||
{
|
||||
UnityEngine.Object.Destroy(comp);
|
||||
UnityEngine.Object.DestroyImmediate(comp);
|
||||
}
|
||||
if (trophyVisual.GetComponent<Rigidbody>() != null)
|
||||
UnityEngine.Object.Destroy(trophyVisual.GetComponent<Rigidbody>());
|
||||
UnityEngine.Object.DestroyImmediate(trophyVisual.GetComponent<Rigidbody>());
|
||||
foreach (var col in trophyVisual.GetComponentsInChildren<Collider>())
|
||||
{
|
||||
UnityEngine.Object.Destroy(col);
|
||||
UnityEngine.Object.DestroyImmediate(col);
|
||||
}
|
||||
|
||||
trophyVisual.SetActive(true);
|
||||
// Valheim rig scales are huge (100).
|
||||
// Spostiamo la testa leggermente in alto (asse Y = 0.0015) e 5cm indietro rispetto al centro (asse X positivo = 0.0005)
|
||||
trophyVisual.transform.localPosition = new Vector3(0.0005f, 0.0015f, 0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue