Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Effects : MonoBehaviour
- {
- void OnCollisionEnter(Collision other)
- {
- //For at dette script virker, skal du tilføje tags til dine powerups
- if(other.gameObject.tag == "Increase")
- {
- transform.localScale = transform.localScale * 2;
- Destroy(other.gameObject);
- }
- if (other.gameObject.tag == "Decrease")
- {
- transform.localScale = transform.localScale / 2;
- Destroy(other.gameObject);
- }
- if (other.gameObject.tag == "SuperSpeed")
- {
- GetComponent<SuperBallController>().accelleration = GetComponent<SuperBallController>().accelleration * 2;
- GetComponent<SuperBallController>().maxMoveSpeed = GetComponent<SuperBallController>().maxMoveSpeed * 2;
- Destroy(other.gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement