Beispiel #1
0
 void KeeperAction()
 {
     mStateCere = new StateArray();
     mRotSpeed  = 1.2f;
     mStateCere.AddAMember("Init", 4f);
     mStateCere.AddExitCondition(() => {
         return(Mathf.Abs(mCerCamAxis.transform.rotation.y) < 0.7f);
     });
     mStateCere.AddAMember("Clock", 0.5f);
     mStateCere.AddEntryAction(() => {
         mRotSpeed = 1.2f;
     });
     mStateCere.AddExitCondition(() => {
         return(Mathf.Abs(mCerCamAxis.transform.rotation.y) < 0.7f);
     });
     mStateCere.AddAMember("Counter", 0.5f);
     mStateCere.AddEntryAction(() => {
         mRotSpeed = -0.85f;
     });
     mStateCere.AddExitCondition(() => {
         return(Mathf.Abs(mCerCamAxis.transform.rotation.y) < 0.7f);
     });
     mStateCere.SetNextStateOf("Init", "Counter");
     mStateCere.SetNextStateOf("Clock", "Counter");
     mStateCere.SetNextStateOf("Counter", "Clock");
     mStateCere.SetStateWithNameOf("Init");
 }
    void PrepareMatchInit()
    {
        dicPlayerOrObj.Add("Refree", mRscrcMan.FindGameObject("PrePareMatch/Referee_Moreno", true));
        dicPlayerOrObj.Add("Coin", mRscrcMan.FindGameObject("PrePareMatch/coin", true));

        dicMenuList.Add("PrePareMatch", mRscrcMan.FindGameObject("PrePareMatch", false));

        try {
            subKickerShirts = Resources.LoadAll("Textures/Substance/Kickershirts", typeof(ProceduralMaterial));
            subPants        = Resources.LoadAll("Textures/Substance/Pants", typeof(ProceduralMaterial));
            subSocks        = Resources.LoadAll("Textures/Substance/Socks", typeof(ProceduralMaterial));

            EnemysubKickerShirts = Resources.LoadAll("Textures/EnemySubstance/Kickershirts", typeof(ProceduralMaterial));
            EnemysubPants        = Resources.LoadAll("Textures/EnemySubstance/Pants", typeof(ProceduralMaterial));
            EnemysubSocks        = Resources.LoadAll("Textures/EnemySubstance/Socks", typeof(ProceduralMaterial));
        } catch {
            //Debug.Log ("UNIFORM LOAD ERROR");
        }

        MyShirts = (Material)Resources.Load("Materials/MyShirts");
        MyPants  = (Material)Resources.Load("Materials/MyPants");
        MySocks  = (Material)Resources.Load("Materials/MySocks");

        Pants  = (Material)Resources.Load("Materials/PantsMaterial");
        Socks  = (Material)Resources.Load("Materials/SocksMaterial");
        Shirts = (Material)Resources.Load("Materials/ShirtMaterial");


        dicPrePareMenuList = new Dictionary <string, GameObject> ();


        //dicPrePareMenuList.Add ("Ui_tutorial", mRscrcMan.FindGameObject ("Ui_camera/Camera/Ui_tutorial", false));
        //dicPrePareMenuList.Add ("Panel_txt", mRscrcMan.FindChild (dicPrePareMenuList ["Ui_tutorial"], "Panel_txt", true));
        //dicPrePareMenuList.Add ("Matching", mRscrcMan.FindGameObject ("matching", false));
        //dicPrePareMenuList.Add ("MainSound", mRscrcMan.FindGameObject ("MainSound", true));

        //---------------------------------------------------------------------------- SubMenu
        //dicPrePareMenuList.Add ("ExitMatch", mRscrcMan.FindChild (dicPrePareMenuList["Matching"],"Camera/Anchor/Panel_base/btn_exit", true));
        //---------------------------------------------------------------------------- MyPlayer



        //---------------------------------------------------------------------------- Refree

        //---------------------------------------------------------------------------- Menu

        //mTargetObj = mRscrcMan.FindGameObject ("Ui_camera", true);

        //mRscrcMan.AddComponentUISendMessage (mRscrcMan.FindChild(dicMenuList["Ui_setup"],"Panel_top/cash",true), mTargetObj, "Btn_Fun_MatchBoxShopCash");
        //mRscrcMan.AddComponentUISendMessage (mRscrcMan.FindChild(dicMenuList["Ui_setup"],"Panel_top/coin",true), mTargetObj, "Btn_Fun_MatchBoxShopCoin");
        //mRscrcMan.AddComponentUISendMessage (mRscrcMan.FindChild(dicMenuList["Ui_setup"],"Panel_top/heart",true), mTargetObj, "Btn_Fun_MatchBoxShopHeart");

        //EnemysubKeeperShirts = Resources.LoadAll ("Textures/EnemySubstance/Keepershirts", typeof(ProceduralMaterial));



        arrState.SetStateWithNameOf("Init");
    }
    //  ////////////////////////////////////////////////     Purchase
    void Purchase(string pStr, int pPrice)
    {
        if (mSttArr.GetCurStateName() != "Rest")
        {
            return;
        }

        mSttArr.SetStateWithNameOf("InitPurchase");
        AgStt.mIAP.PurchaseProduct(pStr);
    }
    //  ////////////////////////////////////////////////     State Array Setting...
    void SetStateArray()
    {
        mSttArr = new StateArray();

        mSttArr.AddAMember("InitPurchase", 5f);
        mSttArr.AddEntryAction(() => {
            mCount = 1;
        });
        mSttArr.AddExitCondition(() => {
            return(true);
        }); // !AgStt.mIAP.mIsUiLocked; });
        mSttArr.AddTimeOutProcess(100f, () => {
            Application.LoadLevel("menu");
        });

        mSttArr.AddAMember("Purchasing", 3f);
//        mSttArr.AddExitCondition (() => {
//            //return !AgStt.mIAP.mSendPackBool.mIsStarted;
//        });
        mSttArr.AddExitAction(() => {
            mCount = 1;
        });
        mSttArr.AddTimeOutProcess(50f, () => {
            Application.LoadLevel("menu");
        });

        //mSttArr.AddAMember ("CheckFile", 2f);

        mSttArr.AddAMember("Rest", 0f);
        mSttArr.AddExitCondition(() => {
            return(false);
        });

        mSttArr.SetSerialExitMember(pClose: false);
        mSttArr.SetStateWithNameOf("Rest");
    }
 public void SetState(string pStateName)
 {
     mStt.SetStateWithNameOf(pStateName);
 }
