Ejemplo n.º 1
0
    GameObject Spawn(Transform parent, ProcessUnit unit)
    {
        float upRadius = 0.8f * 0.1f;

        float lengthUp   = 0.3f;
        float lengthDown = 0.05f;


        float dynamicFactor = 0.5f + ((float)unit.Dynamic / 127.0f) * 1.0f;

        int sides = 16;

        if (unit.Children.Count == 0)
        {
            if (unit.Content == '6' || unit.Content == '7')
            {
                return(wedgeMeshGen.GetWedgeObject(sides, dynamicFactor * 0.1f, 0.0f, lengthUp, 1.0f * 0.1f, lengthDown, 0.01f, 0.2f, bottomSquish, parent, BranchMaterial));
            }
            else
            {
                Material flowerMaterial = materialLookup.Get(unit.Content);
                return(wedgeMeshGen.GetWedgeObject(sides, 0.5f * 0.1f, flowerRadius * dynamicFactor, flowerLength, 0.5f * 0.1f, lengthDown, 0.2f, flowerSquish, 0.2f, parent, flowerMaterial));
            }
        }
        else
        {
            return(wedgeMeshGen.GetWedgeObject(sides, 0.5f * 0.1f * radiusMul * dynamicFactor, upRadius * radiusMul * dynamicFactor, lengthUp, bottomRadius * radiusMul * dynamicFactor, lengthDown, mainSquish, 0.5f, bottomSquish, parent, BranchMaterial));
        }
    }
Ejemplo n.º 2
0
    GameObject Spawn(Transform parent, ProcessUnit unit, int generation)
    {
        if (unit.Content == '0')
        {
            return(null);
        }


        float upRadius = 0.8f * 0.1f;

        float lengthUp   = 0.5f + (0.1f * generation);
        float lengthDown = 0.05f;


        float dynamicFactor = 0.5f + ((float)unit.Dynamic / 127.0f) * 1.0f;

        int sides = 32;

        if (unit.Children.Count == 0)
        {
            Material flowerMaterial = materialLookup.Get(unit.Content);
            return(wedgeMeshGen.GetWedgeObject(sides, 0.5f, flowerRadius * dynamicFactor, flowerLength, 0.5f, lengthDown, flowerSquish, flowerSquish, flowerSquish, parent, flowerMaterial));
        }
        else
        {
            // GetWedgeObject(int sides, float radiusCenter, float radiusUp, float lengthUp, float radiusDown, float lengthDown, float squish, float squishUp, float squishDown, Transform transform, Material material)

            return(wedgeMeshGen.GetWedgeObject(sides, 0.5f * 0.1f * radiusMul * dynamicFactor, upRadius * radiusMul * dynamicFactor, lengthUp, bottomRadius * radiusMul * dynamicFactor, lengthDown, mainSquish, bottomSquish, bottomSquish, parent, BranchMaterial));
        }
    }
    GameObject Spawn(Transform parent, ProcessUnit unit, float lengthUp, float baseRadius, float lastBaseRadius)
    {
        const int sides = 16;

        float radiusCenter = baseRadius * 1.5f;
        float radiusUp     = baseRadius;
        float radiusDown   = baseRadius * 0.25f;
        float lengthDown   = 0.15f * lengthUp;
        float squish       = 0.3f;
        float squishUp     = squish;
        float squishDown   = squish * 2.0f;

        return(wedgeMeshGen.GetWedgeObject(sides, radiusCenter, radiusUp, lengthUp, radiusDown, lengthDown, squish, squishUp, squishDown, parent, BranchMaterial));
    }
Ejemplo n.º 4
0
    public GameObject Spawn(Transform parent, float length, float radius)
    {
        const int sides = 16;

        float radiusCenter = radius;
        float radiusUp     = radius * 0.7f;
        float radiusDown   = radius * 0.5f;

        float lengthDown = length / 64.0f;
        float lengthUp   = length;

        float squish     = 0.5f;
        float squishUp   = 1.0f;
        float squishDown = 1.0f;

        return(wedgeMeshGen.GetWedgeObject(sides, radiusCenter, radiusUp, lengthUp, radiusDown, lengthDown, squish, squishUp, squishDown, parent, BranchMaterial));
    }
Ejemplo n.º 5
0
    GameObject Spawn(Transform parent, ProcessUnit unit, float lengthUp, float baseRadius, float lastBaseRadius)
    {
        const int sides = 16;

        float radiusCenter = lastBaseRadius;
        float radiusUp     = baseRadius;
        float radiusDown   = 0.0f;
        float lengthDown   = 0.05f * lengthUp;
        float squish       = 1.0f;
        float squishUp     = 1.0f;
        float squishDown   = 1.0f;

        if (unit.Children.Count == 0)
        {
            radiusUp = baseRadius * 4.0f;
            lengthUp = lengthUp * 0.5f;
            squishUp = 0.1f;
        }
        return(wedgeMeshGen.GetWedgeObject(sides, radiusCenter, radiusUp, lengthUp, radiusDown, lengthDown, squish, squishUp, squishDown, parent, BranchMaterial));
    }