void Awake(){
			instance = (UI)target;
			
			int enumLength = Enum.GetValues(typeof(UI._BuildMode)).Length;
			buildModeLabel=new string[enumLength];
			buildModeTooltip=new string[enumLength];
			for(int i=0; i<enumLength; i++){
				buildModeLabel[i]=((UI._BuildMode)i).ToString();
				if((UI._BuildMode)i==UI._BuildMode.PointNBuild) 
					buildModeTooltip[i]="A build mode where player first select a build point and then choose which tower to build";
				if((UI._BuildMode)i==UI._BuildMode.DragNDrop) 
					buildModeTooltip[i]="A build mode where all the tower buttons are always on show. Player simply click on the button of the tower and bring the tower to the spot which it needs to be built";
			}
			
			EditorUtility.SetDirty(instance);
		}
Exemple #2
0
 void Awake()
 {
     instance = this;
 }
Exemple #3
0
		public void ToggleFF(){
			if(toggleFastForward.isOn) Time.timeScale=UI.GetFFTime();
			else Time.timeScale=1;
		}
Exemple #4
0
 void Awake()
 {
     instance=this;
 }
Exemple #5
0
        void Awake()
        {
            instance = (UI)target;

            EditorUtility.SetDirty(instance);
        }
        void Update()
        {
            if (UIControl.UseDragNDropMode() || !UIControl.UsePieMenuForBuild())
            {
                return;
            }

            if (buttonLayoutGroup.enabled == UIControl.UsePieMenuForBuild())
            {
                buttonLayoutGroup.enabled = !UIControl.UsePieMenuForBuild();
            }

            if (sInfo == null)
            {
                return;
            }

            Vector3        screenPos = Camera.main.WorldToScreenPoint(sInfo.GetPos()) * UI.GetScaleFactor();
            List <Vector3> posList   = GetPieMenuPos(sInfo.buildableList.Count, screenPos);

            for (int i = 0; i < posList.Count; i++)
            {
                buildButtons[i].rectT.localPosition = posList[i];
            }
        }
Exemple #7
0
 public void OnSellButton()
 {
     currentTower.Sell();
     UI.ClearSelectedTower();
 }