private void OnDisable() { if (Instance == this) { Instance = null; } }
private void OnEnable() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
public void Use() { if (photonView.isMine == false) { return; } if (Tank.IsAlive == false) { return; } if (Landmines <= 0 && m_rechargeTimer > 0) { return; } int id = LandmineManager.GetNextID(); LandmineManager.Instance.SpawnNew(transform.position, fuse, damage, health, radius, photonView.viewID, id, PhotonNetwork.time); Landmines--; m_rechargeTimer = useCooldown; }