LegitTeddyBears

Str

May 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Str : MonoBehaviour {
  6.     //The Object we want to modify
  7.     public GameObject Ship;
  8.     //The name of the Script we want to modify, (OSA stands for Other Script Access)
  9.     private ImpactExplosion OSA;
  10.     //How much extra durriblity the ship gets after pickup
  11.     public int StrMult;
  12.  
  13.  
  14.     // Use this for initialization
  15.     void Start ()
  16.     {
  17.         OSA = Ship.GetComponent<ImpactExplosion>();
  18.     }
  19.  
  20.     // OnTriggerEnter is where we dictate what happens to the object when it interacts with a rigidbody
  21.     void OnTriggerEnter(Collider other)
  22.     {
  23.         OSA.Strength = OSA.Strength * StrMult;
  24.         gameObject.SetActive(false);
  25.     }
  26.  
  27.     // Update is called once per frame
  28.     void Update ()
  29.     {
  30.         transform.Rotate(new Vector3(0, 90, 0) * Time.deltaTime);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment