public void CommandPosition(Vector2 goalPosition, Vector2 goalDir) { if (tankVolume <= 0) { ToolTipManager.ShowText("Need to refill first!"); return; } SetGoalPosition(goalPosition, goalDir); }
public void SpawnObject(bool isPlane) { UnitManager um = FindObjectOfType <UnitManager>(); GameObject objTospawn = null; if (isPlane) { objTospawn = planePrefab; DragManager.drags[1].OnDragEnded += SpawnPlane; um.selectedUnits = new Unit[0]; //ToolTip ToolTipManager.ShowText("Right-Click drag to select Plane path"); return; } else { objTospawn = truckPrefab; truckButton.interactable = false; truckButton.image.fillAmount = 0; } AbortSpawnPlane(null); GameObject spawned = Instantiate(objTospawn, new Vector3(50, 50, 0), Quaternion.identity); Unit spawnedUnit = spawned.GetComponent <Unit>(); spawnedUnit.SetGoalPosition(new Vector2(50, 50), Vector2.up); Unit[] currentSelection = um.selectedUnits; Unit[] newSelection = new Unit[currentSelection.Length + 1]; for (int i = 0; i < currentSelection.Length; i++) { newSelection[i] = currentSelection[i]; } newSelection[newSelection.Length - 1] = spawnedUnit; um.selectedUnits = newSelection; }
public void FastForwardToolTip() { ToolTipManager.ShowText("Press [Space] to fast forward"); }