private static void Setup(ToggleTrafficLightsButton button)
        {
            const int spriteWidth  = 31;
            const int spriteHeight = 31;

            button.name    = ButtonName;
            button.tooltip = "Left Click: Junction Tool\nRight Click: Traffic Routes Junctions Info Vie.";
            button.size    = new Vector2(spriteWidth, spriteHeight);
            //add sprites
            button.atlas = CreateAtlas("icons.png", "ToggleTrafficLightsUI",
                                       UIView.Find <UITabstrip>("ToolMode").atlas.material,
                                       spriteWidth, spriteHeight, new[]
            {
                "OptionBase",
                "OptionBaseDisabled",
                "OptionBaseFocused",
                "OptionBaseHovered",
                "OptionBasePressed",
                "Selected",
                "Unselected",
                "OptionBaseFocusedRed",
            });
            button.playAudioEvents = true;
            // set by UpdateOffset
            // button.relativePosition = new Vector3(DefaultButtonPositionX, DefaultButtonPositionY);

            SetDeactivatedStateSprites(button);
        }
Example #2
0
        private void Destroy()
        {
            _junctionSettingsBehaviour.Dispose();
            _junctionSettingsBehaviour = null;

            _junctionSettings.eventVisibilityChanged -= OnJunctionSettingsVisibilityChanged;
            _junctionSettings = null;

            ToggleTrafficLightsButton.DestroyAll();

            _tool.Disabled -= OnToolDisabled;
            ToolHelper.RemoveTool(_tool);
            _tool = null;

            Options = null;

            ForgetPreviousTool();

            DestroyDebug();

            DebugLog.Info("Level destroyed");
        }
Example #3
0
 private void SetupTtlButton()
 {
     ToggleTrafficLightsButton.InitialAdd();
 }