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; }
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; }
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; }
//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? }