Esempio n. 1
0
	void Awake()
	{
        _player = GameObject.Find(Constants.Game.PLAYER_NAME);
        _pickupSpawner = GameObject.Find("Planet").GetComponent<PickupSpawner>();

		enemySpawner = FindObjectOfType<EnemySpawnerScript>();
		scoreManager = FindObjectOfType<HUDScoreScript>();
		hudMessage = GameObject.Find("HUDMessageCenter").GetComponent<HUDMessageScript>();
	}
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        _hud = GameObject.Find("HUDMessage").GetComponent<HUDMessageScript>();
        _player = GameObject.Find("Rotator");
        _planet = GameObject.Find("Planet");
        _shipSpawner = _planet.GetComponent<EnemySpawnerScript>();
        _playerMovementScript = GameObject.FindWithTag("Player").GetComponent<PlayerMovement>();
        _playerInv = GameObject.FindWithTag("Player").GetComponent<InventoryScript>();
        _item = transform.GetChild(0);
        _finalDist = _planet.transform.localScale.x/2f; //raio do planeta

        transform.forward = (_planet.transform.position - transform.position).normalized;
        //transform.rotation = Quaternion.LookRotation((_player.transform.position - transform.position));

        StartCoroutine(RunAnimation());
    }