Ejemplo n.º 1
0
    public void UpdateColorDistanceAutonomy()
    {
        float gr = drakeRef.GetGrowthRatio();
        float cd = (1f - gr) * COLOR_DISTANCE_MIN + gr * COLOR_DISTANCE_MAX;

        if (pb == null)
        {
            pb = GetComponent <PainterBehavior>();
        }
        pb.distanceAutonomy = cd;
    }
Ejemplo n.º 2
0
    void Start()
    {
        pb = GetComponent <PainterBehavior>();
        pb.affectedByClouds = false;

        // Scale variations
        float   r     = Random.Range(0.6f, 1.4f);
        Vector3 scale = transform.localScale;

        scale.x *= r;
        scale.y *= r;
        transform.localScale = scale;
    }
Ejemplo n.º 3
0
    public void Reset(Vector3 newPos, Vector3 newVel, sbyte channel)
    {
        //Debug.Log("Activate PaintSpit (channel=" + channel + ")");
        if (pb == null)
        {
            pb = GetComponent <PainterBehavior>();
        }

        pb.FinishStrip();

        vel = newVel;
        pos = newPos;
        transform.position = pos;

        // Note : recharge after setting position because otherwise the
        // distance autonomy may be dramatically affected on next frame
        // (See pb.ColorLevel implementation).
        pb.SetColor(channel, true);
        pb.ColorLevel = 1;
    }
Ejemplo n.º 4
0
    //private float nextBleedTime;

    // Use this for initialization
    void Start()
    {
        gameObject.AddComponent <SphereCollider>();
        // For collision to be detected, one of the objects must have a rigidbody
        Rigidbody rigidBody = gameObject.AddComponent <Rigidbody>();

        rigidBody.isKinematic = true;         // But I make it kinematic so it won't simulate physics on itself

        if (isXRotative)
        {
            xRotationDegVar = Random.Range(-90, 90);
        }

        pb = GetComponent <PainterBehavior>();
        //pb.materialRef = materialRef; // Dont link it anymore, because it breaks batching

        pb.SetBrush(brushSize.Lerp(parametricPosition));

        UpdateColorDistanceAutonomy();

        // Halos?
    }