void loadGameControllerInitializer(Object olly)
    {
        NF_GameController gameController = (NF_GameController)Camera.main.GetComponentInChildren <NF_GameController>();

        gameController.initializeGameController();
        destroyIntroObjects(olly);
    }
Beispiel #2
0
    void createObjectsForQuestion()
    {
        NF_GameController GC = (NF_GameController)Camera.main.GetComponentInChildren <NF_GameController>();

        if (thoughtBubble != null || GC.isResetInProgress == true)
        {
            Destroy(thoughtBubble);
        }
        thoughtBubble = Instantiate(_thoughtBubble, _thoughtBubble.transform.position, Quaternion.identity) as GameObject;
        thoughtBubble.transform.parent        = this.gameObject.transform;
        thoughtBubble.transform.localPosition = new Vector3(0, 0, 0);

        if (AGGameState.currentGameIndex == (int)AGGameIndex.k_NamingFruits && currentCategoryID == (int)NamingFruits_CategoryID.id_AlplabeticOrder)
        {
            qShapeObj = Instantiate(_questionShape, _questionShape.transform.position, Quaternion.identity) as GameObject;
            qShapeObj.transform.parent        = this.gameObject.transform;
            qShapeObj.transform.localPosition = new Vector3(-5, 30, -10);
        }
        else if (AGGameState.currentGameIndex == (int)AGGameIndex.k_NamingFruits && currentCategoryID == (int)NamingFruits_CategoryID.id_Food)
        {
            if (qTextObj != null)
            {
                Destroy(qTextObj);
            }
            if (currentGameMode != (int)GameModes.mode_different)
            {
                qTextObj = Instantiate(_textMesh, _textMesh.transform.position, Quaternion.identity) as GameObject;
                qTextObj.transform.parent        = this.gameObject.transform;
                qTextObj.transform.localPosition = new Vector3(-5, -65, -10);
            }
            qShapeObj = Instantiate(_questionShape, _questionShape.transform.position, Quaternion.identity) as GameObject;
            qShapeObj.transform.parent        = this.gameObject.transform;
            qShapeObj.transform.localPosition = new Vector3(-5, 30, -10);
        }
        else if (AGGameState.currentGameIndex == (int)AGGameIndex.k_2DShapesColors)
        {
            if (qTextObj != null)
            {
                Destroy(qTextObj);
            }
            if (currentGameMode != (int)GameModes.mode_different)
            {
                qTextObj = Instantiate(_textMesh, _textMesh.transform.position, Quaternion.identity) as GameObject;
                qTextObj.transform.parent        = this.gameObject.transform;
                qTextObj.transform.localPosition = new Vector3(-5, -65, -10);
            }
            qShapeObj = Instantiate(_questionShape, _questionShape.transform.position, Quaternion.identity) as GameObject;
            qShapeObj.transform.parent        = this.gameObject.transform;
            qShapeObj.transform.localPosition = new Vector3(-5, 30, -10);
        }
    }
Beispiel #3
0
    void callLoadNextQuestion()
    {
        NF_GameController gameController = (NF_GameController)Camera.main.GetComponentInChildren <NF_GameController>();

        gameController.loadNextQuestion(24.0f / 30.0f);
    }
