public void instantiateInteractions(PetStatus petStatus) { BirdSpawner instantiatedSpawner = Instantiate( birdSpawner.gameObject, transform).GetComponent <BirdSpawner>(); instantiatedSpawner.Initialize(petStatus, conditionName, valueIncreaseAmount, needinessIncreaseAmount, this); }
void Start() { if (GetComponent <PlayerController>().isActiveAndEnabled) { this.enabled = false; } spawner = GetComponent <BirdSpawner> (); SetLaunchInterval(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); } else { _instance = this; } }
public override void begin() { if (_context.currentlyResetting) { _context.currentlyResetting = false; _context.ResetGround(); _context.groundPlayer = Object.Instantiate(_context.groundPlayerPrefab, new Vector2(-3.5f, 0f), Quaternion.identity); _context.groundPlayer.SetTargetPosOriginitionX(-3.5f); _context.groundScenery.active = true; } _context.music.time = GameMaster.instance.phase6Start; birdSpawner = Object.Instantiate(_context.birdSpawnerPrefab); }
void Awake() { if (instance == null) { instance = this; } Vector3 temp = transform.position; for (int i = 0; i < birds.Length; i++) { birds[i] = Instantiate(bird, temp, Quaternion.identity); birds[i].SetActive(false); } }
// Use this for initialization void Start() { camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PlatformGenerator>(); end = GameObject.FindGameObjectWithTag("Despawn").GetComponent <Despawner>(); Spawn = GameObject.FindGameObjectWithTag("BirdSpawner").GetComponent <BirdSpawner>(); //transform.position = new Vector3(transform.position.x - Random.Range(0, 4), transform.position.y, 0); location = Random.Range(0.0f, 7.0f); mid = false; updatedPosition = new Vector2(transform.position.x - 2, Random.Range(0.0f, -2.6f)); Ispawn = true; start = false; track = true; indicatorSound = true; diveSound = true; }
void Awake() { self = this; if (messageUIs == null) { messageUIs = new MessageUI[Player.PLAYER_COUNT]; } BirdSpawner spawner = this.gameObject.GetComponent <BirdSpawner>(); messageUIs[spawner.playerIndex] = this; Image img = this.gameObject.GetComponent <Image>(); img.color = Colors.midColors[spawner.playerIndex]; wasdDir.GetComponent <Image> ().color = Colors.lightColors[spawner.playerIndex]; wasdAction.GetComponent <Image> ().color = Colors.lightColors[spawner.playerIndex]; }
// Start is called before the first frame update void Start() { BirdSpawner = GetComponent <BirdSpawner>(); Stats.BestLevel = PlayerPrefs.GetInt("BestLevel", 1); Camera = Camera.main; UpdateGameUI(); //Init Powers.Heart = 20; Powers.Bomb = 0; Powers.FastReload = 0; Powers.Shells = 4; Powers.SlowMotion = 0; StartCoroutine(StartMenu()); LevelUpText.gameObject.SetActive(false); }
public void StartGame() { _gameState = GameState.Game; Destroy(_leftCopyOfPlantCharacter.gameObject); _leftCopyOfPlantCharacter = null; Destroy(_rightCopyOfPlantCharacter.gameObject); _rightCopyOfPlantCharacter = null; _birdSpawner = Instantiate(_birdSpawnerPrefab, _worldTilter.transform); _birdSpawner.transform.localPosition = new Vector3(0, 1.2f, 0); _birdSpawner.Target = _plantCharacter.transform; _rainCloud = Instantiate(_cloudPrefab, _worldTilter.transform); _rainCloud.transform.localPosition = new Vector3(0, 4.5f, 0); _rainCloud.gameObject.SetActive(false); // plant should start as a small sapling _plantCharacter.AnimateGrowthTo(0); _setupCoroutine = StartCoroutine(GameSetupCoroutine()); }
void Awake() { birdSpawner = this; }
private void Awake() { instance = this; }
void Start() { spawner = GetComponent <BirdSpawner> (); }