45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using System;
|
|
using Drawing;
|
|
using NodeCanvas.StateMachines;
|
|
using Reset.Core;
|
|
using Reset.Units;
|
|
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;
|
|
|
|
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;
|
|
// }
|
|
|
|
WeaponActor weaponActor = PlayerManager.Player.AddComponent<ShurikenActor>() as WeaponActor;
|
|
|
|
weaponActor.relatedObject = PlayerManager.Player.GetComponent<PlayerInventory>().GetCurrentWeaponItem();
|
|
weaponActor.relatedWeapon = this;
|
|
}
|
|
|
|
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 PlaceInHand(){
|
|
return GameObject.Instantiate(weaponModel);
|
|
|
|
}
|
|
}
|
|
} |