Beispiel #1
0
        public override float Run()
        {
            if (runtimeFollowTintMap == null)
            {
                if (isPlayer)
                {
                    LogWarning("Could not find a FollowTintMap component on the Player - be sure to place one on the sprite child.");
                }

                return(0f);
            }

            if (!isRunning)
            {
                isRunning = true;

                if (tintMapMethod == TintMapMethod.ChangeIntensity)
                {
                    if (isInstant || timeToChange <= 0f)
                    {
                        runtimeFollowTintMap.SetIntensity(newIntensity);
                    }
                    else
                    {
                        runtimeFollowTintMap.SetIntensity(newIntensity, timeToChange);

                        if (willWait)
                        {
                            return(timeToChange);
                        }
                    }
                }
                else if (tintMapMethod == TintMapMethod.ChangeTintMap)
                {
                    if (followDefault)
                    {
                        runtimeFollowTintMap.useDefaultTintMap = true;
                        runtimeFollowTintMap.ResetTintMap();
                    }
                    else
                    {
                        if (runtimeNewTintMap)
                        {
                            runtimeFollowTintMap.useDefaultTintMap = false;
                            runtimeFollowTintMap.tintMap           = runtimeNewTintMap;
                            runtimeFollowTintMap.ResetTintMap();
                        }
                        else
                        {
                            LogWarning("Could not change " + runtimeFollowTintMap.gameObject.name + " - no alternative provided!");
                        }
                    }
                }
            }
            else
            {
                isRunning = false;
            }
            return(0f);
        }
Beispiel #2
0
        override public float Run()
        {
            if (followTintMap == null)
            {
                return(0f);
            }

            if (!isRunning)
            {
                isRunning = true;

                if (tintMapMethod == TintMapMethod.ChangeIntensity)
                {
                    if (isInstant || timeToChange <= 0f)
                    {
                        followTintMap.SetIntensity(newIntensity);
                    }
                    else
                    {
                        followTintMap.SetIntensity(newIntensity, timeToChange);

                        if (willWait)
                        {
                            return(timeToChange);
                        }
                    }
                }
                else if (tintMapMethod == TintMapMethod.ChangeTintMap)
                {
                    if (followDefault)
                    {
                        followTintMap.useDefaultTintMap = true;
                        followTintMap.ResetTintMap();
                    }
                    else
                    {
                        if (newTintMap)
                        {
                            followTintMap.useDefaultTintMap = false;
                            followTintMap.tintMap           = newTintMap;
                            followTintMap.ResetTintMap();
                        }
                        else
                        {
                            ACDebug.LogWarning("Could not change " + followTintMap.gameObject.name + " - no alternative provided!");
                        }
                    }
                }
            }
            else
            {
                isRunning = false;
            }
            return(0f);
        }