Exemplo n.º 1
0
 public UnturnedZombie(Zombie zombie)
 {
     Zombie           = zombie;
     Asset            = UnturnedZombieAsset.Instance;
     State            = NullEntityState.Instance;
     Transform        = new UnityTransform(zombie.transform);
     EntityInstanceId = zombie.id.ToString();
 }
Exemplo n.º 2
0
 public UnturnedAnimal(Animal animal)
 {
     Animal           = animal;
     Asset            = new UnturnedAnimalAsset(animal.asset);
     State            = NullEntityState.Instance;
     Transform        = new UnityTransform(animal.transform);
     EntityInstanceId = animal.id.ToString();
 }
Exemplo n.º 3
0
 public UnturnedVehicle(InteractableVehicle vehicle)
 {
     Vehicle           = vehicle;
     Asset             = new UnturnedVehicleAsset(vehicle.asset);
     State             = new UnturnedVehicleState(vehicle);
     Transform         = new UnityTransform(vehicle.transform);
     VehicleInstanceId = vehicle.instanceID.ToString();
     Ownership         = new UnturnedVehicleOwnership(vehicle);
 }
Exemplo n.º 4
0
 public UnturnedStructureBuildable(StructureData data, StructureDrop drop)
 {
     StructureData       = data;
     StructureDrop       = drop;
     Asset               = new UnturnedBuildableAsset(data.structure.asset);
     Transform           = new UnityTransform(drop.model);
     State               = new UnturnedBuildableState(data.structure);
     Ownership           = new UnturnedBuildableOwnership(data);
     BuildableInstanceId = drop.instanceID.ToString();
 }
Exemplo n.º 5
0
        public RustEntity(BaseEntity entity)
        {
            Entity           = entity;
            Transform        = new UnityTransform(entity.transform);
            EntityInstanceId = entity.GetInstanceID().ToString();

            // Rust todo: asset and state impl
            State = new RustEntityState(entity);
            Asset = null;
        }
Exemplo n.º 6
0
        public RustBuildingBlock(BuildingBlock buildingBlock)
        {
            BuildingBlock       = buildingBlock;
            Asset               = new RustBaseNetworkableAsset(buildingBlock, RustBaseNetworkableAsset.BuildingBlock);
            Transform           = new UnityTransform(buildingBlock.transform);
            State               = new RustBuildingBlockState(buildingBlock);
            BuildableInstanceId = buildingBlock.GetInstanceID().ToString();

            // Rust todo: set Ownership
        }
Exemplo n.º 7
0
 protected internal UnturnedPlayer(Player player)
 {
     Asset            = UnturnedPlayerAsset.Instance;
     State            = NullEntityState.Instance;
     Inventory        = new UnturnedPlayerInventory(Player);
     Transform        = new UnityTransform(player.transform);
     Player           = player;
     SteamPlayer      = Player.channel.owner;
     SteamId          = SteamPlayer.playerID.steamID;
     EntityInstanceId = SteamId.ToString();
 }
Exemplo n.º 8
0
 public UnturnedBarricadeBuildable(BarricadeData data, BarricadeDrop drop)
 {
     BarricadeData       = data;
     BarricadeDrop       = drop;
     Asset               = new UnturnedBuildableAsset(drop.asset);
     Transform           = new UnityTransform(drop.model);
     State               = new UnturnedBuildableState(data.barricade);
     Ownership           = new UnturnedBuildableOwnership(data);
     BuildableInstanceId = drop.instanceID.ToString();
     Interactable        = drop.interactable;
 }
Exemplo n.º 9
0
        /// <summary>
        /// Return the Quaternion data for the given key (or the defined defaultValue if nothing found).
        /// </summary>
        public UnityTransform GetUnityTransform(string key, UnityTransform defaultValue = new UnityTransform())
        {
            var tr = new UnityTransform();

            try
            {
                if (storage.ContainsKey(key))
                {
                    List <float> dataList = (List <float>)storage[key];
                    tr.position.x         = dataList[0];
                    tr.position.y         = dataList[1];
                    tr.position.z         = dataList[2];
                    tr.localPosition.x    = dataList[3];
                    tr.localPosition.y    = dataList[4];
                    tr.localPosition.z    = dataList[5];
                    tr.localScale.x       = dataList[6];
                    tr.localScale.y       = dataList[7];
                    tr.localScale.z       = dataList[8];
                    tr.lossyScale.x       = dataList[9];
                    tr.lossyScale.y       = dataList[10];
                    tr.lossyScale.z       = dataList[11];
                    tr.rotation.x         = dataList[12];
                    tr.rotation.y         = dataList[13];
                    tr.rotation.z         = dataList[14];
                    tr.rotation.w         = dataList[15];
                    tr.localRotation.x    = dataList[16];
                    tr.localRotation.y    = dataList[17];
                    tr.localRotation.z    = dataList[18];
                    tr.localRotation.w    = dataList[19];
                    tr.eulerAngles.x      = dataList[20];
                    tr.eulerAngles.y      = dataList[21];
                    tr.eulerAngles.z      = dataList[22];
                    tr.localEulerAngles.x = dataList[23];
                    tr.localEulerAngles.y = dataList[24];
                    tr.localEulerAngles.z = dataList[25];
                    return(tr);
                }
            }
            catch (System.Exception)
            {
                Warning("[Easy File Save] GetUnityTransform error using key: " + key);
            }
            return(defaultValue);
        }
Exemplo n.º 10
0
 public UnturnedItemDrop(ItemRegion region, ItemDrop itemDrop)
 {
     Item      = new UnturnedItem(itemDrop.interactableItem.item);
     Transform = new UnityTransform(itemDrop.model);
     Region    = region;
 }
Exemplo n.º 11
0
 public RustNetworkableTransform(BaseNetworkable baseNetworkable)
 {
     m_BaseNetworkable = baseNetworkable;
     m_UnityTransform  = new UnityTransform(baseNetworkable.transform);
 }