コード例 #1
0
        public void Update()
        {
            if (!_initialized)
            {
                var go = GameObject.Find("(Library) ChirpXPanel");
                if (go == null)
                {
                    return;
                }
                var infoPanel = go.GetComponent <ChirpXPanel>();
                if (infoPanel == null)
                {
                    return;
                }
                _chirpXPanel          = infoPanel;
                _rocketDropDown       = UiUtil.CreateDropDown(_chirpXPanel.component);
                _rocketDropDown.width = 250;

                PrefabLister.ListRockets().ForEach(r =>
                {
                    _rocketDropDown.AddItem(r.name);
                });
                _rocketDropDown.eventSelectedIndexChanged += IndexChangeHandler;
                _rocketLabel = UiUtil.CreateLabel("Rocket", _chirpXPanel.component, new Vector3());
                _initialized = true;
            }
            if (!_chirpXPanel.component.isVisible)
            {
                return;
            }
            SetUpRocketDropDown();
        }
コード例 #2
0
        private static void PatchCountdownEffects()
        {
            var defaultRocketAi = PrefabLister.DefaultRocket?.m_vehicleAI as RocketAI;

            if (defaultRocketAi == null)
            {
                return;
            }
            PrefabLister.ListRockets()
            .ForEach(r =>
            {
                var ai = r.m_vehicleAI as RocketAI;
                if (ai == null)
                {
                    return;
                }
                ai.m_countdownEffect1 = defaultRocketAi.m_countdownEffect1;
                ai.m_countdownEffect2 = defaultRocketAi.m_countdownEffect2;
            });
        }