Beispiel #6
0
    //  ////////////////////////////////////////////////     State Array Setting...
    void SetStateArray()
    {
        mSttArr = new StateArray();

        mSttArr.AddAMember("InitPurchase", 3f);
        mSttArr.AddExitCondition( ()=> {
            return !Ag.mIAP.mIsUiLocked; });
        mSttArr.AddTimeOutProcess(20f, ()=> { // Go to Next Stage..
        });

        mSttArr.AddAMember("CheckFile", 5f);
        mSttArr.AddEntryAction( ()=>{
            Ag.mIAP.CheckUnsentTransaction();
        });
        mSttArr.AddExitCondition( ()=>{
            if (Ag.mIAP.mIsUiLocked) Application.LoadLevel("menu");
            return true;
        } );

        mSttArr.AddAMember("Rest", 0f);
        mSttArr.AddExitCondition( ()=> { return false; } );

        mSttArr.SetSerialExitMember( pClose:false );
        mSttArr.SetStateWithNameOf("Rest");
    }
Beispiel #7
0
    public override void Venture(int pF, int pL)
    {
        // 1 + 1 = 2
        arrStt = new StateArray();

        arrStt.AddAMemberAndEntryAction("Init", 0.5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<       mMpsFormat = new MdFormatter (pF, pL);  ");
            mMpsFormat = new MdFormatter(pF, pL, Godirum.PLU);
            JJ.Init();
            Ag.LogIntenseWord("      >> End <<       mMpsFormat = new MdFormatter (pF, pL);  ");
        });

        arrStt.AddAMemberAndEntryAction("GetChubang", 0.1f, "Normal", () => {
            mCurChubang = mMpsFormat.GetChubang();
        });

        arrStt.AddAMemberAndEntryAction("ChubangInit", 1f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     ChubangInit  ");
            mForm = mRscrcMan.GetFriend(mCurChubang.mFff); // Add Script, Variable..
            mForm.transform.SetAeDora(mCurChubang.mFvr);
            mForm.GetComponent <HtFriendIdv>().LoadEyes(arrEyeObj);
            mLatt = mRscrcMan.GetFriend(mCurChubang.mLff);
            mLatt.transform.SetAeDora(mCurChubang.mLvr);
            mLatt.GetComponent <HtFriendIdv>().LoadEyes(arrEyeObj);

            SetGod(Godirum.PLU);
        });

        arrStt.AddAMemberAndEntryAction("JinsimIntro", 0.5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     JinsimIntro  ");
            mForm.SetState(arrStt.GetCurStateName()); // MoveBack Start
            mLatt.SetState(arrStt.GetCurStateName());

            ReplaceAllEyes();

            // Jinsim Array Creation..  Assign Range .. ...
            arrJsObj = mForm.GetComponent <HtFriendIdv>().CreateJinsim();
            arrJsObj.AddRange(mLatt.GetComponent <HtFriendIdv>().CreateJinsim());
            SetGod(Godirum.PLU);
            //Ag.LogIntenseWord("  Jinsim Count   " + arrJsObj.Count);
        });

        //arrStt.AddAMemberAndEntryAction ("JinsimJumbi", 0.5f, "Normal", () => {  // <<<<<  F L 없어지고 Hon 출현  >>>>>
        arrStt.AddAMemberAndEntryAction("JinsimJumbi", 2f, "Normal", () => { // <<<<<  F L 없어지고 Hon 출현  >>>>>
            Ag.LogIntenseWord("      >> Start <<     JinsimJumbi  ");
            mForm.SetState(arrStt.GetCurStateName());                        // Destroyed ...
            mLatt.SetState(arrStt.GetCurStateName());
            (" JinsimJumbi    >>>>   mCurChubang.mRff ::  " + mCurChubang.mHff.ToString()).HtLog();

            //  -----     Instantiate   ___   Hon   ___   -----  //
            mHon = mRscrcMan.GetFriend(mCurChubang.mHff);                   // Add Script, Variable..
            mHon.transform.SetAeDora(mCurChubang.mHonVr);
            mHon.GetComponent <HtFriendIdv>().LoadEyes(null, pIsHon: true); //  This is Result Eyes ...
            SetGod(Godirum.PLU);

            mHon.SetTarget(mCurChubang.mHTarVr);
            List <VecRot> honVecrot  = mHon.GetComponent <HtFriendIdv>().HonPosition(pIsOver10: (mCurChubang.mKind == Cb.PLUS_OVER10));
            List <VecRot> honEyeVect = mHon.GetComponent <HtFriendIdv>().HonEyePosition(pIsOver10: (mCurChubang.mKind == Cb.PLUS_OVER10)); //  Hon Eye Positions.

            int k = 0;

            // Is Over 10 ...
            if (mCurChubang.mKind == Cb.PLUS_OVER10)
            {
                m10obj = mRscrcMan.GetComPrefab("Friends", Fff.TEN.ToString());
                m10obj.transform.SetAeDora(mCurChubang.mHonVr);

                for (int jk = 0; jk < 10; jk++)
                {
                    arrJsObj[jk].transform.parent = m10obj.transform;
                }
            }

            foreach (GameObject jsgo in arrJsObj)  // Set Targets of Jinsims...
            {
                jsgo.SetTarget(honVecrot[k++]);
            }
            k = 0;
            foreach (GameObject jsgo in arrEyeObj)  //  9 EyeSingle in arrEyeObj ... 3 EyeTriple in honEyeVect ...
            //("  JinsimJumbi >>  honEyeVect  " + honEyeVect.Count + " , k = " + k).HtLog();

            {
                VecRot tar = honEyeVect[k].GetEyeTargetFromHon();
                if (tar == null)
                {
                    tar = honEyeVect[++k].GetEyeTargetFromHon();
                    //("  JinsimJumbi >>  k++  " + k).HtLog();
                }
                jsgo.SetTarget(tar);
                //jsgo.SetTarget(honEyeVect[k++]);
            }

            SetStateOfObjects();
        });

        arrStt.AddAMemberAndEntryAction("JinsimChum", 5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     JinsimChum  ");
            SetStateOfObjects();

            if (mCurChubang.mKind == Cb.PLUS_OVER10)
            {
                arrStt.SetNextStateOf("JinsimChum", "Make10");
            }
        });

        arrStt.AddAMemberAndEntryAction("Result", 2f, "Normal", () => {
            SetStateOfObjects();
        });

        arrStt.AddAMemberAndEntryAction("ShowResult", 2f, "Normal", () => {
            //arrStt.SetStateWithNameOf("Init");
            SetStateOfObjects();
        });

        arrStt.AddAMemberAndEntryAction("DestroyAll", 1f, "Normal", () => {
            DestroyAll();
        });
        arrStt.AddAMemberAndEntryAction("RestInPeace", 0f, "Normal", () => {
        });


        arrStt.AddAMemberAndEntryAction("Make10", 2f, "Normal", () => {   // Additional State ...
            SetStateOfObjects();
        });

        arrStt.SetSerialExitMember();
        arrStt.SetStateWithNameOf("Init");
    }
