private void TintNode(IConfigurableAstarNode node, Color color) { ITintable tintComponent = ((Node)node).GetComponent <ITintable>(); if (tintComponent != null) { tintComponent.Tint(color); } }
public BlinkVFX(ITintable tintableObj, float blinkAlpha, double blinkRate, double totalBlinkTime) { TintableObj = tintableObj; BlinkAlpha = blinkAlpha; BlinkRate = blinkRate; TotalBlinkTime = totalBlinkTime; PrevColor = TintableObj.TintColor; }
public override void CleanUp() { //Set the object's color back TintableObj.TintColor = PrevColor; TintableObj = null; PrevColor = Color.White; ElapsedBlinkTime = ElapsedTime = 0d; Blinking = false; }
//we will set the data from the scriptable objects to the node here. public void Configure(NodeData data, Vector2 coordinates) { _coordinates = coordinates; _isWalkable = data.isWalkable; _cost = data.isWalkable ? data.cost : Mathf.Infinity; _type = data.type; ITintable tintComponent = GetComponent <ITintable>(); if (tintComponent != null) { tintComponent.SetTexture(data.albedo); } }