Пример #1
0
    public void SpawnPassenger(Vector3 spawnPos, string prefabPath)
    {
        Quaternion  identity  = Quaternion.identity;
        HumanNPCNew component = GameManager.server.CreateEntity(prefabPath, spawnPos, identity).GetComponent <HumanNPCNew>();

        component.Spawn();
        AttemptMount(component);
    }
Пример #2
0
    public void SpawnPassenger(Vector3 spawnPos)
    {
        Quaternion  identity  = Quaternion.identity;
        HumanNPCNew component = GameManager.server.CreateEntity(dismountablePrefab.resourcePath, spawnPos, identity).GetComponent <HumanNPCNew>();

        component.Spawn();
        AttemptMount(component);
    }
Пример #3
0
 public virtual void OnDestroy()
 {
     if (!Rust.Application.isQuitting)
     {
         BaseEntity.Query.Server.RemoveBrain(GetEntity());
         AIInformationZone aIInformationZone = null;
         HumanNPCNew       humanNPCNew       = GetEntity() as HumanNPCNew;
         if (humanNPCNew != null)
         {
             aIInformationZone = humanNPCNew.VirtualInfoZone;
         }
         if (aIInformationZone == null)
         {
             aIInformationZone = AIInformationZone.GetForPoint(base.transform.position);
         }
         if (aIInformationZone != null)
         {
             aIInformationZone.UnregisterSleepableEntity(this);
         }
         LeaveGroup();
     }
 }