shuriken can now be thrown jumping animtions jumping animations timing state machine changes start of online integration
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using System;
|
|
using Drawing;
|
|
using NodeCanvas.Framework;
|
|
using Reset.Core;
|
|
using Reset.Units;
|
|
using Sirenix.OdinInspector;
|
|
using Sirenix.Serialization;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace Reset.Items{
|
|
[CreateAssetMenu(menuName = "Reset/Weapon", fileName = "New Weapon")]
|
|
public class Weapon : Item, IEquipable{
|
|
public CombatType combatType;
|
|
|
|
public GameObject weaponModel;
|
|
public NodeCanvas.Framework.Graph weaponFSM;
|
|
|
|
public Vector3 handPositionOffset;
|
|
public Vector3 handRotationOffset;
|
|
|
|
public string actorScriptName;
|
|
|
|
[OdinSerialize, ShowInInspector] public Type actorScript;
|
|
|
|
public void AddActorScript(){
|
|
// Type actorScript = Type.GetType("ShurikenActor");
|
|
//
|
|
// if (actorScript == null) {
|
|
// Debug.LogError($"The WeaponActor supplied was not found for {itemName}. Does script named '{actorScriptName + ",Assembly-UnityScript"}' exist?");
|
|
// return;
|
|
// }
|
|
|
|
try {
|
|
if (actorScript != null) {
|
|
WeaponActor weaponActor = PlayerManager.Player.AddComponent(actorScript) as WeaponActor;
|
|
|
|
weaponActor.relatedObject = PlayerManager.Player.GetComponent<PlayerCombat>().GetCurrentWeaponItem();
|
|
weaponActor.relatedWeapon = this;
|
|
weaponActor.relatedGraph = PlayerManager.Player.GetComponent<GraphOwner>();
|
|
}
|
|
} catch (Exception e) {
|
|
Debug.LogException(e);
|
|
}
|
|
}
|
|
|
|
public override void DrawItemInfo(Vector3 position){
|
|
Draw.ingame.Label2D(position + Vector3.up * 1.6f, "Damage goes here");
|
|
Draw.ingame.Label2D(position + Vector3.up * 1.35f, "Speed goes here");
|
|
}
|
|
|
|
|
|
|
|
public GameObject InstantiateItemObject(){
|
|
return GameObject.Instantiate(weaponModel);
|
|
}
|
|
}
|
|
} |