//Singleton basique : Voir unity design patterns sur google. void Awake() { if (upgradeMenu == null) { upgradeMenu = this; } }
protected override void Awake() { _sr = GetComponent <SpriteRenderer>(); _text = GetComponent <TextRenderer>(); _au = GetComponent <AudioSource>(); _animator = GetComponent <Animator>(); _queuedToLaunch = new List <Planet>(); _upgradeMenu = GetComponent <UpgradeMenu>(); // Add outline visual elements _planetOutline = Instantiate <SpriteRenderer>("HoverOutline", Transform.Position); _planetOutline.Sprite = GameController.OutlineSprite; _planetOutline.Layer = 0.6f; _planetOutline.GameObject.SetActive(false); _rangeOutline = Instantiate <SpriteRenderer>("RangeOutline", Transform.Position); _rangeOutline.Sprite = GameController.RangeSprite; _rangeOutline.Color = new Color(38, 38, 38, 25); _rangeOutline.Layer = 0.61f; UpdateAppearance(); OnPopulationChange += UpdatePopulationText; OnPopulationChange(); }
void Start() { CreateSpawns(); waveCountDown = secondsBetweenWaves; upgradeMenu = GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenu>(); upgradeMenu.CloseMenu(); fade = gameObject.GetComponent <TextFade>(); }
public override void Initilize(UpgradeMenu menu, int id) { base.Initilize(menu, id); // get level lvl = UIMasterScript.passiveList[id]; startlvl = lvl; UpdateGraphic(); }
// Start is called before the first frame update void Start() { dragging = false; buildMenuObj = GameObject.FindGameObjectsWithTag("BuildMenu"); upgradeMenuObj = GameObject.FindGameObjectWithTag("UpgradeMenu"); upgradeMenu = upgradeMenuObj.GetComponent <UpgradeMenu>(); buyMenuObj = GameObject.FindGameObjectWithTag("BuyTileMenu"); ClearSelections(); }
public void TotalPointChanged() { if (UpgradeMenuUI.activeInHierarchy) { UpgradeMenu menu = UpgradeMenuUI.GetComponent <UpgradeMenu>(); if (menu != null) { menu.UpdateTotalPointText(); } } }
public void OnMouseDown() { if (upgradeMenuPrefab != null) { GameObject go = Instantiate <GameObject>(upgradeMenuPrefab); UpgradeMenu upgradeMenu = go.GetComponentInChildren <UpgradeMenu>(); upgradeMenu.Initiate(this); upgradeMenu.transform.position = Camera.main.WorldToScreenPoint(transform.position); } }
public void handle_upgrade(Vector3Int oldCell, Vector3Int newCell) { if ((inverted && newCell.y == 1) || (inverted == false && newCell.y == 8)) { disable_all_piece_colliders(); GameObject upgradeMenuGameObject = Instantiate(upgradeMenuPrefab); upgradeMenu = (UpgradeMenu)upgradeMenuGameObject.GetComponentInChildren(typeof(UpgradeMenu)); upgradeMenu.connectedPawn = this; upgradeMenu.connectButtons(); } }
public UIController(GameSystem gameSystem) : base(gameSystem) { _cashLabel = gameSystem.CashLabel; _buildMenu = gameSystem.BuildMenu; _upgradeMenu = gameSystem.UpgradeMenu; _startButton = gameSystem.StartButton; _startButton.onClick.AddListener(() => { gameSystem.GameController.StartGame(); _startButton.gameObject.SetActive(false); }); }
// Use this for initialization void Start() { Time.timeScale = 1; gameObject.GetComponent <PauseMenu>().enabled = false; upgrades = gameObject.GetComponent <UpgradeMenu>(); upgrades.enabled = false; pauseRect = new Rect(Screen.width / 2 - 30, 24, 0, 0); if (Constants.multiplayer) { networkManager = GameObject.Find("Network Manager").GetComponent("NetworkManager") as NetworkManager; } }
void Start() { GameObject earth = GameObject.FindGameObjectWithTag("Earth"); GameObject player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth>(); playerWeapon = player.GetComponent <PlayerWeapon>(); scoreKeeping = player.GetComponent <ScoreKeeping>(); earthHealth = earth.GetComponent <EarthHealth>(); upgradeMenu = gameObject.GetComponent <UpgradeMenu>(); if (upgradeMenu != null) { RefreshTexts(); ToggleUpgradeButtons(); } }
void Start() { upgradeMenu = GameObject.Find("UpgradeManager").GetComponent <UpgradeMenu>(); enemyList = GameObject.Find("GameManager").GetComponent <EnemyCreation>(); gameSystems = GameObject.Find("GameManager").GetComponent <GameSystems>(); spawnPoint = GameObject.Find("SpawnPoint"); mobInfo = GameObject.Find("MobInfo").GetComponent <MobInfo>(); for (int i = 0; i < Points.Count; i++) { Points[i] = GameObject.Find("Point_" + i); } _currentSpeed = enemyData.speed * upgradeCoinData.difficulty; _health = enemyData.maxHealth * upgradeCoinData.difficulty; gameObject.GetComponent <Image>().sprite = enemyData.mobImage; StartCoroutine(MovingToPoints()); StartCoroutine(Aliments()); }
private void Awake() { Current = this; }
void Start() { Instance = this; }
public virtual void Initilize(UpgradeMenu menu, int id) { UIMasterScript = menu; gradeID = id; Discount = 1f; }
public void HideUpgradeMenu() { _pause.Hide(); _pause = null; }
public void ShowUpgradeMenu() { _pause = new UpgradeMenu(); _pause.Show(); }
// Use this for initialization void Start() { menu = upgradeMenuGUI.GetComponent <UpgradeMenu>(); }
// Start is called before the first frame update void Start() { level = 0; upgradeMenu = GameObject.Find("UpgradeManager").GetComponent <UpgradeMenu>(); }