Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Effects : MonoBehaviour
  6. {
  7. void OnCollisionEnter(Collision other)
  8. {
  9.  
  10. //For at dette script virker, skal du tilføje tags til dine powerups
  11.  
  12. if(other.gameObject.tag == "Increase")
  13. {
  14. transform.localScale = transform.localScale * 2;
  15. Destroy(other.gameObject);
  16. }
  17.  
  18. if (other.gameObject.tag == "Decrease")
  19. {
  20. transform.localScale = transform.localScale / 2;
  21. Destroy(other.gameObject);
  22. }
  23.  
  24. if (other.gameObject.tag == "SuperSpeed")
  25. {
  26. GetComponent<SuperBallController>().accelleration = GetComponent<SuperBallController>().accelleration * 2;
  27. GetComponent<SuperBallController>().maxMoveSpeed = GetComponent<SuperBallController>().maxMoveSpeed * 2;
  28. Destroy(other.gameObject);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement