using System.Collections; using System.Collections.Generic; using UnityEngine; public class ClickMoveMore : Device_Base { public int current; public List dangWeis; private void Update() { int btn = 0; if(Input.GetMouseButtonDown(0)) btn = 1; else if(Input.GetMouseButtonDown(1)) btn = -1; if (btn!=0) { if(Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition),out RaycastHit hitInfo)) { if(hitInfo.transform==transform) { if(btn==1) { //上调加 if(current< dangWeis.Count-1) { if (triggerAction?.Invoke("加+"+triggerName, true) == 0) { current += 1; transform.localPosition = dangWeis[current]; CallScoreAction(current); } } } else if(btn==-1) { //下调减 if(current>0) { if (triggerAction?.Invoke("减+" + triggerName, true) == 0) { current -= 1; transform.localPosition = dangWeis[current]; CallScoreAction(current); } } } } } } } }