feat: more combat tweaks
shuriken can now be thrown jumping animtions jumping animations timing state machine changes start of online integration
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Tasks.Actions;
|
||||
using Reset.Items;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reset.Units{
|
||||
public class PlayerInventory : UnitComponent, IInventory {
|
||||
public class PlayerInventory : UnitComponent, IInventory{
|
||||
public Weapon rangedWeapon;
|
||||
public Weapon meleeWeapon;
|
||||
|
||||
@@ -14,49 +13,7 @@ namespace Reset.Units{
|
||||
public Ability toolAbility1;
|
||||
public Ability toolAbility2;
|
||||
|
||||
public List<Item> storedItems { get; set; }
|
||||
|
||||
private IEquipable currentWeapon;
|
||||
private GameObject currentWeaponItem;
|
||||
|
||||
public void OnDrawWeapon(){
|
||||
// Remove a current weapon
|
||||
if (currentWeapon != null) {
|
||||
Destroy(currentWeaponItem);
|
||||
currentWeaponItem = null;
|
||||
}
|
||||
|
||||
// Add weapon to status and hand
|
||||
currentWeapon = meleeWeapon;
|
||||
currentWeaponItem = meleeWeapon.PlaceInHand();
|
||||
|
||||
// Move item to hand
|
||||
currentWeaponItem.transform.SetParent((Unit.Animation as PlayerAnimation).rightHand);
|
||||
currentWeaponItem.transform.localPosition = meleeWeapon.handPositionOffset;
|
||||
currentWeaponItem.transform.rotation = (Unit.Animation as PlayerAnimation).rightHand.rotation * Quaternion.Euler(meleeWeapon.handRotationOffset);
|
||||
|
||||
Debug.Log(currentWeapon);
|
||||
|
||||
//
|
||||
(currentWeapon as Weapon).AddActorScript();
|
||||
|
||||
//
|
||||
// Unit.Graph.SendEvent("Draw Weapon");
|
||||
}
|
||||
|
||||
public GameObject GetCurrentWeaponItem(){
|
||||
return currentWeaponItem;
|
||||
}
|
||||
|
||||
public void OnHolsterWeapon(){
|
||||
Destroy(currentWeaponItem);
|
||||
currentWeaponItem = null;
|
||||
currentWeapon = null;
|
||||
|
||||
Debug.Log(currentWeapon);
|
||||
//
|
||||
// Unit.Graph.SendEvent("Holster Weapon");
|
||||
}
|
||||
public List<Item> storedItems{ get; set; }
|
||||
|
||||
public void EquipToCharacter(Item item){
|
||||
if (item is not IEquipable) {
|
||||
@@ -73,11 +30,5 @@ namespace Reset.Units{
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user