private void ShootObject(Rigidbody rb, Vector3 velocity)
        {
            rb.isKinematic = false;

            rb.velocity = velocity;

            PropulseCannonAmmoHandler propulseCannonAmmoHandler = rb.gameObject.EnsureComponent <PropulseCannonAmmoHandler>();

            propulseCannonAmmoHandler.ResetHandler(false, false);

            propulseCannonAmmoHandler.OnShot(false);
        }
Exemple #2
0
        public static bool ReleaseGrabbedObject(PropulsionCannon __instance)
        {
            if (__instance.grabbedObject != null)
            {
                PropulseCannonAmmoHandler component = __instance.grabbedObject.GetComponent <PropulseCannonAmmoHandler>();

                if (component != null)
                {
                    component.UndoChanges();
                    UnityEngine.Object.Destroy(component);
                }

                __instance.grabbedObject = null;
            }

            return(false);
        }