public void MoveToImmune(Vector3 vPos, float fTime, bool bFaceToPos = true) { if (bFaceToPos) { mBodyIdent.LookAt(vPos); } moveToPos = vPos; iTween.MoveTo(this.gameObject, vPos, fTime); }
public void MoveToImmune(Vector3 vPos, bool bFaceToPos = true) { if (bFaceToPos && mBodyIdent) { mBodyIdent.LookAt(vPos); } Stop(); StopAllCoroutines(); iTween.Stop(); this.gameObject.transform.position = vPos; moveToPos = vPos; }
public bool MoveTo(NFGUID ident, Vector3 vTar, float fSpeed, bool bRun) { if (fSpeed <= 0.01f) { return(false); } if (mhtObject.ContainsKey(ident)) { GameObject xGameObject = (GameObject)mhtObject[ident]; NFHeroMotor xMotor = xGameObject.GetComponent <NFHeroMotor>(); NFBodyIdent xBodyIdent = xGameObject.GetComponent <NFBodyIdent>(); if (xMotor && xBodyIdent) { xBodyIdent.LookAt(vTar); xMotor.movement.Move(vTar - xGameObject.transform.position, Vector3.Distance(vTar, xGameObject.transform.position)); } } return(false); }