Example #1
0
 void EnableMenu(GameObject[] Golist)
 {
     foreach (GameObject GO in Golist)
     {
         GO.SetActive(true);
     }
 }
Example #2
0
 public void EnableCollectables()
 {
     foreach (GameObject GO in collectibles)
     {
         GO.SetActive(true);
     }
 }
Example #3
0
 void DisableMenu(GameObject[] Golist)
 {
     foreach (GameObject GO in Golist)
     {
         GO.SetActive(false);
     }
 }
 /// <summary>
 /// Hides anything in the showWhenInteractionIsPossible array
 /// </summary>
 protected virtual void HideInteractionInstruction()
 {
     foreach (GameObject GO in showWhenInteractionIsPossible)
     {
         GO.SetActive(false);
     }
 }
Example #5
0
    void PentacleEnded()
    {
        foreach (GameObject GO in objectsToActivate)
        {
            GO.SetActive(true);
        }
        if (pentacleFail)
        {
            dialogues.shouldWrite = true;
            dialogues.sequence    = 4;
            pentacle.material     = completePentacle;
        }
        else
        {
            dialogues.shouldWrite = true;
            dialogues.sequence    = 3;
            pentacle.material     = completePentacle;
        }
        dessinage.dessinage = false;

        if (pentacleFail)
        {
            Destroy(gameObject);
            GoodDessin = false;
        }
        else
        {
            GoodDessin = true;
        }
        particles.Play();
        pentacleDone = false;
    }
Example #6
0
 private void DesactivarGameObjects()
 {
     foreach (var GO in listaGameObjects)
     {
         GO.SetActive(false);
     }
 }
Example #7
0
 public void Unhide()
 {
     foreach (GameObject GO in BodyPartsToHide)
     {
         GO.SetActive(true);
     }
 }
Example #8
0
 public void UIDisable()
 {
     foreach (GameObject GO in UI)
     {
         GO.SetActive(false);
     }
 }
Example #9
0
    void UpdateImageAnchor(ARImageAnchor arImageAnchor)
    {
        //Debug.LogFormat("image anchor updated[{0}] : tracked => {1}", arImageAnchor.identifier, arImageAnchor.isTracked);
        if (bindObjectToImage && MuseumLocationService.imageAnchors.TryGetValue(arImageAnchor.referenceImageName, out GameObject GO))
        {
            GO = MuseumLocationService.imageAnchors[arImageAnchor.referenceImageName];
            if (arImageAnchor.isTracked)
            {
                if (!GO.activeSelf)
                {
                    GO.SetActive(true);
                }

                if (bindObjectToImage)
                {
                    GO.transform.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
                    GO.transform.rotation = UnityARMatrixOps.GetRotation(arImageAnchor.transform);
                }
            }
            else if (GO)
            {
                GO.SetActive(false);
            }
        }
    }
Example #10
0
    private void SpawnVFX(Vector3 hitInfoPoint)
    {
        if (clickVFX == null)
        {
            return;
        }

        GameObject GO;

        if (_clickVFXPool.Count > 0)
        {
            int lastElement = _clickVFXPool.Count - 1;
            GO = _clickVFXPool[lastElement];
            _clickVFXPool.RemoveAt(lastElement);
            GO.SetActive(true);
            GO.transform.position = hitInfoPoint;
        }
        else
        {
            GO = Instantiate(clickVFX, hitInfoPoint, Quaternion.identity, gameObject.transform);
        }


        StartCoroutine(DisableAfter(GO, clickVFXDuration));
    }
Example #11
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.layer == LayerMask.NameToLayer("Obstacle"))
        {
            if (other.CompareTag("Planet"))
            {
                SoundManager.PlaySound(SoundManager.Sound.Explosion);
            }
            GetComponent <PlayerController>().enabled = false;

            foreach (GameObject GO in disableOnDeath)
            {
                GO.SetActive(false);
            }

            GameObject deathEffectGO = Instantiate(deathExplosion, this.transform);

            if (SystemInfo.deviceType == DeviceType.Handheld)
            {
                Handheld.Vibrate();
            }
            OnDied?.Invoke();
        }
        ;
    }
Example #12
0
 void restartLevel()
 {
     foreach (GameObject GO in Resources.FindObjectsOfTypeAll(typeof(GameObject)))
     {
         if (GO.tag == "floor")
         {
             GO.SetActive(GO.GetComponent <floorTileScript>().activeAtStart);
         }
     }
     foreach (GameObject button in GameObject.FindGameObjectsWithTag("button"))
     {
         foreach (GameObject feature in button.GetComponent <buttonScript>().connectedFeatures)
         {
             if (feature.gameObject.tag == "floor")
             {
                 feature.SetActive(feature.GetComponent <floorTileScript> ().activeAtStart);
             }
             else
             {
                 feature.SetActive(feature.GetComponent <pressurePlate> ().activeAtStart);
             }
         }
     }
     transform.position = spawnPoint.transform.position;
 }
Example #13
0
    public void OnMouseDown()
    {
        if (!isShow)
        {
            anim.SetBool("IsAppear", true);
            isShow = true;

            foreach (GameObject GO in UI)
            {
                GO.SetActive(true);
            }
        }

        else
        {
            anim.SetBool("IsAppear", false);
            isShow = false;

            Invoke("UIDisable", 1.0f);

            /*foreach (GameObject GO in UI)
             * {
             *  GO.SetActive(false);
             * }*/
        }
    }
