using System.Collections; using System.Collections.Generic; using UnityEngine; public class Shoot122Manager : MonoBehaviour { public static Shoot122Manager Instance { get; private set; } public Animation animation_122; public GameObject rawImage_122; public GameObject penguan; public List chooseShoot=new List(); public Dictionary choosedValue=new Dictionary(); public Control3DModelBt 保险; private void Awake() { Instance = this; isShoot = false; } public bool isShoot; // Start is called before the first frame update public void AddOrUpdate(string key, int value) { if (choosedValue.ContainsKey(key)) { // 键已存在,更新值 choosedValue[key] = value; } else { // 键不存在,添加新元素 choosedValue.Add(key, value); } if (GameObject.FindObjectOfType() != null) { FindObjectOfType().SetOneState(int.Parse(key), value); } } public bool RemoveByKey(string key) { if (choosedValue.ContainsKey(key)) { choosedValue.Remove(key); return true; // 删除成功 } return false; // key不存在,删除失败 } public void Jifa() { if (isShoot|| !保险.isInit) return; rawImage_122.SetActive(true); isShoot =true; animation_122.Play(); penguan.SetActive(true); for (int i = 0; i < chooseShoot.Count; i++) { AddOrUpdate(chooseShoot[i].ToString(), 3); } } public void DiaoPaoOver() { if (Manager122Base.instance != null) Manager122Base.instance.Show122DwonMsg("高低到位,方位到位"); } }