Esempio n. 1
0
 void Start()
 {
     rcontrol = GetComponent <RocketControl>();
     rhealth  = GetComponent <RocketHealth>();
     rb       = GetComponent <Rigidbody2D>();
     if (!GetComponent <PhotonView>().isMine)
     {
         gameObject.tag    = "Ship";
         MinimapMark.color = Color.red;
     }
     else
     {
         MinimapMark.color = Color.green;
     }
 }
Esempio n. 2
0
	// Update is called once per frame
	void Update () 
	{
		if(rh == null)
		{
			GameObject ship = GameObject.FindGameObjectWithTag("myShip");
			if(ship != null)
				rh = ship.GetComponent<RocketHealth>();
		}
		else
		{
			healthBar.fillAmount = (float)rh.currentHealth/rh.MaxHealth;
			shieldBar.fillAmount = (float)rh.curShield/rh.MaxShield;
		}

	}
Esempio n. 3
0
	void Start()
	{
		rcontrol = GetComponent<RocketControl>();
		rhealth = GetComponent<RocketHealth>();
		rb = GetComponent<Rigidbody2D>();
		if(!GetComponent<PhotonView>().isMine)
		{
			gameObject.tag = "Ship";
			MinimapMark.color = Color.red;
		}
		else
		{
			MinimapMark.color = Color.green;
		}
	}
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (rh == null)
     {
         GameObject ship = GameObject.FindGameObjectWithTag("myShip");
         if (ship != null)
         {
             rh = ship.GetComponent <RocketHealth>();
         }
     }
     else
     {
         healthBar.fillAmount = (float)rh.currentHealth / rh.MaxHealth;
         shieldBar.fillAmount = (float)rh.curShield / rh.MaxShield;
     }
 }