public MdChubang(MdIntObj pFobj, MdIntObj pLobj) { mFvr = new VecRot (); mLvr = new VecRot (); mHonVr = new VecRot (); mHTarVr = new VecRot (); mFff = pFobj.GetFff (); mLff = pLobj.GetFff (); //(" New Chu bang ::: " + mFff + ", " + mLff).HtLog (); }
public MdChubang(MdIntObj pFobj, MdIntObj pLobj) { mFvr = new VecRot(); mLvr = new VecRot(); mHonVr = new VecRot(); mHTarVr = new VecRot(); mFff = pFobj.GetFff(); mLff = pLobj.GetFff(); //(" New Chu bang ::: " + mFff + ", " + mLff).HtLog (); }
VecRot NewObjectFromMyself(float pXdiff, float pYdiff) { VecRot rVal = new VecRot(); rVal.Ae = Ae.MoveXYZ(pXdiff, pYdiff, 0); rVal.Kugi = Kugi; rVal.Dora = Dora; //(" NewObjectFromMyself Kugi " + rVal.Kugi.ToString ()).HtLog (); return(rVal); }
public static void SetJinsimAeDora(this Transform pTarget, Transform pParen, VecRot pVr, bool pKugi = false) { pTarget.position = pParen.position + pVr.Ae; pTarget.Rotate(pVr.Dora); if (pKugi) { pTarget.localScale = pParen.localScale.ApplyKugi(pVr.Kugi); } else { pTarget.localScale = pVr.Kugi; } }
void Start() { rb = GetComponent <Rigidbody>(); TimeLapse tl = new TimeLapse(); tl.obj = gameObject; tl.nextLapse = 0; tl.currentLapse = 0; tl.timeArray = new List <VecRot>(); VecRot a = new VecRot(); a.pos = tl.obj.transform.position; a.rot = tl.obj.transform.rotation; tl.timeArray.Add(a); ShootTest.lapses.Add(tl); }
public static void SetTarget(this GameObject pTar, VecRot pVrObj) { pTar.GetComponent<HtIndvBase> ().SetTarget (pVrObj); }
// //////////////////////////////////////////////// //////////////////////// this is >>> GameObject <<< related ... // //////////////////////////////////////////////// this is >>> Transform <<< related ... public static void SetAeDora(this Transform pTarget, VecRot pVr) { pTarget.position = pVr.Ae; pTarget.Rotate(pVr.Dora); }
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"); }
public void SetTarget(VecRot pTarVr) { mTarget = pTarVr; }
public void SetTarget(Vector3 pAe) { mTarget = new VecRot (pAe.x, pAe.y, pAe.z); }
VecRot NewObjectFromMyself(float pXdiff, float pYdiff) { VecRot rVal = new VecRot (); rVal.Ae = Ae.MoveXYZ (pXdiff, pYdiff, 0); rVal.Kugi = Kugi; rVal.Dora = Dora; //(" NewObjectFromMyself Kugi " + rVal.Kugi.ToString ()).HtLog (); return rVal; }
public void SetTarget(Vector3 pAe) { mTarget = new VecRot(pAe.x, pAe.y, pAe.z); }
public static void SetJinsimAeDora(this Transform pTarget, Transform pParen, VecRot pVr, bool pKugi = false) { pTarget.position = pParen.position + pVr.Ae; pTarget.Rotate(pVr.Dora); if (pKugi) pTarget.localScale = pParen.localScale.ApplyKugi (pVr.Kugi); else pTarget.localScale = pVr.Kugi; }
public static void SetTarget(this GameObject pTar, VecRot pVrObj) { pTar.GetComponent <HtIndvBase> ().SetTarget(pVrObj); }
// Eye Related ... public VecRot GetEyeTargetFromHon() { //(" VecRot :: GetEyeTargetFromHon " + mObjName + " , mNum : " + mNum ).HtLog(); if (mObjName == "EyeSingle") { if (mNum < 1) { mNum++; return(this); } else { mNum = 0; return(null); } } if (mObjName == "EyeDouble") { if (mNum < 2) { VecRot rVal; if (mNum == 0) { rVal = NewObjectFromMyself(-0.2f, 0); } else { rVal = NewObjectFromMyself(0.2f, 0); } mNum++; return(rVal); } else { mNum = 0; return(null); } } if (mObjName == "EyeTriple") { if (mNum < 3) { VecRot rVal = null; if (mNum == 0) { rVal = NewObjectFromMyself(-0.2f, 0); } if (mNum == 1) { rVal = NewObjectFromMyself(0.2f, 0); } if (mNum == 2) { rVal = NewObjectFromMyself(0, 0.2f); } mNum++; return(rVal); } else { mNum = 0; return(null); } } return(null); }
void Update() { if (!recalling && Input.GetKeyUp(KeyCode.R)) { recalling = true; nextLapse = Time.time + 5; } if (recalling) { for (int i = 0; i < lapses.Count; i++) { TimeLapse lapse = lapses[i]; lapse.obj.GetComponent <Rigidbody>().isKinematic = true; lapse.obj.GetComponent <Rigidbody>().velocity = Vector3.zero; lapse.obj.transform.position = Vector3.MoveTowards(lapse.obj.transform.position, lapse.timeArray[lapse.currentLapse].pos, 0.01f); lapse.obj.transform.rotation = Quaternion.Lerp(lapse.obj.transform.rotation, lapse.timeArray[lapse.currentLapse].rot, 0.01f); if (Vector3.Distance(lapse.obj.transform.position, lapse.timeArray[lapse.currentLapse].pos) < 1) { lapse.currentLapse = lapse.currentLapse + 1; } if (lapse.currentLapse > (lapse.timeArray.Count - 1)) { lapse.nextLapse = 0; lapse.currentLapse = 0; lapse.timeArray.Clear(); VecRot a = new VecRot(); a.pos = lapse.obj.transform.position; a.rot = lapse.obj.transform.rotation; lapse.timeArray.Add(a); lapse.obj.GetComponent <Rigidbody>().isKinematic = false; } } if (Time.time >= nextLapse) { for (int i = 0; i < lapses.Count; i++) { TimeLapse lapse = lapses[i]; lapse.nextLapse = 0; lapse.currentLapse = 0; lapse.timeArray.Clear(); VecRot a = new VecRot(); a.pos = lapse.obj.transform.position; a.rot = lapse.obj.transform.rotation; lapse.timeArray.Add(a); lapse.obj.GetComponent <Rigidbody>().isKinematic = false; } recalling = false; } } else { if (Input.GetKeyUp(KeyCode.Space)) { GameObject t = Instantiate(ball, transform.position, transform.rotation, null); t.transform.LookAt(towards); t.GetComponent <Rigidbody>().AddForce(transform.forward * speed, ForceMode.Impulse); } Quaternion q = transform.rotation; if (Input.GetKey(KeyCode.A)) { q.eulerAngles = new Vector3(q.x, q.eulerAngles.y - 0.1f, q.z); } else if (Input.GetKey(KeyCode.D)) { q.eulerAngles = new Vector3(q.x, q.eulerAngles.y + 0.1f, q.z); } transform.rotation = q; if (Time.time >= nextLapse) { nextLapse = Time.time + 1; foreach (TimeLapse lapse in lapses) { VecRot a = new VecRot(); a.pos = lapse.obj.transform.position; a.rot = lapse.obj.transform.rotation; lapse.timeArray.Add(a); Debug.Log(lapse.obj + " Added lapse. " + lapse.timeArray.Count); } } } }