Example #14
0
 private void EnableGameElements(bool state)
 {
     foreach (GameObject GO in disabledInMenus)
     {
         GO.SetActive(state);
     }
 }
Example #15
0
    void Start()
    {
        GOs = GameObject.FindGameObjectsWithTag("CP");
        //number_of_players = 0;
        switch (gameObject.name)
        {
        case "NoPSlider":
            slider.value = GameSetting.NumberOfPlayers;
            NoPText.text = slider.value.ToString();
            foreach (GameObject GO in GOs)
            {
                GO.SetActive((int)GO.name[2] - 48 <= GameSetting.NumberOfPlayers ? true : false);
            }
            break;

        case "GLSlider":
            slider.value = GameSetting.GameLength / 10;
            GLText.text  = GameSetting.GameLength.ToString();
            break;

        case "DRSlider":
            slider.value = GameSetting.DropRate / 5;
            DRText.text  = GameSetting.DropRate.ToString() + "‰";
            break;

        case "RoundSlider":
            slider.value = (GameSetting.NumberOfRounds - 1) / 2;
            DRText.text  = GameSetting.NumberOfRounds.ToString();
            break;

        default:
            Debug.Log("Something bad will happen");
            break;
        }
    }
Example #16
0
    //highQuality = true and lowQuality = false
    public void setQuality(bool setHighQuality)
    {
        if (!setHighQuality)
        {
            data.highQuality = false;
        }
        else
        {
            data.highQuality = true;
        }

        for (int i = 0; i < highQualityItems.Count; i++)
        {
            if (highQualityItems [i] == null)
            {
                highQualityItems.RemoveAt(i);
                Debug.Log("Removed at index " + i + ". Length: " + highQualityItems.Count);
                i--;
            }
        }

        foreach (GameObject GO in highQualityItems)
        {
            GO.SetActive(data.highQuality);
        }
    }
Example #17
0
 public void UpdateUIRoleInfo()
 {
     foreach (GameObject GO in roomUIRoleInfo)
     {
         GO.SetActive(false);
     }
     roomUIRoleInfo[InRoom_Menu.SP.localPlayer.roleType + (InRoom_Menu.SP.localPlayer.team - 1) * 3].SetActive(true);
 }
Example #18
0
 /// <summary>
 /// Disables resource. This is only meaningful for mutable resources.
 /// This method must be idempotent.
 /// </summary>
 public virtual void Disable()
 {
     if (GO == null)
     {
         return;
     }
     GO.SetActive(false);
 }
Example #19
0
 /// <summary>
 /// Enables resource. This is only meaningful for mutable resources.
 /// This method must be idempotent.
 /// </summary>
 public virtual void Enable()
 {
     if (GO == null)
     {
         return;
     }
     GO.SetActive(true);
 }
Example #20
0
 private void CheckId(int IdAgent)
 {
     foreach (GameObject GO in ListText)
     {
         GO.SetActive(false);
     }
     ListText[IdAgent].SetActive(true);
 }
Example #21
0
 public void EnableProgressBar()
 {
     _filledProgressBarImage.gameObject.SetActive(true);
     foreach (var GO in _GOs)
     {
         GO.SetActive(true);
     }
 }
Example #22
0
 public override void SetActive(bool b)
 {
     if (GO.activeSelf == b)
     {
         return;
     }
     GO.SetActive(b);
 }
Example #23
0
 public void ToDefault()
 {
     foreach (GameObject GO in letters)
     {
         GO.SetActive(false);
     }
     full.SetActive(false);
 }
Example #24
0
 void BackToMenu(GameObject button)
 {
     foreach (GameObject GO in lobbyUIRightPage)
     {
         GO.SetActive(false);
     }
     show = false;
     Name_Menu.SP.RequirePlayerName = true;
 }
Example #25
0
 public virtual void SetActive(bool b = true)
 {
     IsShow = b;
     if (GO.activeSelf == b)
     {
         return;
     }
     GO.SetActive(b);
 }
Example #26
0
 private void levelFinished()
 {
     TfruitCollected.text = "" + score;
     TmaxFruit.text       = "" + maxScore;
     foreach (GameObject GO in GOendscreen)
     {
         GO.SetActive(true);
     }
 }
Example #27
0
    // Use this for initialization
    void Start()
    {
        isShow = false;
        anim   = GetComponent <Animator>();

        foreach (GameObject GO in UI)
        {
            GO.SetActive(false);
        }
    }
Example #28
0
    public void DisableProgressBar()
    {
        Reset();

        _filledProgressBarImage.gameObject.SetActive(false);
        foreach (var GO in _GOs)
        {
            GO.SetActive(false);
        }
    }
Example #29
0
 // Start is called before the first frame update
 void Start()
 {
     foreach (GameObject GO in objectsToEnable)
     {
         GO.SetActive(true);
     }
     foreach (GameObject GO in objectsToDisable)
     {
         GO.SetActive(false);
     }
 }
 /// <summary>
 /// Show anything in the showWhenInteractionIsPossible array
 /// </summary>
 protected virtual void ShowInteractionInstruction()
 {
     if (happenOnlyOnce && alreadyHappened)
     {
         return;
     }
     foreach (GameObject GO in showWhenInteractionIsPossible)
     {
         GO.SetActive(true);
     }
 }