コード例 #1
0
ファイル: Person.cs プロジェクト: LorrMaster/daggerfall-unity
        public override void Tick(Quest caller)
        {
            base.Tick(caller);

            // Auto-assign NPC to home Place if available and player enters
            // This only happens for very specific NPC types
            // Equivalent to calling "place anNPC at aPlace" from script
            // Will not be called again as assignment is permanent for duration of quest
            if (homePlaceSymbol != null && !assignedToHome)
            {
                Place home = ParentQuest.GetPlace(homePlaceSymbol);
                if (home == null)
                {
                    return;
                }

                if (home.IsPlayerHere())
                {
                    // Create SiteLink if not already present
                    if (!QuestMachine.HasSiteLink(ParentQuest, homePlaceSymbol))
                    {
                        QuestMachine.CreateSiteLink(ParentQuest, homePlaceSymbol);
                    }

                    // Hot-place NPC at this location
                    home.AssignQuestResource(Symbol);
                    assignedToHome = true;
                }
            }
        }
コード例 #2
0
        public override void Tick(Quest caller)
        {
            base.Tick(caller);

            // Auto-assign NPC to home Place if available and player enters
            // This only happens for very specific NPC types
            // Equivalent to calling "place anNPC at aPlace" from script
            // Will not be called again as assignment is permanent for duration of quest
            if (homePlaceSymbol != null && !assignedToHome)
            {
                Place home = ParentQuest.GetPlace(homePlaceSymbol);
                if (home == null)
                {
                    return;
                }

                // Hot-place NPC at this location when player enters
                if (home.IsPlayerHere())
                {
                    PlaceAtHome();
                }
            }
        }