Beispiel #1
0
    public void FlashScreen(FlashColor color, float time)
    {
        switch (color)
        {
        case FlashColor.RED:
            currentColor = red;
            break;

        case FlashColor.GREEN:
            currentColor = green;
            break;

        case FlashColor.BLUE:
            currentColor = blue;
            break;

        case FlashColor.WHITE:
            currentColor = white;
            break;
        }

        flashTime   = time;
        currentTime = 0f;

        step = 1f / time;

        image.color   = new Color(currentColor.r, currentColor.g, currentColor.b, 1f);
        image.enabled = true;
        flashStarted  = true;
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        if (flashColor == null)
        {
            flashColor = GetComponent <FlashColor> ();
        }
        flashColorExists = flashColor != null;

        if (flashScale == null)
        {
            flashScale = GetComponent <FlashScale> ();
        }
        flashScaleExists = flashScale != null;

        if (myParticleSystem == null)
        {
            myParticleSystem = GetComponent <ParticleSystem> ();
        }
        particleSystemExists = myParticleSystem != null;

        if (hitpoints == null)
        {
            hitpoints = GetComponent <HitPoints> ();
        }
        hitPointsExists = hitpoints != null;
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     fireballShooter = GetComponent <FireballShooter> ();
     flashColor      = GetComponent <FlashColor> ();
     deathShaker     = GetComponent <DeathShake> ();
     animator        = GetComponent <Animator> ();
 }
 // Use this for initialization
 void Start()
 {
     rb          = GetComponent <Rigidbody2D> ();
     colInfo     = GetComponent <RaycastCollisionChecks> ();
     flashColor  = GetComponent <FlashColor> ();
     deathShaker = GetComponent <DeathShake> ();
     SetupMoveAndJumpSpeed();
 }
 void Start()
 {
     startTime  = Time.time;
     flashColor = GetComponent <FlashColor> ();
     if (flashColor == null)
     {
         throw new MissingComponentException("Missing FlashColor Component");
     }
     if (position1 == null)
     {
         throw new MissingReferenceException("Missing Position 1");
     }
     if (position2 == null)
     {
         throw new MissingReferenceException("Missing Position 2");
     }
 }
Beispiel #6
0
        private object SetFlashColor(object param)
        {
            FlashColor color = (FlashColor)param;

            if (color == null)
            {
                color = new FlashColor();
            }
            if (m_Owner != null)
            {
                EntityView ev = m_Owner.GetView();
                if (ev != null)
                {
                    ev.SetFlashColor(color.color, color.fLift);
                }
            }
            return(null);
        }
        void ShowFlashColor(IEntity defender)
        {
            Profiler.BeginSample("ShowFlashColor");
            INPC npc = defender as INPC;

            if (npc != null)
            {
                int         baseID = npc.GetProp((int)EntityProp.BaseID);
                NpcDataBase npcDb  = GameTableManager.Instance.GetTableItem <NpcDataBase>((uint)baseID);
                if (npcDb != null)
                {
                    uint monsterType = npcDb.dwMonsterType;
                    if (monsterType == 0)
                    {
                        return;
                    }
                    List <uint> configList = SkillSystem.GetColorList(monsterType);
                    if (configList != null)
                    {
                        if (configList.Count > 0)
                        {
                            uint show = configList[0];
                            if (show == 1)
                            {
                                if (configList.Count != 6)
                                {
                                    // Log.Error("全局配置FlashColor  长度错误 ,检查配置");
                                }
                                else
                                {
                                    FlashColor fc = new FlashColor();
                                    fc.color = new Color(configList[2] * 1.0f / 255, configList[3] * 1.0f / 255, configList[4] * 1.0f / 255, configList[5] * 1.0f / 255);
                                    fc.fLift = configList[1] * 1.0f / 1000;
                                    defender.SendMessage(EntityMessage.EntityCommand_FlashColor, fc);
                                    // Log.Error("flash color " + defender.GetName());
                                }
                            }
                        }
                    }
                }
            }
            Profiler.EndSample();
        }
Beispiel #8
0
        protected override void OnUpdate(float progress)
        {
            if (progress < 3.0f / FrameDuration)
            {
                Element.Opacity = MathUtility.Lerp(
                    _startOpacity,
                    _endOpacity,
                    progress / 3 * FrameDuration);

                Element.OverlayColor = FlashColor;
            }
            else if (progress < 8.0f / FrameDuration)
            {
                Element.Opacity = _endOpacity;

                var overlayColor = FlashColor.WithA(
                    MathUtility.Lerp(
                        _endOpacity,
                        _startOpacity,
                        (progress - 3.0f / FrameDuration) / 8 * FrameDuration));

                Element.OverlayColor = overlayColor;
            }
            else if (progress < 10.0f / FrameDuration)
            {
                // Nothing
                Element.Opacity                 = _endOpacity;
                Element.OverlayColor            = null;
                Element.BackgroundColorOverride = null;
            }
            else
            {
                Element.Opacity      = _endOpacity;
                Element.OverlayColor = null;
                Element.TextOpacity  = MathUtility.Lerp(
                    _startOpacity,
                    _endOpacity,
                    (progress - 10.0f / FrameDuration) * (FrameDuration / 2.0f));
            }
        }