// Update is called once per frame void Update() { if (networkView.isMine) { if (ap <= 0) { Die(); } //regen armour and shields if (sp < 0) { sp = 0; } if (spregen <= 0) { if (sp < setsp) { spregen = mspregen; sp += 1; sc.set(sp); } } else { if (sp != setsp) { spregen -= Time.deltaTime; } } if (apregen <= 0) { if (ap < setap) { apregen = mapregen; ap += 1; hc.set(ap); } } else { if (ap != setap) { apregen -= Time.deltaTime; } } } }
// Update is called once per frame void Update() { if (networkView.isMine) { //Debug.Log("hp " + ap + " sp " + sp); if (ap <= 0) { Die(); } if (spregen <= 0) { if (sp < setsp) { spregen = mspregen; sp += 1; sc.set(sp); } } else { if (sp != setsp) { spregen -= Time.deltaTime; } } if (apregen <= 0) { if (ap < setap) { apregen = mapregen; ap += 1; hc.set(ap); } } else { if (ap != setap) { apregen -= Time.deltaTime; } } } }
// Use this for initialization void Start() { if (networkView.isMine) { ap = setap; sp = setsp; Instantiate(aphud); Instantiate(sphud); ch = Instantiate(crosshair) as GameObject; ch.transform.position = new Vector3(chx, chy, 0); hc = GameObject.Find("HUDHealth(Clone)").GetComponent("HealthCounter") as HealthCounter; sc = GameObject.Find("HUDShield(Clone)").GetComponent("ShieldCounter") as ShieldCounter; hc.set(ap); sc.set(sp); } }