Advertisement
Guest User

saveManager

a guest
Mar 26th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.UI;
  4.  
  5. public class saveManager : MonoBehaviour
  6. {
  7.     public GameObject health;
  8.     public GameObject player;
  9.     public GameObject playerhealth;
  10.     public Text healtex;
  11.     playerhealth test;
  12.     void Awake()
  13.     {
  14.         playerhealth = GameObject.Find("Health");
  15.         health = GameObject.FindWithTag("Health");
  16.         player = GameObject.FindWithTag("Player");              
  17.         DontDestroyOnLoad(health);
  18.         DontDestroyOnLoad(player);
  19.         loader();      
  20.     }
  21.     void loader()
  22.     {
  23.  
  24.       test = playerhealth.GetComponent<playerhealth>();
  25.       test.healtbar = GameObject.Find("hpp");
  26.       test.texthealth = GameObject.Find("hpptext");
  27.       healtex = test.texthealth.GetComponent<Text>(); ;
  28.  
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement