Esempio n. 1
0
    private void OnDisable()
    {
        foreach (GameObject hold in holds)
        {
            if (hold != null)
            {
                ClimbARHandhold.HoldLineRendererActive(hold, false);

                HoldText hTextScript = hold.GetComponent <HoldText>();

                SoundHold script = hold.GetComponent <SoundHold>();
                Destroy(hTextScript);
                Destroy(script);

                ClimbARHandhold.DestroyChildren(hold);
            }
        }
    }
Esempio n. 2
0
    private void OnDisable()
    {
        foreach (GameObject hold in holds)
        {
            if (hold != null)
            {
                MenuHold mHoldScript = hold.GetComponent <MenuHold>();
                HoldText hTextScript = hold.GetComponent <HoldText>();

                // Hide the rendered sprite
                hold.GetComponent <SpriteRenderer>().enabled = false;
                ClimbARHandhold.DestroyChildren(hold);
                ClimbARHandhold.HoldLineRendererActive(hold, false);
                hold.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f);

                // Reset line renderer to uniform color
                hold.GetComponent <LineRenderer>().startColor = UnityEngine.Color.cyan;
                hold.GetComponent <LineRenderer>().endColor   = UnityEngine.Color.cyan;

                Destroy(mHoldScript);
                Destroy(hTextScript);
            }
        }
    }