Exemple #1
0
        // Token: 0x06003489 RID: 13449 RVA: 0x00159464 File Offset: 0x00157864
        public static Transform getVehicle(ushort id, ushort skin, ushort mythic, VehicleAsset vehicleAsset, SkinAsset skinAsset)
        {
            if (vehicleAsset != null && vehicleAsset.vehicle != null)
            {
                if (id != vehicleAsset.id)
                {
                    Debug.LogError("ID and asset ID are not in sync!");
                }
                Transform transform = UnityEngine.Object.Instantiate <GameObject>(vehicleAsset.vehicle).transform;
                transform.name = id.ToString();
                if (skinAsset != null)
                {
                    InteractableVehicle interactableVehicle = transform.gameObject.AddComponent <InteractableVehicle>();
                    interactableVehicle.id            = id;
                    interactableVehicle.skinID        = skin;
                    interactableVehicle.mythicID      = mythic;
                    interactableVehicle.fuel          = 10000;
                    interactableVehicle.isExploded    = false;
                    interactableVehicle.health        = 10000;
                    interactableVehicle.batteryCharge = 10000;
                    interactableVehicle.safeInit();
                    interactableVehicle.updateFires();
                    interactableVehicle.updateSkin();
                }
                return(transform);
            }
            Transform transform2 = new GameObject().transform;

            transform2.name             = id.ToString();
            transform2.tag              = "Vehicle";
            transform2.gameObject.layer = LayerMasks.VEHICLE;
            return(transform2);
        }