public override void StartHolding(ItemActionData _actionData) { ItemActionSpawnCustomVehicle.ItemActionDataSpawnCustomVehicle itemActionDataSpawnMinibike = (ItemActionSpawnCustomVehicle.ItemActionDataSpawnCustomVehicle)_actionData; if (itemActionDataSpawnMinibike.MinibikePreview == null && itemActionDataSpawnMinibike.invData.holdingEntity is EntityPlayerLocal) { GameObject gameObject = (GameObject)ResourceWrapper.Load1P(itemActionDataSpawnMinibike.invData.holdingEntity.inventory.holdingItem.MeshFile); itemActionDataSpawnMinibike.MinibikePreview = UnityEngine.Object.Instantiate <Transform>(gameObject.transform); this.BB(_actionData); } }
protected void SpawnLimbGore(Transform parent, string path, bool restoreState) { if (parent != null) { GameObject original = ResourceWrapper.Load1P(path) as GameObject; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original, Vector3.zero, Quaternion.identity); gameObject.transform.parent = parent; gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; gameObject.transform.localScale = parent.localScale; GorePrefab component = gameObject.GetComponent <GorePrefab>(); if (component != null) { component.restoreState = restoreState; } } }