Esempio n. 1
0
 public void CheckActEvent()
 {
     if (actEventHandler != null)
     {
         JSHelper.DebugLogError("actEventHandler not empty before init !");
     }
 }
Esempio n. 2
0
    /// <summary>
    /// Play Effect Animation Event
    /// </summary>
    /// <param name="index">Index.</param>
    public void AnimationEvent(string index_pause)
    {
        string[] vars  = index_pause.Split('_');
        int      index = int.Parse(vars [0]);
        float    pause = float.Parse(vars [1]);

        if (animationEventInfos.Count == 0)
        {
            JSHelper.DebugLog("No animation event !");
        }
        else if (animationEventInfos.Count <= index)
        {
            JSHelper.DebugLogError("Animation event index out of limit : " + index);
        }
        else
        {
            if (!animationEventInfos [index].selfParticle)
            {
                ParticleSystem.MainModule main = animationEventInfos [index].particles [0].main;
                main.simulationSpeed = JSTime.Instance.MainGameSceneDeltaTime;
                foreach (ParticleSystem par in animationEventInfos[index].particles)
                {
                    par.Stop();
                    par.Play();
                }

                if (pause > 0)
                {
                    animator.speed = 0;
                    StartCoroutine(DelayContinueAnimator(pause));
                }
            }
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
     colliders.AddRange(GetComponentsInChildren <Collider> (true));
     for (int i = 0; i < colliders.Count; ++i)
     {
         if (!colliderInfos.ContainsKey(colliders [i]))
         {
             colliderInfos.Add(colliders [i], colliders [i].GetComponent <JSColliderBase> ());
         }
         else
         {
             JSHelper.DebugLogError("Contains same collider key : " + colliders [i].name);
         }
     }
 }
Esempio n. 4
0
    public override void ModifyMesh(VertexHelper vh)
    {
        if (!IsActive() ||
            vh.currentVertCount == 0)
        {
            return;
        }

        Text text = GetComponent <Text>();

        if (text == null)
        {
            JSHelper.DebugLogError("Missing Text component");
            return;
        }

        List <UIVertex> vertexs = new List <UIVertex>();

        vh.GetUIVertexStream(vertexs);
        int indexCount = vh.currentIndexCount;

        string[] lineTexts = text.text.Split('\n');

        Line[] lines = new Line[lineTexts.Length];

        for (int i = 0; i < lines.Length; i++)
        {
            if (i == 0)
            {
                lines[i] = new Line(0, lineTexts[i].Length + 1);
            }
            else if (i > 0 && i < lines.Length - 1)
            {
                lines[i] = new Line(lines[i - 1].EndVertexIndex + 1, lineTexts[i].Length + 1);
            }
            else
            {
                lines[i] = new Line(lines[i - 1].EndVertexIndex + 1, lineTexts[i].Length);
            }
        }

        UIVertex vt;

        for (int i = 0; i < lines.Length; i++)
        {
            for (int j = lines[i].StartVertexIndex + 6; j <= lines[i].EndVertexIndex; j++)
            {
                if (j < 0 ||
                    j >= vertexs.Count)
                {
                    continue;
                }
                vt           = vertexs[j];
                vt.position += new Vector3(textSpacing * ((j - lines[i].StartVertexIndex) / 6), 0, 0);
                vertexs[j]   = vt;

                if (j % 6 <= 2)
                {
                    vh.SetUIVertex(vt, (j / 6) * 4 + j % 6);
                }
                if (j % 6 == 4)
                {
                    vh.SetUIVertex(vt, (j / 6) * 4 + j % 6 - 1);
                }
            }
        }
    }