Example #1
0
        public void Initialize()
        {
            if (nodeType == null)
            {
                gameObject.SetActive(false);
                return;
            }
            else if (nodeType != null)//pour l'initialisation suite à l'instance du niveau
            {
                if (LevelManager.Instance != null)
                {
                    if (nodeType.myName == "Traffic Lights")
                    {
                        count = LevelManager.Instance.levelSelected.numberOfTrafficLights;
                    }
                    else if (nodeType.myName == "Traffic Circle")
                    {
                        count = LevelManager.Instance.levelSelected.numberOfTrafficCircles;
                    }
                    else if (nodeType.myName == "Right Priority Road")
                    {
                        count = LevelManager.Instance.levelSelected.numberOfTrafficPriority;
                    }
                }
            }

            if (count == -1)
            {
                countTxt.transform.parent.gameObject.SetActive(false);
            }

            selectBtn.onClick.AddListener(Select);
            nodeSelection = gameObject.GetComponentInParent <GridNodeSelection>();
            nodeSelection.AddOnOpenSelection(OnOpen);
        }
        public void Initialize()
        {
            Instance = this;

            GameplayManager.Instance.GetManager <InputManager>().AddOnTouchClick(TouchDown);
            GameplayManager.Instance.GetManager <TimeManager>().AddOnWeekPass(OnTimePass);
            buttonSelection = typeSelectionTransform.GetComponentsInChildren <SelectType>();

            InitButtonType();
            GetComponentInChildren <PanelIntersection>(true).Initialize();
        }