Пример #1
0
    IEnumerator onAniCamEffect(float effDelay, AniDataCamEffect ace, string aniDataId)
    {
        yield return(new WaitForSeconds(effDelay));

        if (_isEnabled)
        {
            if (_state == aniDataId)
            {
                switch (ace.type)
                {
                case AniDataCamEffect.Type.Quake:
                    GameManager.me.effectManager.quakeEffect(ace.optionValue, ace.optionValue2, EarthQuakeEffect.Type.Mad);
                    break;
                }
            }
        }
    }
Пример #2
0
    public void setData(string[] f)
    {
        string[] d = new string[17];

        for (int i = 0; i < d.Length; ++i)
        {
            d[i] = string.Empty;
        }

        for (int i = 0; i < f.Length && i < d.Length; ++i)
        {
            d[i] = f[i];
        }



        id   = d[3];
        ani  = d[4];
        link = d[5];
        link = link.Trim();

        if (string.IsNullOrEmpty(d[6]))
        {
            link = null;
        }

        if (ani.Contains("atk") || ani.Contains("sk_"))
        {
            delay       = Util.stringToFloatArray((d[7]), ',');
            delayLength = delay.Length;

            for (int i = 0; i < delayLength; ++i)
            {
                delay[i] = delay[i] / 30.0f;
            }
        }

        //		UnityEngine.Debug.Log(id);

        string temp = d[8];

        if (temp.Length > 1)
        {
            string[] e = temp.Split('/');
            effectNum = e.Length;
            effect    = new AniDataEffect[effectNum];

            for (int i = 0; i < effectNum; ++i)
            {
                effect[i] = new AniDataEffect();

                string[] tte = e[i].Split('@');

                if (tte.Length == 2)
                {
                    effect[i].parent = tte[1];
                }

                string[] te = tte[0].Split(',');

                effect[i].id    = te[0];
                effect[i].delay = ((float)Convert.ToInt32(te[1])) / 30.0f;

                effect[i].attachedToCharacter = false;

                switch (te[2])
                {
                case "S":
                    effect[i].shotPoint = AniDataEffect.PointType.ShotPoint;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }

                    break;

                case "C":
                    effect[i].shotPoint = AniDataEffect.PointType.CustomPoint;
                    effect[i].x         = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].y         = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].z         = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;

                case "CB":
                    effect[i].shotPoint = AniDataEffect.PointType.CustomBullet;
                    effect[i].x         = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].y         = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].z         = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }


                    break;

                case "T":
                    effect[i].shotPoint = AniDataEffect.PointType.Target;
                    effect[i].x         = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].y         = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].z         = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;

                case "AS":
                    effect[i].shotPoint = AniDataEffect.PointType.AttachedShotPoint;
                    effect[i].x         = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].y         = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].z         = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;


                case "AT":
                    effect[i].shotPoint = AniDataEffect.PointType.AttachedTransform;
                    effect[i].x         = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].y         = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    effect[i].z         = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;



                default:
                    effect[i].shotPoint = AniDataEffect.PointType.Character;
                    break;
                }

                if (effect[i].timeLimit <= 0.01f)
                {
                    effect[i].timeLimit = 10000;
                }
            }
        }
        else
        {
            effectNum = 0;
        }


        temp = d[10];
        if (temp.Length > 1)
        {
            string[] c = temp.Split('/');
            camEffectNum = c.Length;
            camEffect    = new AniDataCamEffect[camEffectNum];

            for (int i = 0; i < camEffectNum; ++i)
            {
                camEffect[i] = new AniDataCamEffect();
                string[] ce = c[i].Split(',');

                switch (ce[0])
                {
                case "E":
                    camEffect[i].type = AniDataCamEffect.Type.Quake;
                    break;
                }

                camEffect[i].delay        = ((float)Convert.ToInt32(ce[1])) / 30.0f;
                camEffect[i].optionValue  = 0.0f;               //(float)Convert.ToDouble(ce[2]);
                camEffect[i].optionValue2 = 0.0f;               //(float)Convert.(ce[3]);

                float.TryParse(ce[2], out camEffect[i].optionValue);
                float.TryParse(ce[3], out camEffect[i].optionValue2);
            }
        }
        else
        {
            camEffectNum = 0;
        }



        string tempS = d[11];

        if (string.IsNullOrEmpty(tempS) == false)
        {
            string[] ts = tempS.Split('/');

            soundNum = ts.Length;

            sound = new AniDataSound[soundNum];

            for (int i = 0; i < soundNum; ++i)
            {
                sound[i] = new AniDataSound();

                string[] tts = ts[i].Split(',');

                sound[i].id = tts[0];

                float.TryParse(tts[1], out sound[i].delay);

                sound[i].delay /= 30.0f;
            }
        }
        else
        {
            soundNum = 0;
        }



        temp = d[13];
        temp = temp.Trim();

        //		UnityEngine.Debug.Log(id);

        if (string.IsNullOrEmpty(temp) == false)
        {
            string[] tmp = temp.Split('/');
            shootingPointLength = tmp.Length;
            shootingPositions   = new int[tmp.Length][];

            for (int i = 0; i < shootingPointLength; ++i)
            {
                shootingPositions[i] = Util.stringToIntArray(tmp[i], ',');

//				shootingPositions[i][0] = (int)((float)shootingPositions[i][0] * ((float)GameManager.info.modelData[id].scale)/100.0f);
//				shootingPositions[i][1] = (int)((float)shootingPositions[i][1] * ((float)GameManager.info.modelData[id].scale)/100.0f);
//				shootingPositions[i][2] = (int)((float)shootingPositions[i][2] * ((float)GameManager.info.modelData[id].scale)/100.0f);

                shootingPositions[i][0] = Mathf.FloorToInt((float)shootingPositions[i][0] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
                shootingPositions[i][1] = Mathf.FloorToInt((float)shootingPositions[i][1] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
                shootingPositions[i][2] = Mathf.FloorToInt((float)shootingPositions[i][2] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
            }

            //shootingPoint = temp.Split(',');
            //shootingPointLength = shootingPoint.Length;
        }


        temp = d[14];
        temp = temp.Trim();

        if (string.IsNullOrEmpty(temp) == false)
        {
            shootingPoint      = temp.Split(',');
            shootingHandLength = shootingPoint.Length;
        }

        Util.parseObject(d[15], out hitRange, true, 0.0f);

//		UnityEngine.Debug.Log(id);
        hitRange *= ((((float)GameManager.info.modelData[id].scale) / 100.0f));


//		Util.parseObject(d[16],out aniLength, true, -1000);
    }
Пример #3
0
    public void setData(List <object> l, Dictionary <string, int> k)
    {
        id   = (string)l[k["ID"]];
        ani  = (string)l[k["ANI"]];
        link = (string)l[k["LINK"]];
        link = link.Trim();

//		UnityEngine.Debug.Log(id);

        if (string.IsNullOrEmpty(link))
        {
            link = null;
        }

        if (ani.Contains("atk") || ani.Contains("sk_"))
        {
            delay       = Util.stringToFloatArray((l[k["FRAME"]].ToString()), ',');
            delayLength = delay.Length;

            for (int i = 0; i < delayLength; ++i)
            {
                delay[i] = delay[i] / 30.0f;
            }
        }

//		UnityEngine.Debug.Log(id);

        string temp = (string)l[k["EFFECT"]];

        if (temp.Length > 1)
        {
            string[] e = temp.Split('/');
            effectNum = e.Length;
            effect    = new AniDataEffect[effectNum];

            for (int i = 0; i < effectNum; ++i)
            {
                effect[i] = new AniDataEffect();

                string[] tte = e[i].Split('@');

                if (tte.Length == 2)
                {
                    effect[i].parent = tte[1];
                    Debug.Log("parent: " + tte[1]);
                }

                string[] te = tte[0].Split(',');

                effect[i].id = te[0];


                effect[i].delay = ((float)Convert.ToInt32(te[1])) / 30.0f;

                effect[i].attachedToCharacter = false;

                switch (te[2])
                {
                case "S":
                    effect[i].shotPoint = AniDataEffect.PointType.ShotPoint;

                    if (te.Length == 4)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }

                    break;

                case "C":
                    effect[i].shotPoint = AniDataEffect.PointType.CustomPoint;

                    if (te.Length > 5)
                    {
                        effect[i].x = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].y = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].z = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    }
                    else
                    {
                        effect[i].x = 0; effect[i].y = 0; effect[i].z = 0;
                    }

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;

                case "CB":

                    effect[i].shotPoint = AniDataEffect.PointType.CustomBullet;

                    if (te.Length > 5)
                    {
                        effect[i].x = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].y = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].z = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    }
                    else
                    {
                        effect[i].x = 0; effect[i].y = 0; effect[i].z = 0;
                    }

                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }

                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }


                    break;

                case "T":
                    effect[i].shotPoint = AniDataEffect.PointType.Target;

                    if (te.Length > 5)
                    {
                        effect[i].x = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].y = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].z = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    }
                    else
                    {
                        effect[i].x = 0; effect[i].y = 0; effect[i].z = 0;
                    }


                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;

                case "AS":
                    effect[i].shotPoint = AniDataEffect.PointType.AttachedShotPoint;

                    if (te.Length > 5)
                    {
                        effect[i].x = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].y = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].z = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    }
                    else
                    {
                        effect[i].x = 0; effect[i].y = 0; effect[i].z = 0;
                    }


                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;


                case "AT":
                    effect[i].shotPoint = AniDataEffect.PointType.AttachedTransform;

                    if (te.Length > 5)
                    {
                        effect[i].x = ((float)Convert.ToInt32(te[3])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].y = ((float)Convert.ToInt32(te[4])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                        effect[i].z = ((float)Convert.ToInt32(te[5])) * ((float)GameManager.info.modelData[id].scale) / 100.0f;
                    }
                    else
                    {
                        effect[i].x = 0; effect[i].y = 0; effect[i].z = 0;
                    }


                    if (te.Length >= 7)
                    {
                        effect[i].timeLimit = ((float)Convert.ToDouble(te[6]));
                    }
                    if (te.Length >= 10)
                    {
                        effect[i].useCustomRotation = true;
                        effect[i].rx = ((float)Convert.ToInt32(te[7]));
                        effect[i].ry = ((float)Convert.ToInt32(te[8]));
                        effect[i].rz = ((float)Convert.ToInt32(te[9]));
                    }

                    break;



                default:
                    effect[i].shotPoint = AniDataEffect.PointType.Character;
                    break;
                }

                if (effect[i].timeLimit <= 0.01f)
                {
                    effect[i].timeLimit = 10000;
                }
            }
        }
        else
        {
            effectNum = 0;
        }



        temp = (string)l[k["CAM"]];
        if (temp.Length > 1)
        {
            string[] c = temp.Split('/');
            camEffectNum = c.Length;
            camEffect    = new AniDataCamEffect[camEffectNum];

            for (int i = 0; i < camEffectNum; ++i)
            {
                camEffect[i] = new AniDataCamEffect();
                string[] ce = c[i].Split(',');

                switch (ce[0])
                {
                case "E":
                    camEffect[i].type = AniDataCamEffect.Type.Quake;
                    break;
                }

                camEffect[i].delay        = ((float)Convert.ToInt32(ce[1])) / 30.0f;
                camEffect[i].optionValue  = 0.0f;               //(float)Convert.ToDouble(ce[2]);
                camEffect[i].optionValue2 = 0.0f;               //(float)Convert.(ce[3]);

                float.TryParse(ce[2], out camEffect[i].optionValue);
                float.TryParse(ce[3], out camEffect[i].optionValue2);
            }
        }
        else
        {
            camEffectNum = 0;
        }



        string tempS = (string)l[k["SOUND"]];

        if (string.IsNullOrEmpty(tempS) == false)
        {
            string[] ts = tempS.Split('/');

            soundNum = ts.Length;

            sound = new AniDataSound[soundNum];

            for (int i = 0; i < soundNum; ++i)
            {
                sound[i] = new AniDataSound();

                string[] tts = ts[i].Split(',');

                sound[i].id = tts[0];

                float.TryParse(tts[1], out sound[i].delay);

                sound[i].delay /= 30.0f;
            }
        }
        else
        {
            soundNum = 0;
        }



        temp = (string)l[k["SHOT_POS"]];
        temp = temp.Trim();

