Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Str : MonoBehaviour {
- //The Object we want to modify
- public GameObject Ship;
- //The name of the Script we want to modify, (OSA stands for Other Script Access)
- private ImpactExplosion OSA;
- //How much extra durriblity the ship gets after pickup
- public int StrMult;
- // Use this for initialization
- void Start ()
- {
- OSA = Ship.GetComponent<ImpactExplosion>();
- }
- // OnTriggerEnter is where we dictate what happens to the object when it interacts with a rigidbody
- void OnTriggerEnter(Collider other)
- {
- OSA.Strength = OSA.Strength * StrMult;
- gameObject.SetActive(false);
- }
- // Update is called once per frame
- void Update ()
- {
- transform.Rotate(new Vector3(0, 90, 0) * Time.deltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment