Beispiel #1
0
        private NPC BuildNPCObjectWithDialogNodes(XmlNode characterNode)
        {
            NPC character;

            switch (characterNode.Attributes[0].Value)
            {
            case "HumanNPC":
                character = HumanNPC.BuildFromXmlNode(characterNode); break;

            case "MonsterNPC":
                character = MonsterNPC.BuildFromXmlNode(characterNode); break;

            case "BigMonsterNPC":
                character = BigMonsterNPC.BuildFromXmlNode(characterNode); break;

            case "PassivDialogNPC":
                character = PassivDialogNPC.BuildFromXmlNode(characterNode); break;

            case "GatekeeperNPC":
                character = GatekeeperNPC.BuildFromXmlNode(characterNode); break;

            case "DanielNPC":
                character = DanielNPC.BuildFromXmlNode(characterNode); break;

            default:
                throw new Exception("Character build failed - No type");
            }
            XmlNode dialogNode = characterNode.SelectSingleNode("child::*");

            if (dialogNode != null)
            {
                character.AddDialogNode(BuildDialogNodeObject(dialogNode));
            }
            return(character);
        }
    public void SpawnPassenger(Vector3 spawnPos)
    {
        Quaternion identity  = Quaternion.get_identity();
        HumanNPC   component = (HumanNPC)((Component)GameManager.server.CreateEntity(this.dismountablePrefab.resourcePath, spawnPos, identity, true)).GetComponent <HumanNPC>();

        component.Spawn();
        component.SetNavMeshEnabled(false);
        this.AttemptMount((BasePlayer)component);
    }
Beispiel #3
0
    public void SpawnPassenger(Vector3 spawnPos)
    {
        Quaternion quaternion = Quaternion.identity;
        HumanNPC   component  = GameManager.server.CreateEntity(this.dismountablePrefab.resourcePath, spawnPos, quaternion, true).GetComponent <HumanNPC>();

        component.Spawn();
        component.SetNavMeshEnabled(false);
        this.AttemptMount(component);
    }