コード例 #1
0
    public void RefreshElements(Vector3 target, GameObject panorama, ERainType rain)
    {
        // Update panorama
        foreach (Transform child in layersContainer)
        {
            Destroy(child.gameObject);
        }

        GameObject layer = null;

        for (int i = 0; i < panorama.transform.childCount; i++)
        {
            layer     = Instantiate(panorama.transform.GetChild(i).gameObject, layersContainer);
            layers[i] = layer.GetComponent <TelescopeLayer>();
        }

        rainManager = layer.GetComponent <RainManager>();
        rainManager.UpdateRain(rain);

        ResetPosition();

        // Spwan map elements in sight
        foreach (MapElement element in boat.GetElementsInSight())
        {
            Island island = element.GetComponent <Island>();
            if (!island || island != boat.currentIsland)
            {
                AddElementToPanorama(element, target);
            }
        }

        RefreshElementsAngle();
    }
コード例 #2
0
    public void UpdateRain(ERainType rainType)
    {
        foreach (GameObject rainVFX in heavyRainVFX)
        {
            rainVFX.SetActive(rainType == ERainType.HEAVY);
        }


        foreach (GameObject rainVFX in lightRainVFX)
        {
            rainVFX.SetActive(rainType == ERainType.LIGHT);
        }
    }