示例#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> ();
	}
示例#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;
    }
示例#3
0
    void Start()
    {
        player = FindObjectOfType <moveScript>();

        if (player.transform.position.x < transform.position.x)
        {
            maxSpeed = -maxSpeed;
        }
    }
示例#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.");
     }
 }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     playerMovement     = player.GetComponent <moveScript>();
     playerPos          = playerMovement.currentPos;
     transform.position = playerPos;
 }
示例#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>();
 }