예제 #1
0
    public void BlobJoinAnimation(GameObject p_target, Vector3 p_from)
    {
        //p_target.GetComponent<Renderer>().enabled = true;
        hookPivots[hookPivots.Count - 1].GetComponent <HookController>().SetBodySprite(false);
        p_target.GetComponent <SpriteBubbleManager>().ActivateObjects(true);
        //p_target.transform.SetParent(null);
        //p_target.transform.localScale = Vector3.one * 3;
        Vector2 __startingPosition = p_target.transform.position;
        //p_target.transform.SetParent(transform);
        PotaTween __pTween = p_target.GetComponent <PotaTween>();

        __pTween.Clear();
        __pTween.SetPosition(p_from, transform.position);
        __pTween.SetEaseEquation(Ease.Equation.InSine);
        __pTween.UpdateCallback(delegate
        {
            //Debug.Log(new Vector2((p_target.transform.position.x - __startingPosition.x), p_target.transform.position.y - __startingPosition.y));
            //p_target.transform.position = (Vector2)transform.position + ((__startingPosition - (Vector2)p_target.transform.position) * __pTween.Float.Value);
            __pTween.Position.To = (Vector2)transform.position;
        });
        __pTween.Play(delegate
        {
            //p_target.GetComponent<Renderer>().enabled = false;
            hookPivots[hookPivots.Count - 1].GetComponent <HookController>().SetBodySprite(true);
            p_target.GetComponent <SpriteBubbleManager>().ActivateObjects(false);
        });
    }
예제 #2
0
    public void StartAttack()
    {
        if (readyToFire)
        {
            readyToFire = false;

            hookTip.SetActive(true);

            //set the animation parameters
            _potaTween.Clear();
            _potaTween.SetScale(preAttackScale, attackTargetScale);
            _potaTween.SetEaseEquation(Ease.Equation.OutSine);
            _potaTween.SetDuration(0.4f);
            _potaTween.Play(delegate
            {
                StopAttack();
            });
            //tailSprite.GetComponent<Animator>().SetTrigger("Attack");
        }
    }
예제 #3
0
    public void GrowingAnimation(float p_delay)
    {
        if (GetComponent <PotaTween>() == null)
        {
            PotaTween.Create(gameObject);
        }
        PotaTween __pTween = GetComponent <PotaTween>();

        __pTween.SetScale(transform.localScale, Vector3.one * (10 + (capturedPlayersStack.Count)));
        __pTween.SetEaseEquation(Ease.Equation.OutElastic);
        __pTween.SetDelay(p_delay);
        __pTween.Play(delegate
        {
            UpdateHookPivots();
        });
        //UpdateHookPivots();
    }