//		UnityEngine.Debug.Log(id);

        if (string.IsNullOrEmpty(temp) == false)
        {
            string[] tmp = temp.Split('/');
            shootingPointLength = tmp.Length;
            shootingPositions   = new int[tmp.Length][];

            for (int i = 0; i < shootingPointLength; ++i)
            {
                shootingPositions[i] = Util.stringToIntArray(tmp[i], ',');

                shootingPositions[i][0] = (int)((float)shootingPositions[i][0] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
                shootingPositions[i][1] = (int)((float)shootingPositions[i][1] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
                shootingPositions[i][2] = (int)((float)shootingPositions[i][2] * ((float)GameManager.info.modelData[id].scale) / 100.0f);
            }

            //shootingPoint = temp.Split(',');
            //shootingPointLength = shootingPoint.Length;
        }


        temp = (string)l[k["SHOOTING_POINT"]];
        temp = temp.Trim();

        if (string.IsNullOrEmpty(temp) == false)
        {
            shootingPoint      = temp.Split(',');
            shootingHandLength = shootingPoint.Length;
        }

        Util.parseObject(l[k["HIT_RANGE"]], out hitRange, true, 0.0f);

#if UNITY_EDITOR
        if (GameManager.info.modelData.ContainsKey(id) == false)
        {
            UnityEngine.Debug.Log(id);
        }
#endif

        hitRange *= ((((float)GameManager.info.modelData[id].scale) / 100.0f));

//		Util.parseObject(l[k["LENGTH"]],out aniLength, true, -1000);
    }