Пример #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");
    }
Пример #2
0
    private void OnCompleteOnDamage( )
    {
        CustomFade.StopEvent(Shadow.gameObject, "OnDamageShadowWhite");
        CustomFade.StopEvent(Shadow.gameObject, "OnDamageShadowUnWhite");

        BattleActionController.Instance.ShowDamage( );
    }
Пример #3
0
        /************************************************************************************************************************/

        private void PlayRandomAnimation()
        {
            var index = UnityEngine.Random.Range(0, _RandomAnimations.Length);
            var animation = _RandomAnimations[index];
            Creature.Animancer.Play(animation);
            CustomFade.Apply(Creature.Animancer, Easing.Function.SineInOut);
        }
Пример #4
0
    public void Reset( )
    {
        CustomFade.StopEvent(Shadow.gameObject, "AttackShadowWhite");
        CustomFade.StopEvent(Shadow.gameObject, "AttackShadowFadeOut");
        CustomFade.StopEvent(SpriteChar.gameObject, "AttackFadeOut");

        Shadow.color     = new Color(1f, 1f, 1f, 0f);
        SpriteChar.color = Color.white;
    }
Пример #5
0
    void Start()
    {
        this.GlobalInputReceiver.OnSingleTap += SingleTap;
        this.GlobalInputReceiver.OnDoubleTap += DoubleTap;

        this.fadeEffect = this.GetComponent <CustomFade>();

        this.textMeshPro  = UIContainer.transform.GetChild(0).gameObject.GetComponent <TextMeshPro>();
        this.colorFoundUI = UIContainer.transform.GetChild(1).gameObject;
    }
Пример #6
0
    protected void updateChildArray(Transform transform)
    {
        int count = transform.childCount;

        //Debug.Log("Child count of " + transform.gameObject.name + " : " + count);

        Transform  childTransform = null;
        CustomFade fadeScript     = null;
        Component  component      = null;

        for (int i = 0; i < count; ++i)
        {
            childTransform = transform.GetChild(i);

            if (childTransform.gameObject.activeInHierarchy)
            {
                //Debug.LogError("Object : " + childTransform.gameObject.name );

                component = childTransform.GetComponent <tk2dBaseSprite>();
                if (component)
                {
                    fadeScript = childTransform.gameObject.GetComponent <SpriteFade>();
                    if (null == fadeScript)
                    {
                        fadeScript = childTransform.gameObject.AddComponent <SpriteFade>();
                    }
                }

                if (fadeScript)
                {
                    //Debug.Log("Name : " + fadeScript.name) ;
                    fadeScript.Type              = this.Type;
                    fadeScript.Duration          = this.Duration;
                    fadeScript.Delay             = this.Delay;
                    fadeScript.IsUpdateChildAlso = this.IsUpdateChildAlso;
                    fadeScript.Alpha             = this.Alpha;
                    fadeScript.NoDuration        = this.NoDuration;
                    fadeScript.AlphaFrom         = this.AlphaFrom;
                    fadeScript.AlphaTo           = this.AlphaTo;
                    fadeScript.IgnoreTimeScale   = this.IgnoreTimeScale;

                    fadeScript.StartAction( );
                }
                else
                {
                    updateChildArray(childTransform);
                }
            }

            childTransform = null;
            fadeScript     = null;
            component      = null;
        }
    }
Пример #7
0
    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");
    }
Пример #8
0
 public void PlayMove()
 {
     CustomFade.PlayEvent(Shadow.gameObject, "AttackShadowWhite");
     CustomFade.PlayEvent(Shadow.gameObject, "AttackShadowFadeOut");
     CustomFade.PlayEvent(SpriteChar.gameObject, "AttackFadeOut");
 }