102 lines
2.0 KiB
C#
102 lines
2.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ToolBase : MonoBehaviour
|
|
{
|
|
public FlowsBase 流程脚本;
|
|
public string 物品名称;
|
|
public 物品分类 物品分类;
|
|
public 物品状态 物品状态;
|
|
//public bool 是否高亮;
|
|
/// <summary>
|
|
/// 悬浮时距屏幕的距离
|
|
/// </summary>
|
|
public float tooldis;
|
|
|
|
// public bool 鼠标放上去是否高亮;
|
|
public bool 交互完成;
|
|
private bool 赋分完成;
|
|
|
|
#region
|
|
|
|
private Vector3 orignPos, orignRot;
|
|
public Vector3 inHandPos, inHandRot;
|
|
// public bool isNotInfinet = false;
|
|
#endregion
|
|
// Start is called before the first frame update
|
|
protected virtual void Start()
|
|
{
|
|
|
|
orignPos = transform.position;
|
|
orignRot = transform.eulerAngles;
|
|
}
|
|
protected virtual void Update()
|
|
{
|
|
if (交互完成 == true&&赋分完成==false)
|
|
{
|
|
|
|
|
|
流程脚本.交互完成计数 += 1;
|
|
赋分完成 = true;
|
|
}
|
|
|
|
}
|
|
protected virtual void OnMouseEnter()
|
|
{
|
|
|
|
}
|
|
protected virtual void OnMouseExit()
|
|
{
|
|
|
|
}
|
|
protected virtual void OnMouseDown()
|
|
{
|
|
|
|
}
|
|
public virtual void 工具携带()
|
|
{
|
|
|
|
if (物品分类 == 物品分类.工具 && 物品状态 == 物品状态.携带中)
|
|
{
|
|
|
|
|
|
gameObject.SetActive(false);
|
|
foreach (GameObject obj in UnityEngine.Object.FindObjectsOfType(typeof(GameObject)))//遍历场景中的所有物体
|
|
{
|
|
if (obj.GetComponent<GameManager_Tools>() != null)
|
|
{
|
|
obj.GetComponent<GameManager_Tools>().tool_Objects_Base.Add(obj.GetComponent<Tool_objects_base>());
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
/// <summary>
|
|
/// 当拿到手中
|
|
/// </summary>
|
|
public virtual void OnBeginUse()
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// 当结束使用
|
|
/// </summary>
|
|
public virtual void OnFinishUse()
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// 自定义预留接口
|
|
/// </summary>
|
|
public virtual void next()
|
|
{
|
|
|
|
}
|
|
}
|