// //////////////////////////////////////////////// //////////////////////// >>>>> initialization Start <<<<< public override void Start() { mEnemyLeftFlag = false; Ag.CurrentScene = "GAME"; base.Start(); //AgStt.BenderObj.EventTime += TimeProcess; mTouchTime = null; GameInit(); mStateArr = new StateArray(); mStage = new AmStage(); mStage.arrTheState = mStateArr; if (AgStt.mgGameTutorial) { Debug.Log("Tutorial STart"); SetStateArrayTutorial(); } else { if (Ag.mSingleMode) { Ag.NodeObj.MySocket.SceneLoadComplete.InitSet(true); SetStateArraySingleMode(); } else { Ag.NodeObj.MySocket.ActionSceneLoadComplete(); SetStateArray(); // Set State Machine ...... } } CommonStateMethods(); //SetArrTexture (); // Set Texture Array... newPosition = mCameraDefn.transform.position; }
// //////////////////////////////////////////////// //////////////////////// >>>>> initialization Start <<<<< void Start () { mRetryBtn = GameObject.Find("ResultCamera/Retry").gameObject; mQuitBtn = GameObject.Find("ResultCamera/Quit").gameObject; mRetryBtn.active = false; mQuitBtn.active = false; mGoldenballeffUp = (GameObject)Resources.Load("Effect/Mystic"); Ag.SetWorldState("Game"); //------------------------------------------- GetCoin Ag.mIapPrice = 0; Ag.mIAP.mFileIO.mReceipt = "this Receipt"; mGoldenBall = mSilverBall = mBronzeBall = Ag.mBallEventAlready = false; //------------------------------------------- mTimerObj = new AgTime(); //mDragExitBtn = GameObject.Find("UI Root/SingleQuitBtn").gameObject; //mDragExitBtn.SetActiveRecursively(Ag.mSingleMode); Ag.mgEnemGiveup = false; mCurPlayer = Ag.mySelf.mCurPlayer; mCurEnem = Ag.myEnem.mCurPlayer; mAwayEnem = AgUtil.GetMessage("500Game", "AwayEnemy"); mAwaySelf = AgUtil.GetMessage("500Game", "AwayMyself"); mAwayRect = new Rect( Ag.mgScrX*0.2f, Ag.mgScrY*0.2f, Ag.mgScrX*0.6f, Ag.mgScrY*0.5f ); mKplayer = Ag.mySelf.GetGlkper(Ag.mySelf.mGoalUNO); GameInit(); mGodenBallCoin = GameObject.Find("UI Root/GetCoin2").gameObject; mTimerbar.active = false; GameObject.Find("Fadeinout").SendMessage("FadeTest",true,SendMessageOptions.DontRequireReceiver); mKickerInfoBar = (Texture2D)Resources.Load ("UIsource/KICKER_INFOBAR 2"); mAwayPop = AgUtil.GetMessage("100Total", "LeftRoom"); mReconnect = AgUtil.GetMessage("100Total", "Reconnect"); mOK = (Texture2D)Resources.Load("100Total/OkPopup"); // Score Board... float sX = Ag.mgScrX, sY = Ag.mgScrY; float cenX = Ag.mgScrX *0.5f, cenY = Ag.mgScrY*0.03f, vsWid = Ag.mgScrX * 0.5125f , vsHei = Ag.mgScrY * 0.06f, myScrX = vsWid * 0.46f, enScrX = vsWid * 0.42f, siz = vsWid *0.05f; mVSrect = new Rect ( cenX - 0.5f * vsWid, cenY - 0.5f * vsHei, vsWid, vsHei); // Score Board mMyScr = new Rect ( cenX - myScrX, cenY - vsHei * 0.4f, siz*2f, siz*2f); // My Score text mEnScr = new Rect ( cenX + enScrX, cenY - vsHei * 0.4f, siz*2f, siz*2f); // En Score text mAwayPopRect = new Rect( sX*0.18021f, sY*0.30781f, sX*0.63958f, sY*0.38438f); mOkRect = new Rect( sX*0.45547f, sY*0.53f, sX*0.10208f, sY*0.08906f); mSignalStep = vsWid * 0.055f; mSiz = vsWid * 0.037f; // Signal Size.. mMySigX = cenX - vsWid * 0.117f - mSiz*0.5f; // Signal Initial Position (myside) mEnSigX = cenX + vsWid * 0.117f - mSiz*0.5f; // Signal Initial Position (enemy ) mTimer00 = (Texture2D)Resources.Load("Timer/S2"); mTimer01 = (Texture2D)Resources.Load("Timer/S1"); mTimer02 = (Texture2D)Resources.Load ("Timer/S4"); mTimer03 = (Texture2D)Resources.Load ("Timer/S5"); mTimer04 = (Texture2D)Resources.Load ("Timer/S6"); mTimer05 = (Texture2D)Resources.Load ("Timer/S7"); mTimer06 = (Texture2D)Resources.Load ("Timer/S8"); mTimer07 = (Texture2D)Resources.Load ("Timer/S9"); mTimer08 = (Texture2D)Resources.Load ("Timer/10"); mTimer09 = (Texture2D)Resources.Load ("Timer/11c"); mTimer10 = (Texture2D)Resources.Load ("Timer/12c"); mTimer11 = (Texture2D)Resources.Load ("Timer/13c"); mTimer12 = (Texture2D)Resources.Load ("Timer/14c"); mTimer13 = (Texture2D)Resources.Load ("Timer/15c"); mTimer14 = (Texture2D)Resources.Load ("Timer/16c"); mTimer15 = (Texture2D)Resources.Load ("Timer/17c"); mTimer16 = (Texture2D)Resources.Load ("Timer/18c"); mTimer17 = (Texture2D)Resources.Load ("Timer/19c"); mRndBoxpng = (Texture2D)Resources.Load ("TestItem/randombox12"); // Effect Related... mEffect = (Texture2D)Resources.Load ("UISource/LogIn/EFFECT_perfect"); mEffect2 = (Texture2D)Resources.Load ("UISource/EFFECT_buildup"); mEffectPotion = (Texture2D)Resources.Load ("500Game/UI/RedBull_Effect"); mStartTime = Time.timeSinceLevelLoad ; mMissTxr = (Texture2D)Resources.Load ("Effect/Text_Miss"); mGoodTxr = (Texture2D)Resources.Load ("Effect/Text_Good"); mPrftTxr = (Texture2D)Resources.Load ("Effect/Text_Perfect"); mSound = GameObject.Find ("Sound").gameObject.gameObject; mParTicle = GameObject.Find ("Particle System").gameObject.gameObject; mEffPosi = new Vector2(0, 0); mEffSize = new Vector2(0, 0); mEffPosiGood = new Vector2(0, 0); mSound.audio.Pause(); GameObject.Find ("UI Root/MyNick").GetComponent<TextMesh>().text = Ag.mySelf.mNick.ToUpper(); GameObject.Find ("UI Root/EnemyNIck").GetComponent<TextMesh>().text = Ag.myEnem.mNick.ToUpper(); mEventCoin = GameObject.Find("UI Root/GetCoin").gameObject; mMiniItem = GameObject.Find("UI Root/RandomBoxItem").gameObject; mMiniRandomEff = mMiniItem.transform.FindChild("skill01").gameObject; mMiniItem.SetActiveRecursively(false); mCoin100 = (Texture2D)Resources.Load ("TestItem/200coin"); mCoin50 = (Texture2D)Resources.Load ("TestItem/50coin"); mCoin20 = (Texture2D)Resources.Load ("TestItem/20coin"); mGameObj = GameObject.Find("RandomBox").gameObject; mGameObj2 = GameObject.Find("RandomBox2").gameObject; mItem = mGameObj.transform.FindChild("ItemBox1").gameObject; mBallItem = mGameObj.transform.FindChild("mkball1").gameObject; mParticle = mGameObj.transform.FindChild("mkball1/Particle1").gameObject; mDirUpeff = (GameObject)Resources.Load("Effect/DirUp"); mSkillUpeff = (GameObject)Resources.Load("Effect/SuperB"); //mMiniItem.SetActiveRecursively(false); mGameObj.SetActive(false); //mGameObj2.SetActive(false); GameObjectRndBox(false); //mEventBallEffect = GameObject.Find("UI Root/accfast").gameObject; #if UNITY_IPHONE mGuiCur = Ag.mgIsRetina? mGuiBig: mGuiSml; #endif #if UNITY_ANDROID mGuiCur = mGuiBig; #endif /* // Wagu.... float waguX = mSX * mPlayerInfoX, waguY = mSY * 0.1f, waguWid = mSX * 0.28f, waguHei = mSY * 0.15f; mWaguRec = new Rect( waguX, waguY, waguWid, waguHei ); // Player Picture.. depend on Wagu Size, and Position... float picX = waguWid * 0.05f, picY = waguHei * 0.3f, picWid = waguWid * 0.2f, picHei = waguHei * 0.6f; mPicRec = new Rect( waguX+picX, waguY+picY, picWid, picHei ); // Direction Bar float dirX = waguWid * 0.27f, dirY = waguHei * 0.6f, dirWid = waguWid * 0.7f, dirHei = waguHei * 0.3f; mDirRec = new Rect( waguX+dirX, waguY+dirY, dirWid, dirHei ); mEnemyBioRec = new Rect (waguX+dirX, waguY+picY, picWid, picHei * 0.45f ); */ /* mPlayerKicker.animation.Play ("cerlose01"); mPlayerKeeper.animation.Play ("CerKeeperA_L"); CerCam.animation.Play ("C_Keeper_Cer1_L"); //CerCam.animation.Play ("C_Kicker_DisC_R"); return; */ mPerfectNum = mMissNum = mPreMyWin = mPreEnWin = 0; Ag.mgStepSend = 1; Ag.LogNewScene("Game310_2", "Start"); //mStateCere = new StateArray(); mStateArr = new StateArray(); mStage = new AmStage(); mStage.arrTheState = mStateArr; SetStateArray(); // Set State Machine ...... SetArrTexture(); // Set Texture Array... mCerCamAxis.SetActiveRecursively(false); FieldChanged (false); }