コード例 #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;
    }