Ejemplo n.º 1
0
    public override void OnEvent(SpawnActorEvent evnt)
    {
        //Debug.LogWarning("Actor Spawn raised by " + evnt.RaisedBy);

        if (BoltNetwork.isServer)
        {
            ActorObjectRegistry.CreateServerActor().Spawn(evnt.ActorPrefab, (ActorSpawnToken)evnt.ActorSpawnToken);
        }
    }
Ejemplo n.º 2
0
    // Actor ID -> which NPC to load from the database.
    void SpawnActor()
    {
        ActorSpawnToken token = new ActorSpawnToken();

        token.actorID  = actor.GetComponent <ActorNPC>().npcID;
        token.actorPos = transform.position;

        var evnt = SpawnActorEvent.Create();

        evnt.ActorSpawnToken = token;
        evnt.ActorPrefab     = actor.GetComponent <BoltEntity>().prefabId;

        Debug.Log("Spawning Actor " + actor.name);
        evnt.Send();
    }