Beispiel #8
0
    public override void Venture(int pF, int pL)
    {
        // 1 + 1 = 2
        arrStt = new StateArray ();

        arrStt.AddAMemberAndEntryAction ("Init", 0.5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<       mMpsFormat = new MdFormatter (pF, pL);  ");
            mMpsFormat = new MdFormatter (pF, pL, Godirum.PLU);
            JJ.Init ();
            Ag.LogIntenseWord("      >> End <<       mMpsFormat = new MdFormatter (pF, pL);  ");
        });

        arrStt.AddAMemberAndEntryAction ("GetChubang", 0.1f, "Normal", () => {
            mCurChubang = mMpsFormat.GetChubang ();
        });

        arrStt.AddAMemberAndEntryAction ("ChubangInit", 1f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     ChubangInit  ");
            mForm = mRscrcMan.GetFriend(mCurChubang.mFff); // Add Script, Variable..
            mForm.transform.SetAeDora(mCurChubang.mFvr);
            mForm.GetComponent<HtFriendIdv>().LoadEyes(arrEyeObj);
            mLatt = mRscrcMan.GetFriend(mCurChubang.mLff);
            mLatt.transform.SetAeDora(mCurChubang.mLvr);
            mLatt.GetComponent<HtFriendIdv>().LoadEyes(arrEyeObj);

            SetGod(Godirum.PLU);
        });

        arrStt.AddAMemberAndEntryAction ("JinsimIntro", 0.5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     JinsimIntro  ");
            mForm.SetState(arrStt.GetCurStateName()); // MoveBack Start
            mLatt.SetState(arrStt.GetCurStateName());

            ReplaceAllEyes();

            // Jinsim Array Creation..  Assign Range .. ...
            arrJsObj = mForm.GetComponent<HtFriendIdv>().CreateJinsim();
            arrJsObj.AddRange(mLatt.GetComponent<HtFriendIdv>().CreateJinsim() );
            SetGod(Godirum.PLU);
            //Ag.LogIntenseWord("  Jinsim Count   " + arrJsObj.Count);
        });

        //arrStt.AddAMemberAndEntryAction ("JinsimJumbi", 0.5f, "Normal", () => {  // <<<<<  F L 없어지고 Hon 출현  >>>>>
        arrStt.AddAMemberAndEntryAction ("JinsimJumbi", 2f, "Normal", () => {  // <<<<<  F L 없어지고 Hon 출현  >>>>>
            Ag.LogIntenseWord("      >> Start <<     JinsimJumbi  ");
            mForm.SetState(arrStt.GetCurStateName()); // Destroyed ...
            mLatt.SetState(arrStt.GetCurStateName());
            (" JinsimJumbi    >>>>   mCurChubang.mRff ::  " + mCurChubang.mHff.ToString()).HtLog();

            //  -----     Instantiate   ___   Hon   ___   -----  //
            mHon = mRscrcMan.GetFriend(mCurChubang.mHff); // Add Script, Variable..
            mHon.transform.SetAeDora(mCurChubang.mHonVr);
            mHon.GetComponent<HtFriendIdv>().LoadEyes(null, pIsHon:true);  //  This is Result Eyes ...
            SetGod(Godirum.PLU);

            mHon.SetTarget(mCurChubang.mHTarVr);
            List<VecRot> honVecrot = mHon.GetComponent<HtFriendIdv>().HonPosition(pIsOver10:(mCurChubang.mKind == Cb.PLUS_OVER10) );
            List<VecRot> honEyeVect = mHon.GetComponent<HtFriendIdv>().HonEyePosition(pIsOver10:(mCurChubang.mKind == Cb.PLUS_OVER10) ); //  Hon Eye Positions.

            int k=0;

            // Is Over 10 ...
            if (mCurChubang.mKind == Cb.PLUS_OVER10) {
                m10obj = mRscrcMan.GetComPrefab ("Friends", Fff.TEN.ToString() );
                m10obj.transform.SetAeDora(mCurChubang.mHonVr);

                for(int jk=0; jk<10; jk++) {
                    arrJsObj[jk].transform.parent = m10obj.transform;
                }
            }

            foreach(GameObject jsgo in arrJsObj) { // Set Targets of Jinsims...
                jsgo.SetTarget(honVecrot[k++]);
            }
            k=0;
            foreach(GameObject jsgo in arrEyeObj) { //  9 EyeSingle in arrEyeObj ... 3 EyeTriple in honEyeVect ...
                //("  JinsimJumbi >>  honEyeVect  " + honEyeVect.Count + " , k = " + k).HtLog();

                VecRot tar = honEyeVect[k].GetEyeTargetFromHon();
                if (tar == null) {
                    tar = honEyeVect[++k].GetEyeTargetFromHon();
                    //("  JinsimJumbi >>  k++  " + k).HtLog();
                }
                jsgo.SetTarget(tar);
                //jsgo.SetTarget(honEyeVect[k++]);
            }

            SetStateOfObjects();
        });

        arrStt.AddAMemberAndEntryAction ("JinsimChum", 5f, "Normal", () => {
            Ag.LogIntenseWord("      >> Start <<     JinsimChum  ");
            SetStateOfObjects();

            if (mCurChubang.mKind == Cb.PLUS_OVER10) {
                arrStt.SetNextStateOf("JinsimChum", "Make10");

            }
        });

        arrStt.AddAMemberAndEntryAction ("Result", 2f, "Normal", () => {
            SetStateOfObjects();

        });

        arrStt.AddAMemberAndEntryAction ("ShowResult", 2f, "Normal", () => {
            //arrStt.SetStateWithNameOf("Init");
            SetStateOfObjects();
        });

        arrStt.AddAMemberAndEntryAction ("DestroyAll", 1f, "Normal", () => {
            DestroyAll();
        });
        arrStt.AddAMemberAndEntryAction ("RestInPeace", 0f, "Normal", () => {
        });

        arrStt.AddAMemberAndEntryAction ("Make10", 2f, "Normal", () => {  // Additional State ...
            SetStateOfObjects();

        });

        arrStt.SetSerialExitMember ();
        arrStt.SetStateWithNameOf ("Init");
    }
Beispiel #9
0
 void KeeperAction() {
      mStateCere = new StateArray();
      mRotSpeed = 1.2f;
      
      mStateCere.AddAMember("Init", 4f);
      mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } );
      
      mStateCere.AddAMember("Clock", 0.5f);
      mStateCere.AddEntryAction( ()=> { mRotSpeed = 1.2f; } );
      mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } );
     
      mStateCere.AddAMember("Counter", 0.5f);
      mStateCere.AddEntryAction( ()=> { mRotSpeed = -0.85f; } );
      mStateCere.AddExitCondition( ()=> { return Mathf.Abs (mCerCamAxis.transform.rotation.y) < 0.7f; } );;
      
      mStateCere.SetNextStateOf("Init", "Counter");
      mStateCere.SetNextStateOf("Clock", "Counter");
      mStateCere.SetNextStateOf("Counter", "Clock");
      
      mStateCere.SetStateWithNameOf("Init");
  }