E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive objects/ToolBase.cs

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()
{
}
}