Karasukaigan_unity-i-wanna-maker/I Wanna Maker/Assets/Scripts/Gameplay/PlayerEnteredVictoryZone.cs
using Platformer.Core;
using Platformer.Mechanics;
using Platformer.Model;

namespace Platformer.Gameplay
{
    /// <summary>
    /// 当玩家进入VictoryZone时触发。
    /// 若要使用，需要给空物体添加VictoryZone脚本和碰撞器。
    /// </summary>
    /// <typeparam name="PlayerEnteredVictoryZone"></typeparam>
    public class PlayerEnteredVictoryZone : Simulation.Event<PlayerEnteredVictoryZone>
    {
        public VictoryZone victoryZone;

        PlatformerModel model = Simulation.GetModel<PlatformerModel>();

        public override void Execute()
        {
            model.player.animator.SetTrigger("victory");
            model.player.controlEnabled = false;
        }
    }
}