Exemple #1
0
    IEnumerator TargetAnimation(GameObject pos, CharacterLane lane, CardData data, CardAction action)
    {
        if (action.Source == null)
        {
            yield break;
        }

        var initialPos = action.Source.gameObject.transform.GetChild(0).gameObject.transform.position;

        iTween.MoveTo(action.Source.gameObject.transform.GetChild(0).gameObject,
                      iTween.Hash("position", pos.transform.position,
                                  "easeType", "easeInQuart",
                                  "time", 0.5f));

        iTween.MoveTo(action.Source.gameObject.transform.GetChild(0).gameObject,
                      iTween.Hash("position", initialPos,
                                  "time", 0.5f,
                                  "delay", 0.5f));

        yield return(StartCoroutine(ExecuteWithCoroutine(lane, data, waitTimeBetweenActions / 2)));
    }
Exemple #2
0
    IEnumerator SelfAnimation(CharacterLane lane, CardData data, CardAction action)
    {
        if (action.Source == null)
        {
            yield break;
        }

        var initialPos = action.Source.gameObject.transform.GetChild(0).gameObject.transform.position;

        iTween.MoveTo(action.Source.gameObject.transform.GetChild(0).gameObject,
                      iTween.Hash(
                          "position", new Vector3(initialPos.x, initialPos.y + .3f, initialPos.z),
                          "time", 0.25f));

        iTween.MoveTo(action.Source.gameObject.transform.GetChild(0).gameObject,
                      iTween.Hash("position", initialPos,
                                  "time", 0.25f,
                                  "delay", 0.25f));

        yield return(StartCoroutine(ExecuteWithCoroutine(lane, data, waitTimeBetweenActions / 4)));
    }
Exemple #3
0
    private IEnumerator ExecuteWithCoroutine(CharacterLane lane, CardData data, float time)
    {
        yield return(new WaitForSeconds(time));

        lane.ExecuteAction(data);
    }