Added player character and step in/out of dialogue in scene 101

This commit is contained in:
2026-08-15 15:22:47 +02:00
parent a42f25d5fa
commit 38ba2b0eff
2019 changed files with 181227 additions and 265 deletions
@@ -0,0 +1,41 @@
using UnityEngine;
using UnityEngine.SceneManagement;
namespace UnityEngine.ProBuilder
{
/// <summary>
/// A MonoBehaviour that automatically enables and disables the parent GameObject on exiting and enterin playmode, respectively.
/// </summary>
[DisallowMultipleComponent]
sealed class TriggerBehaviour : EntityBehaviour
{
public override void Initialize()
{
var collision = gameObject.GetComponent<Collider>();
if (!collision)
collision = gameObject.AddComponent<MeshCollider>();
var meshCollider = collision as MeshCollider;
if (meshCollider)
meshCollider.convex = true;
collision.isTrigger = true;
SetMaterial(BuiltinMaterials.triggerMaterial);
}
public override void OnEnterPlayMode()
{
if (TryGetComponent<Renderer>(out var r))
r.enabled = false;
}
public override void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (TryGetComponent<Renderer>(out var r))
r.enabled = false;
}
}
}