private void Start()
    {
        GameObject.Instantiate(cursor, new Vector3(-999f, 0f, 0f), Quaternion.identity);
        animate = GetComponentInChildren <Animate>();
        Vector3 startSize = this.transform.localScale;
        Vector3 endSize   = new Vector3(startSize.x * .7f, startSize.y * .7f, 1.0f);

        animate.AnimateToSize(startSize, endSize, .75f, Animate.RepeatMode.PingPong);
    }
Exemple #2
0
    private void SetActiveButton(Animate button)
    {
        currentButton = button;

        GetOtherButton(button).StopAnimating();
        GetOtherButton(button).transform.localScale = Vector3.one;

        currentButton.AnimateToSize(SMALL, LARGE, PULSE_TIME, Animate.RepeatMode.PingPong);
    }
    // Use this for initialization
    void Start()
    {
        Animate animate = this.gameObject.GetComponent <Animate>();

        if (animate != null)
        {
            if (animateSize)
            {
                animate.AnimateToSize(sizeStart, sizeFinish, sizeDuration, sizeRepeatMode);
            }
        }
    }
Exemple #4
0
    private void Update()
    {
        if (activeMessage == null &&
            messageQueue.Count > 0)
        {
            activeMessage = messageQueue.Dequeue();
        }

        if (activeMessage != null)
        {
            switch (activeMessage.action)
            {
            case Message.Action.move: {
                Vector2Int start = Board.GetCellPosition(transform.position);
                Vector2Int end   = Board.GetAdjacentCellPosition(start, activeMessage.dir);

                Move(start, end);
            } break;

            case Message.Action.shoot: {
                Vector2Int start  = Board.GetCellPosition(transform.position);
                Vector2Int target = Board.GetAdjacentCellPosition(start, activeMessage.dir);

                Shoot(start, target);
            } break;
            }

            activeMessage = null;
        }
        else
        {
            timeSinceLastMessage += Time.deltaTime;

            if (timeSinceLastMessage > FLEX_DELAY)
            {
                model.pigeon.sprite = ResourceManager.self.GetPigeonSprite(playerIndex, Random.Range(0f, 1f) > 0.5f ? PigeonPose.Flex1 : PigeonPose.Flex2);

                ResetVisuals();
                animate.AnimateToSize(new Vector2(0.5f, 0.5f), new Vector2(.55f, .55f), 0.5f, Animate.RepeatMode.OnceAndBack);

                timeSinceLastMessage = FLEX_DELAY / 2f;
            }
        }
    }