示例#1
0
    public virtual void Local_SecondaryFire(ViewModel vm, ItemRepresentation itemRep, IMeleeWeaponItem itemInstance, ref HumanController.InputSample sample)
    {
        RaycastHit raycastHit;
        Character  character = itemInstance.character;

        if (character == null)
        {
            return;
        }
        if (Physics.SphereCast(character.eyesRay, 0.3f, out raycastHit, this.GetRange(), 406721553))
        {
            IDBase component = raycastHit.collider.gameObject.GetComponent <IDBase>();
            if (component)
            {
                NetEntityID netEntityID = NetEntityID.Get(component);
                if (component.GetLocal <RepairReceiver>() != null && netEntityID != NetEntityID.unassigned)
                {
                    if (vm)
                    {
                        vm.PlayFireAnimation();
                    }
                    itemInstance.QueueSwingSound(Time.time + this.swingSoundDelay);
                    itemRep.Action <NetEntityID>(2, uLink.RPCMode.Server, netEntityID);
                }
            }
        }
    }
示例#2
0
 public virtual void Local_FireWeapon(ViewModel vm, ItemRepresentation itemRep, IMeleeWeaponItem itemInstance, ref HumanController.InputSample sample)
 {
     this.StartSwingWorldAnimations(itemRep);
     if (vm != null)
     {
         vm.PlayFireAnimation();
     }
     itemInstance.QueueSwingSound(Time.time + this.swingSoundDelay);
     itemInstance.QueueMidSwing(Time.time + this.midSwingDelay);
     if (itemRep.networkViewIsMine)
     {
         itemRep.Action(3, RPCMode.Server);
     }
 }
示例#3
0
    public virtual void Local_SecondaryFire(ViewModel vm, ItemRepresentation itemRep, IMeleeWeaponItem itemInstance, ref HumanController.InputSample sample)
    {
        RaycastHit hit;
        Character  character = itemInstance.character;

        if ((character != null) && Physics.SphereCast(character.eyesRay, 0.3f, out hit, this.GetRange(), 0x183e1411))
        {
            IDBase component = hit.collider.gameObject.GetComponent <IDBase>();
            if (component != null)
            {
                NetEntityID argument = NetEntityID.Get((MonoBehaviour)component);
                if ((component.GetLocal <RepairReceiver>() != null) && (argument != NetEntityID.unassigned))
                {
                    if (vm != null)
                    {
                        vm.PlayFireAnimation();
                    }
                    itemInstance.QueueSwingSound(Time.time + this.swingSoundDelay);
                    itemRep.Action <NetEntityID>(2, RPCMode.Server, argument);
                }
            }
        }
    }