82 lines
2.3 KiB
C#
82 lines
2.3 KiB
C#
using HighlightPlus;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Device_Mobile : MonoBehaviour
|
|
{
|
|
public int downIndex = 0;
|
|
public int modelID = 5005;
|
|
public List<int> subProcessStepID = new List<int>();
|
|
private HighlightEffect _highlight;
|
|
private void Awake()
|
|
{
|
|
subProcessStepID = GameManager.DataMgr.GetSubProcessStepIDByToolID(modelID);
|
|
_highlight = GetComponent<HighlightEffect>();
|
|
}
|
|
private void Start()
|
|
{
|
|
GameManager.EventMgr.AddEventListener<int>(Enum_EventType.SwitchSubProcessStep, SwitchSubProcess);
|
|
}
|
|
|
|
private void SwitchSubProcess(int arg0)
|
|
{
|
|
if (subProcessStepID.Contains(arg0))
|
|
{
|
|
_highlight.highlighted = true;
|
|
Debug.Log("ÎÒÓ¦¸ÃÌáʾ");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
switch (downIndex)
|
|
{
|
|
case 0:
|
|
if (GameManager.ProcessMgr.CheckSubProcessSteps(GameManager.ProcessMgr.subProcessStepId, modelID))
|
|
{
|
|
_highlight.highlighted = false;
|
|
}
|
|
break;
|
|
//case 1:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4002))
|
|
// downIndex++;
|
|
// break;
|
|
//case 2:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4003))
|
|
// downIndex++;
|
|
// break;
|
|
//case 3:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4004))
|
|
// downIndex++;
|
|
// break;
|
|
//case 4:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4005))
|
|
// downIndex++;
|
|
// break;
|
|
//case 5:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4006))
|
|
// downIndex++;
|
|
// break;
|
|
//case 6:
|
|
// if (GameManager.ProcessMgr.CheckSubProcessSteps(4007))
|
|
// downIndex++;
|
|
// break;
|
|
}
|
|
|
|
}
|
|
|
|
private void OnMouseExit()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
GameManager.EventMgr.RemoveEventListener<int>(Enum_EventType.SwitchSubProcessStep, SwitchSubProcess);
|
|
}
|
|
}
|