Exemplo n.º 1
0
        public void CollectFloatDigitInSingleFrame(PoolObjHandle <ActorRoot> attacker, PoolObjHandle <ActorRoot> target, DIGIT_TYPE digitType, int value)
        {
            if (MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
            {
                return;
            }
            if (this.m_floatDigitInfoList == null)
            {
                this.m_floatDigitInfoList = new List <FloatDigitInfo>();
            }
            FloatDigitInfo floatDigitInfo;

            for (int i = 0; i < this.m_floatDigitInfoList.get_Count(); i++)
            {
                floatDigitInfo = this.m_floatDigitInfoList.get_Item(i);
                if (floatDigitInfo.m_attacker == attacker && floatDigitInfo.m_target == target && (floatDigitInfo.m_digitType == digitType || this.CanMergeToCritText(ref floatDigitInfo.m_digitType, digitType)))
                {
                    floatDigitInfo.m_value += value;
                    this.m_floatDigitInfoList.set_Item(i, floatDigitInfo);
                    return;
                }
            }
            floatDigitInfo = new FloatDigitInfo(attacker, target, digitType, value);
            this.m_floatDigitInfoList.Add(floatDigitInfo);
        }
Exemplo n.º 2
0
        private void updateFloatDigitInLastFrame()
        {
            if (MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
            {
                return;
            }
            if (this.m_floatDigitInfoList == null || this.m_floatDigitInfoList.get_Count() == 0)
            {
                return;
            }
            for (int i = 0; i < this.m_floatDigitInfoList.get_Count(); i++)
            {
                FloatDigitInfo floatDigitInfo = this.m_floatDigitInfoList.get_Item(i);
                if (floatDigitInfo.m_attacker && floatDigitInfo.m_target)
                {
                    if (floatDigitInfo.m_digitType == DIGIT_TYPE.ReviveHp)
                    {
                        Vector3 position = floatDigitInfo.m_target.handle.myTransform.position;
                        this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref position);
                    }
                    else
                    {
                        Vector3       position2      = floatDigitInfo.m_target.handle.myTransform.position;
                        Vector3       position3      = floatDigitInfo.m_attacker.handle.myTransform.position;
                        SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                        Vector3 a;
                        Vector3 b;
                        float   num;
                        float   num2;
                        if (curLvelContext != null && curLvelContext.m_isCameraFlip)
                        {
                            a    = position2;
                            b    = position3;
                            num  = Random.Range(0.5f, 1f);
                            num2 = Random.Range(-1f, -0.5f);
                        }
                        else
                        {
                            a    = position3;
                            b    = position2;
                            num  = Random.Range(-1f, -0.5f);
                            num2 = Random.Range(0.5f, 1f);
                        }
                        if ((a - b).x > 0f)
                        {
                            Vector3 vector = new Vector3(position2.x + num, position2.y + Math.Abs(num), position2.z);
                            this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref vector, 1);
                        }
                        else
                        {
                            Vector3 vector2 = new Vector3(position2.x + num2, position2.y + Math.Abs(num2), position2.z);
                            this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref vector2, 0);
                        }
                    }
                }
            }
            this.m_floatDigitInfoList.Clear();
        }
Exemplo n.º 3
0
        private void updateFloatDigitInLastFrame()
        {
            if (!MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover&& ((this.m_floatDigitInfoList != null) && (this.m_floatDigitInfoList.Count != 0)))
            {
                for (int i = 0; i < this.m_floatDigitInfoList.Count; i++)
                {
                    FloatDigitInfo info = this.m_floatDigitInfoList[i];
                    if ((info.m_attacker != 0) && (info.m_target != 0))
                    {
                        Vector3 position;
                        if (info.m_digitType == DIGIT_TYPE.ReviveHp)
                        {
                            position = info.m_target.handle.gameObject.transform.position;
                            this.CreateBattleFloatDigit(info.m_value, info.m_digitType, ref position);
                        }
                        else
                        {
                            Vector3       vector2;
                            Vector3       vector3;
                            float         num2;
                            float         num3;
                            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                            if ((curLvelContext != null) && curLvelContext.m_isCameraFlip)
                            {
                                vector2 = info.m_target.handle.gameObject.transform.position;
                                vector3 = info.m_attacker.handle.gameObject.transform.position;
                                num2    = UnityEngine.Random.Range((float)0.5f, (float)1f);
                                num3    = UnityEngine.Random.Range((float)-1f, (float)-0.5f);
                            }
                            else
                            {
                                vector2 = info.m_attacker.handle.gameObject.transform.position;
                                vector3 = info.m_target.handle.gameObject.transform.position;
                                num2    = UnityEngine.Random.Range((float)-1f, (float)-0.5f);
                                num3    = UnityEngine.Random.Range((float)0.5f, (float)1f);
                            }
                            Vector3 vector4 = vector2 - vector3;
                            if (vector4.x > 0f)
                            {
                                position = new Vector3(info.m_target.handle.gameObject.transform.position.x + num2, info.m_target.handle.gameObject.transform.position.y + Math.Abs(num2), info.m_target.handle.gameObject.transform.position.z);
                                this.CreateBattleFloatDigit(info.m_value, info.m_digitType, ref position, 1);
                            }
                            else
                            {
                                position = new Vector3(info.m_target.handle.gameObject.transform.position.x + num3, info.m_target.handle.gameObject.transform.position.y + Math.Abs(num3), info.m_target.handle.gameObject.transform.position.z);
                                this.CreateBattleFloatDigit(info.m_value, info.m_digitType, ref position, 0);
                            }
                        }
                    }
                }
                this.m_floatDigitInfoList.Clear();
            }
        }
Exemplo n.º 4
0
 public void CollectFloatDigitInSingleFrame(PoolObjHandle <ActorRoot> attacker, PoolObjHandle <ActorRoot> target, DIGIT_TYPE digitType, int value)
 {
     if (!MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
     {
         FloatDigitInfo info;
         if (this.m_floatDigitInfoList == null)
         {
             this.m_floatDigitInfoList = new List <FloatDigitInfo>();
         }
         for (int i = 0; i < this.m_floatDigitInfoList.Count; i++)
         {
             info = this.m_floatDigitInfoList[i];
             if (((info.m_attacker == attacker) && (info.m_target == target)) && ((info.m_digitType == digitType) || this.CanMergeToCritText(ref info.m_digitType, digitType)))
             {
                 info.m_value += value;
                 this.m_floatDigitInfoList[i] = info;
                 return;
             }
         }
         info = new FloatDigitInfo(attacker, target, digitType, value);
         this.m_floatDigitInfoList.Add(info);
     }
 }