Beispiel #4
0
    public void playIcky_Animations()
    {
        NF_InputController IC = (NF_InputController)Camera.mainCamera.GetComponentInChildren <NF_InputController>();

        if (ickyStates == NF_IckyAnimationStates.unknown || ickyStates == NF_IckyAnimationStates.icky_reseting)
        {
            IC.enableTouches();
            renderer.material.mainTexture = ickyImage;
            transform.localScale          = new Vector3(140, 165, 1);

            colCount   = 1;
            rowCount   = 1;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 1;
            fps        = 30;
            setCurrentFrame(0);
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_weeping)
        {
            IC.disableTouches();
            renderer.material.mainTexture = weepingSheet;
            transform.localScale          = new Vector3(166, 126, 1);
            colCount   = 2;
            rowCount   = 1;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 2;
            fps        = 30;

            if (weepingFrames == null || weepingFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)weepingFrames[0]);
            weepingFrames.RemoveAt(0);
            if (weepingFrames.Count == 0)
            {
                ickyStates = NF_IckyAnimationStates.unknown;
                createAnimations();
                callLoadNextQuestion();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_weeping2)
        {
            IC.disableTouches();
            renderer.material.mainTexture = weepingSheet;
            transform.localScale          = new Vector3(166, 126, 1);
            colCount   = 2;
            rowCount   = 1;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 2;
            fps        = 30;

            if (weepingFrames == null || weepingFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)weepingFrames[0]);
            weepingFrames.RemoveAt(0);
            if (weepingFrames.Count == 0)
            {
                currentFrame = 0;
                fps          = 30;
                ickyStates   = NF_IckyAnimationStates.unknown;
                createAnimations();
                callLoadNextQuestion();
            }
        }

        else if (ickyStates == NF_IckyAnimationStates.icky_giggle)
        {
            IC.disableTouches();
            renderer.material.mainTexture = giggleSheet;
            transform.localScale          = new Vector3(135, 148, 1);
            colCount   = 8;
            rowCount   = 3;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 23;
            fps        = 30;

            if (giggleFrames == null || giggleFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)giggleFrames[0]);
            giggleFrames.RemoveAt(0);
            if (giggleFrames.Count == 0)
            {
                currentFrame = 0;
                fps          = 30;
                ickyStates   = NF_IckyAnimationStates.icky_idle;
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_celebration)
        {
            IC.disableTouches();
            renderer.material.mainTexture = celebrationSheet;
            transform.localScale          = new Vector3(200, 175, 1);
            colCount   = 8;
            rowCount   = 7;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 53;
            fps        = 30;

            if (celebrationFrames == null || celebrationFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)celebrationFrames[0]);
            celebrationFrames.RemoveAt(0);
            if (celebrationFrames.Count == 0)
            {
                fps          = 30;
                currentFrame = 0;
                ickyStates   = NF_IckyAnimationStates.icky_idle;
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_want)
        {
            IC.enableTouches();
            renderer.material.mainTexture = wantSheet;
            transform.localScale          = new Vector3(145, 160, 1);
            colCount   = 5;
            rowCount   = 5;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 25;
            fps        = 30;

            if (wantFrames == null || wantFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)wantFrames[0]);
            wantFrames.RemoveAt(0);
            if (wantFrames.Count == 0)
            {
                currentFrame = 0;
                fps          = 30;
                ickyStates   = NF_IckyAnimationStates.icky_idle;
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_idle)
        {
            IC.enableTouches();
            renderer.material.mainTexture = idleSheet;
            transform.localScale          = new Vector3(140, 165, 1);
            colCount   = 10;
            rowCount   = 6;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 59;
            fps        = 30;

            if (idleFrames == null || idleFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)idleFrames[0]);
            idleFrames.RemoveAt(0);
            if (idleFrames.Count == 0)
            {
                currentFrame = 0;
                fps          = 30;
                ickyStates   = NF_IckyAnimationStates.icky_want;
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_eating)
        {
            IC.disableTouches();
            renderer.material.mainTexture = eating1Sheet;
            transform.localScale          = new Vector3(150, 158, 1);
            colCount   = 8;
            rowCount   = 7;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 53;
            fps        = 50;
            if (eating1Frames == null || eating1Frames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)eating1Frames[0]);
            eating1Frames.RemoveAt(0);
            if (eating1Frames.Count == 0)
            {
                if (IC._totalAnswersCount > 0)
                {
                    setIckyPosition_HopAnimation(0.0f, NF_IckyAnimationStates.icky_hop);
                }
                else
                {
                    if (shouldPlayCelebration)
                    {
                        shouldPlayCelebration = false;
                        ickyStates            = NF_IckyAnimationStates.icky_celebration;
                        playSoundClip();
                    }
                    else
                    {
                        ickyStates = NF_IckyAnimationStates.icky_idle;
                    }

                    fps          = 30;
                    currentFrame = 0;
                    createAnimations();
                }
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_wrongAns)
        {
            renderer.material.mainTexture = wrongSheet;
            transform.localScale          = new Vector3(115, 145, 1);
            colCount   = 8;
            rowCount   = 2;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 24;
            fps        = 30;

            if (wrongFrames == null || wrongFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)wrongFrames[0]);
            wrongFrames.RemoveAt(0);
            if (wrongFrames.Count == 0)
            {
                IC.disableTouches();
                fps          = 30;
                currentFrame = 0;
                ickyStates   = NF_IckyAnimationStates.icky_idle;
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_jumping)
        {
            IC.disableTouches();
            renderer.material.mainTexture = jump1Sheet;
            if (shouldFlipHop)
            {
                transform.localScale = new Vector3(-180, 250, 1);
            }
            else
            {
                transform.localScale = new Vector3(180, 250, 1);
            }
            colCount   = 6;
            rowCount   = 3;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 18;
            fps        = 50;

            if (jump1Frames == null || jump1Frames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)jump1Frames[0]);
            jump1Frames.RemoveAt(0);
            if (jump1Frames.Count == 0)
            {
                fps          = 30;
                currentFrame = 0;
                ickyStates   = NF_IckyAnimationStates.icky_eating;
                playSoundClip();
                createAnimations();
            }
        }
        else if (ickyStates == NF_IckyAnimationStates.icky_bouncing)
        {
            IC.disableTouches();
            renderer.material.mainTexture = bouncingSheet;
            if (shouldFlipHop)
            {
                transform.localScale = new Vector3(-125, 165, 1);
            }
            else
            {
                transform.localScale = new Vector3(125, 165, 1);
            }
            colCount   = 6;
            rowCount   = 4;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 22;
            fps        = 50;

            if (jump1Frames == null || jump1Frames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)jump1Frames[0]);
            jump1Frames.RemoveAt(0);
            if (jump1Frames.Count == 0)
            {
                fps          = 30;
                currentFrame = 0;
                ickyStates   = NF_IckyAnimationStates.icky_eating;
                playSoundClip();
                createAnimations();
            }
        }

        else if (ickyStates == NF_IckyAnimationStates.icky_angleJumpNEat)
        {
            IC.disableTouches();
            renderer.material.mainTexture = angleJumpNEatSheet;
            if (shouldFlipHop)
            {
                transform.localScale = new Vector3(-165, 355, 1);
            }
            else
            {
                transform.localScale = new Vector3(165, 335, 1);
            }
            colCount   = 9;
            rowCount   = 6;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 51;
            fps        = 50;
            if (angleJumpFrames == null || angleJumpFrames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)angleJumpFrames[0]);
            angleJumpFrames.RemoveAt(0);
            if (angleJumpFrames.Count == 0)
            {
                Vector3 newPos = this.transform.position;
                newPos.y = newPos.y - 95;
                this.transform.position = newPos;
                transform.localScale    = new Vector3(140, 165, 1);
                NF_QuestionLoader questionLoader1 = GameObject.Find("Question").GetComponent <NF_QuestionLoader>();
                questionLoader1.moveToIckyPosition();

                NF_GameController gameController = (NF_GameController)Camera.mainCamera.GetComponentInChildren <NF_GameController>();
                gameController.thoughtBubbleFadeIn();

                fps          = 30;
                currentFrame = 0;
                if (shouldPlayCelebration)
                {
                    shouldPlayCelebration = false;
                    ickyStates            = NF_IckyAnimationStates.icky_celebration;
                    playSoundClip();
                }
                else
                {
                    ickyStates = NF_IckyAnimationStates.icky_idle;
                }

                createAnimations();
            }
        }

        else if (ickyStates == NF_IckyAnimationStates.icky_hop || ickyStates == NF_IckyAnimationStates.icky_bounceNEat)
        {
            IC.disableTouches();
            renderer.material.mainTexture = jump1Sheet;
            if (shouldFlipHop)
            {
                transform.localScale = new Vector3(-180, 250, 1);
            }
            else
            {
                transform.localScale = new Vector3(180, 250, 1);
            }
            colCount   = 6;
            rowCount   = 3;
            colNumber  = 0;
            rowNumber  = 0;
            totalCells = 18;
            fps        = 50;
            if (jump1Frames == null || jump1Frames.Count == 0)
            {
                createAnimations();
            }

            setCurrentFrame((int)jump1Frames[0]);
            jump1Frames.RemoveAt(0);
            if (jump1Frames.Count == 0)
            {
                if (ickyStates == NF_IckyAnimationStates.icky_hop)
                {
                    NF_QuestionLoader questionLoader1 = GameObject.Find("Question").GetComponent <NF_QuestionLoader>();
                    questionLoader1.moveToIckyPosition();

                    NF_GameController gameController = (NF_GameController)Camera.mainCamera.GetComponentInChildren <NF_GameController>();
                    gameController.thoughtBubbleFadeIn();
                    fps          = 30;
                    currentFrame = 0;
                    ickyStates   = NF_IckyAnimationStates.icky_idle;
                    createAnimations();
                }
                else
                {
                    fps          = 30;
                    currentFrame = 0;
                    ickyStates   = NF_IckyAnimationStates.icky_bouncing;
                    NF_SoundManager.playSFX(voiceOversIcky[14]);
                    playSoundClip();
                    createAnimations();
                }
            }
        }
    }
 void Awake()
 {
     dragTrail      = dragTrailObj.GetComponent <NF_DragTrail>();
     gameController = (NF_GameController)Camera.mainCamera.GetComponentInChildren <NF_GameController>();
     addFingureGestureObjects();
 }
 void Awake()
 {
     dragTrail = dragTrailObj.GetComponent<NF_DragTrail>();
     gameController = (NF_GameController) Camera.mainCamera.GetComponentInChildren<NF_GameController>();
     addFingureGestureObjects();
 }