Beispiel #1
0
	//public GameObject thisEnemy;

	//private weaponScript[] weapons;
	
	void Awake()
	{
		// Retrieve the weapon only once
		//weapons = GetComponentsInChildren<weaponScript>();
		// Retrieve scripts to disable when not spawn
		MoveScript = GetComponent<moveScript>();
		rabbitMoveScript = GetComponent<rabbitMove> ();
	}
Beispiel #2
0
    // Start is called before the first frame update


    void Start()
    {
        playerMovement     = player.GetComponent <moveScript>();
        expectedPos        = new Vector3(player.transform.position.x, player.transform.position.y, -10);
        transform.position = expectedPos;
        rb2d      = GetComponent <Rigidbody2D>();
        playerPos = playerMovement.currentPos;
    }
Beispiel #3
0
    void Start()
    {
        player = FindObjectOfType <moveScript>();

        if (player.transform.position.x < transform.position.x)
        {
            maxSpeed = -maxSpeed;
        }
    }
Beispiel #4
0
 void Start()
 {
     correctLayer = gameObject.layer;
     spriteRend   = GetComponent <SpriteRenderer>();
     move         = GetComponent <moveScript>();
     if (spriteRend == null)
     {
         Debug.LogError("Object '" + gameObject.name + "' has no sprite renderer.");
     }
 }
Beispiel #5
0
 // Start is called before the first frame update
 void Start()
 {
     playerMovement     = player.GetComponent <moveScript>();
     playerPos          = playerMovement.currentPos;
     transform.position = playerPos;
 }
Beispiel #6
0
 // Start is called before the first frame update
 void Start()
 {
     playerMovement     = player.GetComponent <moveScript>();
     transform.position = new Vector3(player.transform.position.x, player.transform.position.y, -10);
     rb2d = GetComponent <Rigidbody2D>();
 }