Exemple #1
0
    // ----- Hide shadow and quick sand
    void hideShadow(GameObject selection)
    {
        GameObject parent = selection.transform.parent.gameObject;

        if (parent != null)
        {
            Transform [] childs = parent.GetComponentsInChildren <Transform>();
            if (childs.Length >= 4)
            {
                Transform quickSandObject = childs[2];
                Transform shadowObject    = childs[3];

                GameObject shadow    = shadowObject.gameObject;
                GameObject quickSand = quickSandObject.gameObject;
                if (shadow != null)
                {
                    PG_ShapeShadowController shadowController = shadow.GetComponent <PG_ShapeShadowController>();
                    shadowController.hideShadow();
                }
                if (quickSand != null)
                {
                    quickSand.SetActive(false);
                }
            }
        }
    }
    public void shapesIdleAnimation()
    {
        gameController.enableTouchesFlag   = true;
        gameController.shapesReachedPlayVO = true;
        PG_SoundManager.playIntroClip      = true;
        rotateLeft();
        GameObject parent = gameObject.transform.parent.gameObject;

        if (parent != null)
        {
            Transform [] childs          = parent.GetComponentsInChildren <Transform>();
            Transform    quickSandObject = childs[2];
            Transform    shadowObject    = childs[3];

            GameObject shadow = shadowObject.gameObject;
            if (shadow != null)
            {
                PG_ShapeShadowController shadowController = shadow.GetComponent <PG_ShapeShadowController>();
                shadowController.playShowShapesShadowAnim();
            }

            GameObject quickSand = quickSandObject.gameObject;
        }
    }