Пример #1
0
 // Use this for initialization
 void Start()
 {
     handEquip = HandEquipStates.none;
     OnDisable();
     LSObjectsMask = 1<<9;
     TerrainMask = 1<<8;
     DefaultMask = 1;
     WaterMask = 1<<4;
     PlayerMask = 1<<11;
     InteractibleMask = 1<<12;
     enabled = false;
     cursorParticles = lookCursor.GetComponent<ParticleSystem>();
     cursorRenderer = lookCursor.GetComponent<MeshRenderer>();
     SetArmLayerWeight(0f, 0f);
     charController = GetComponent<CharacterController>();
 }
Пример #2
0
 public void EquipItem(EquippableItem itemToEquip, InvBaseItem.Slot slotPlaced)
 {
     Debug.Log("Adding Item...");
     playerLightScript = itemToEquip.GetComponentInChildren<Light>();
     if (playerLightScript)
     {
         Debug.Log("Item was a light.");
         playerLightTransform = itemToEquip.transform;
         relativeLightPosition = playerLightTransform.localPosition;
         lightRotationOffset = playerLightTransform.localRotation;
         playerLightScript = playerLightTransform.GetComponentInChildren<Light>();
         itemCollider = itemToEquip.interactionZone;
     }
     switch(handEquip)
     {
     case HandEquipStates.left:
         if(slotPlaced == InvBaseItem.Slot.RightHand)
             handEquip = HandEquipStates.both;
         break;
     case HandEquipStates.right:
         if(slotPlaced == InvBaseItem.Slot.LeftHand)
             handEquip = HandEquipStates.both;
         break;
     case HandEquipStates.none:
         if(slotPlaced == InvBaseItem.Slot.LeftHand)
             handEquip = HandEquipStates.left;
         if(slotPlaced == InvBaseItem.Slot.RightHand)
             handEquip = HandEquipStates.right;
         break;
     }
     SetArmLayerWeight(0f, 0f);
 }
Пример #3
0
 public void UnEquipItem(InvBaseItem.Slot slotRemoved)
 {
     switch(slotRemoved)
     {
     case InvBaseItem.Slot.LeftHand:
         if(handEquip == HandEquipStates.both)
             handEquip = HandEquipStates.right;
         if(handEquip == HandEquipStates.left)
             handEquip = HandEquipStates.none;
         break;
     case InvBaseItem.Slot.RightHand:
         if(handEquip == HandEquipStates.both)
             handEquip = HandEquipStates.left;
         if(handEquip == HandEquipStates.right)
             handEquip = HandEquipStates.none;
         break;
     }
     SetArmLayerWeight(0f, 0f);
 }