コード例 #1
0
ファイル: Kid_FollowPlayer.cs プロジェクト: jushii/GGJ2021
    public override void OnEnter(object args = null)
    {
        Kid k = npc as Kid;

        k.PlayWalkAnimation();

        if (args is Player player)
        {
            _followedPlayer = player;

            // First add the kid as a new follower.
            _followedPlayer.AddFollower(npc as Kid);

            // Promo guy count should not exceed the follower kid count.
            if (!_isPromoGuySpawnedForThisKid)
            {
                _isPromoGuySpawnedForThisKid = true;
                _promotionGuyManager.SpawnPromotionGuy();
            }
        }
        else
        {
            _aiManager.ChangeState(npc, typeof(Kid_Idle));
        }
    }
コード例 #2
0
    public override void OnEnter(object args = null)
    {
        Kid k = npc as Kid;

        k.PlayWalkAnimation();

        _followedPromotionGuy = args as PromotionGuy;
        npc.StartFollowing(_followedPromotionGuy.transform);
    }