Exemple #1
0
    public void ShowText(int Damage)
    {
        GameObject go = DamageText.gameObject;

        go.SetActive(true);
        DamageText.text = Damage.ToString();

        Vector3 position = new Vector3(CurrentDefender.position.x, CurrentDefender.position.y + 2,
                                       CurrentDefender.position.z);

        go.transform.position   = position;
        go.transform.localScale = Vector3.zero;

        iTween.Stop(go);

        CustomFade.StopEvent(go, "TextShowFade");
        CustomFade.StopEvent(go, "TextHideFade");

        iTween.ScaleTo(go, iTween.Hash("scale", new Vector3(5, 5, 5),
                                       "time", 0.7f,
                                       "easetype", iTween.EaseType.easeOutElastic));

        CustomFade.PlayEvent(go, "TextShowFade");

        iTween.MoveBy(go, iTween.Hash("amount", new Vector3(0, 1, 0),
                                      "time", 0.5f,
                                      "delay", 0.65f,
                                      "oncompletetarget", go,
                                      "oncomplete", "RemoveText"));
        CustomFade.PlayEvent(go, "TextHideFade");
    }
    public void PlayOnDamage(bool isLeft)
    {
        iTween.MoveBy(gameObject, iTween.Hash("time", 0.4f,
                                              "amount", new Vector3(isLeft ? 0.6f : -0.6f, 0, 0),
                                              "space", Space.World));
        iTween.MoveTo(gameObject, iTween.Hash("position", Vector3.zero,
                                              "islocal", true,
                                              "time", 0.4f,
                                              "delay", 0.4f,
                                              "oncompletetarget", this.gameObject,
                                              "oncomplete", "OnCompleteOnDamage"));

        CustomFade.PlayEvent(Shadow.gameObject, "OnDamageShadowWhite");
        CustomFade.PlayEvent(Shadow.gameObject, "OnDamageShadowUnWhite");
    }
 public void PlayMove()
 {
     CustomFade.PlayEvent(Shadow.gameObject, "AttackShadowWhite");
     CustomFade.PlayEvent(Shadow.gameObject, "AttackShadowFadeOut");
     CustomFade.PlayEvent(SpriteChar.gameObject, "AttackFadeOut");
 }