Пример #1
0
    private void TintNode(IConfigurableAstarNode node, Color color)
    {
        ITintable tintComponent = ((Node)node).GetComponent <ITintable>();

        if (tintComponent != null)
        {
            tintComponent.Tint(color);
        }
    }
Пример #2
0
        public BlinkVFX(ITintable tintableObj, float blinkAlpha, double blinkRate, double totalBlinkTime)
        {
            TintableObj = tintableObj;

            BlinkAlpha     = blinkAlpha;
            BlinkRate      = blinkRate;
            TotalBlinkTime = totalBlinkTime;

            PrevColor = TintableObj.TintColor;
        }
Пример #3
0
        public override void CleanUp()
        {
            //Set the object's color back
            TintableObj.TintColor = PrevColor;

            TintableObj = null;

            PrevColor = Color.White;

            ElapsedBlinkTime = ElapsedTime = 0d;

            Blinking = false;
        }
Пример #4
0
    //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);
        }
    }