How can I switch between cinemachine free look cameras by script?

using System.Collections; using System.Collections.Generic; using UnityEngine; using Cinemachine;  public class CamerasManager : MonoBehaviour {     public CinemachineFreeLook[] freeLookCameras;     public float timeBeforeSwitching;      // Start is called before the first frame update     void Start()     {         StartCoroutine(SwitchCameras(timeBeforeSwitching));     }      // Update is called once per frame     void Update()     {              }      IEnumerator SwitchCameras(float TimeBeforeSwitching)     {         yield return new WaitForSeconds(TimeBeforeSwitching);          for(int i = 0; i < freeLookCameras.Length; i++)         {             freeLookCameras[i].en         }     } } 

If I have two or more cameras I want that after X seconds start switching between all the cameras in the array by disabling/enable the cameras. disable the first enable the second then disable the second enable the third and so on.

How to colour blend between two materials?

I’ve been trying to get a material (with an image texture) to animate towards a colour mix with transparency, but either I’m attempting something the wrong way, or unable to find the right keyword to find about similar examples.

What I’m trying to accomplish is to make a 3D character blush; I have the face area on it’s own material, with textures set, but that’s where my problem is. If it was animating between two colours, I would simply use Color.Lerp, but since textures are included, that makes me think I have to somehow have a colour mix option for this.

I’ve also tried to just use the built-in animator to see if Unity would blend between the colours of two different materials, but after all it turned out to be an instant change on the new keyframe; which leaves me to think so far my only exit could be to manually create several keyframes, and create several materials to get it close to acceptable.

Although my knowledge about it is close to zero, is this after all only possible with a custom fragment shader? I don’t know if there’s a suitable package, or built-in Unity feature that makes something like this possible, or if at all I’m approaching this problem the right way…

Update: This is the shader I’m using right now, from 魔王. It might be a little confusing since inputs are all abbreviated, so here are some example files that are being used.

Textures

Difference between WordPress and Webflow

In regards to blogging, what is the difference between WordPress and Webflow? According to Wikipedia, WordPress is a content mangement system (CMS) and Webflow is a "software as a service for website building and hosting". Webflow gets compared to Squarespace, Weebly, Wix, and Webydo — but not WordPress. Is it that Webflow and friends are a higher level abstraction that may include a CMS?

Is there a difference between “damage taken” and “damage dealt”?

This question is prompted by parts of How much damage can the Guardian of Faith spell deal?, If someone casts Vampiric Touch on a creature with necrotic absorption, does the caster take damage?, and this answer.

I am hoping for a more conclusive understanding of whether, within the mechanics of 5e, there is a difference between damage taken by a creature and damage dealt to a creature.

Is there a difference between any of the following aside from phrasing:

  • Gaspar took 8 points of damage from Joan’s attack
  • Gaspar was dealt 8 points of damage by Joan
  • Joan’s attack against Gaspar dealt 8 points of damage

Or rather is there a difference between "A creature hit by your attack takes 1d8 points of damage" and "Your attack deals 1d8 damage to the creature it hits"?

Select box-shape grid between two positions on tilemap

I want to be able to click and hold on a certain point and mark it as startPosition. Then, while the mouse is held down and moved, mark that second position as endPosition.

When the mouse is finally released, I want to get all the positions between those two points.

Here is my code so far:

for (float x = startPosition.x; x <= endPosition.x; x++)         {             for (float y = startPosition.y; y <= endPosition.y; y++)             {                 Vector3Int newPosition = Utilities.GridPosFromWorldPos(new Vector2(x, y));                 if (!selectedPositions.Contains(newPosition)) { selectedPositions.Add(newPosition); }             }         } 

This works only when dragging up and/or to the right. As soon as I try to go to left or bottom, the endPosition coordinates become smaller than the startPosition coordinates, which breaks the for loop.

How can I solve this?

PostgreSQL Function – Finding the difference between 2 times

I want to create a simple function in Postgres to find the difference between 2 TIME – not TIMESTAMP. As show below, it accepts 4 parameters: hour, minute, second and expire (hour). In this example I have commented out seconds, just working on minutes.

CREATE OR REPLACE FUNCTION time_diff(hr INT, min INT, sec INT, exp_hr INT) RETURNS INT LANGUAGE plpgsql AS $  $   DECLARE     cur_time    TIME;     expire_time TIME;      diff_interval INTERVAL;     diff INT = 0; BEGIN     cur_time    = CONCAT(hr,  ':',  min, ':', sec) AS TIME; -- cast hour, minutes and seconds to TIME     expire_time = CONCAT(exp_hr, ':00:00') AS TIME;         -- cast expire hour to TIME      -- MINUS operator for TIME returns interval 'HH:MI:SS;     diff_interval = expire_time - cur_time;      diff = DATE_PART('hour', diff_interval);      diff = diff * 60 + DATE_PART('minute', diff_interval);      --diff = diff * 60 + DATE_PART('second', diff_interval);      RETURN diff; END; $  $  ; 

Example: 01:15:00 – 02:00:00 should give me 45 minutes, so I do the following and I get the correct answer.

select * from time_diff(1, 15, 0, 2); 

However, if I do this: 23:15:00 – 01:00:00 – the should give me 105 minutes (60 + 45).

select * from time_diff(23, 15, 0, 1); 

But the result I am getting is -1335. I am trying to work out where I have gone wrong here.

Also I am invoking DATE_PART functions, this seems to be a quite an expensive process in terms of CPU usage. Is there a better way of optimising this function. With the first example I am getting results in 0.007s on 2018 i7 Mac mini. Although I do think this function is quick, but could it be better?

Thanks

Difference between masterwork tools and skill boost item?

I have a player who wants to buy masterwork tools as opposed to buying magic items that boost his skills.

The reason being, masterwork tools grant a +2 bonus to a skill and cost 50gp.

Magic items that grant bonuses to skills cost (bonus) squared x 100, meaning a +2 magic item costs 400gp.

So i guess my question is…. what is the difference between a masterwork tool and a magic item that grants the same bonus? Are there certain skills you cannot have tools for? Was that the intent?