void Update()
    {
        // If the shape isn't selected, target alpha will always be 0 (so it will be hidden)
        float myTargetAlpha = 0.0f;

        // Otherwise we'll display the shape and animate it
        if (isSelected && isVisible)
        {
            myTargetAlpha = 1.0f;
        }

        SpriteBehavior.FadeAlphaToTarget(this.gameObject, 4f, myTargetAlpha);


        GetComponent <SpriteRenderer>().sprite = spriteShapes[myCurrentSprintShape];
        //ChangePaletteShape();

        // if(isSelected)
        // {
        //     myTargetScale = new Vector3(3.0f, 3.0f, 3.0f);
        // }
        // else
        // {
        //     myTargetScale = new Vector3(2.0f, 2.0f, 2.0f);
        // }
        //
        // Vector3 scale = this.gameObject.transform.localScale;
        // if (scale.x < myTargetScale.x) scale.x += 0.1f;
        // if (scale.y < myTargetScale.y) scale.y += 0.1f;
        // if (scale.x > myTargetScale.x) scale.x -= 0.1f;
        // if (scale.y > myTargetScale.y) scale.y -= 0.1f;
        //
        // this.gameObject.transform.localScale = scale;
    }
Exemplo n.º 2
0
    void Update()
    {
        Renderer render = GetComponent <Renderer>();

        if (render != null)
        {
            render.enabled = isVisible;
        }

        if (!myNetworkManager.IsClientConnected())
        {
            SpriteBehavior.FadeAlphaToTarget(this.gameObject, 1f, 0f);
        }
    }
Exemplo n.º 3
0
    void Update()
    {
        float myTargetAlpha = 0.0f;

        if (isVisible && myNetworkManager.IsClientConnected())
        {
            myTargetAlpha = 1.0f;
        }

        myDebounceTimer += Time.deltaTime;
        if (myDebounceTimer > 60.0f)
        {
            myDebounceTimer = 0.0f;
        }

        SpriteBehavior.FadeAlphaToTarget(this.gameObject, 1f, myTargetAlpha);
    }
    void Update()
    {
        float myTargetAlpha = 0.0f;

        if (isVisible && myNetworkManager.IsClientConnected())
        {
            myTargetAlpha = 1.0f;
        }

        // If the user disconnects, reset to the default color when disconnected...
        if (isSelectedOnDisconnect && !myNetworkManager.IsClientConnected())
        {
            isSelected = true;
            DeselectOtherPaletteObjects();
        }

        HandleSelectionChanges();

        SpriteBehavior.FadeAlphaToTarget(this.gameObject, 1f, myTargetAlpha);
    }