コード例 #1
0
    public void CollectData()
    {
        //increase starting i if adding to existing system?
        int rockyAdded = 0;
        int gasyAdded  = 0;
        int count      = 0;

        for (int i = 0; i < CelestialObject.Objects.Count; i++)
        {
            CelestialObject co = CelestialObject.Objects[i];
            if (!co.staticBody)
            {
                physicsData[count] = new _celestialObject(co, count);
                IcoPlanet ip = co.GetComponentInChildren <IcoPlanet>();
                if (ip != null)
                {
                    planetList[rockyAdded] = new _planet(ip, count);
                    rockyAdded            += 1;
                }
                GasPlanetShaderMAterialPropertyBlock gp = co.GetComponentInChildren <GasPlanetShaderMAterialPropertyBlock>();
                if (gp != null)
                {
                    gasPlanetList[gasyAdded] = new _gasPlanet(gp, count);
                    gasyAdded += 1;
                }
                count += 1;
            }
        }
    }
コード例 #2
0
    public void SetMaterial(_gasPlanet data)
    {
        BandColorStorm = data.BandColorStorm;
        StormSize      = data.StormSize;
        StormSpeed     = data.StormSpeed;
        StormStrength  = data.StormStrength;
        StormPlacement = data.StormPlacement;
        BandScale1     = data.BandScale1;
        BandXSeed1     = data.BandXSeed1;
        BandYSeed1     = data.BandYSeed1;
        BandColor1     = data.BandColor1;
        BandScale2     = data.BandScale2;
        BandXSeed2     = data.BandXSeed2;
        BandYSeed2     = data.BandYSeed2;
        BandColor2     = data.BandColor2;
        BandColor3     = data.BandColor3;

        this.gameObject.transform.localScale = new Vector3(data.planetScale, data.planetScale, data.planetScale);
        MaterialUpdate = true;
    }