Пример #1
0
 private void OnDisable()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Пример #2
0
 private void OnEnable()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Пример #3
0
    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;
    }