public void GoHome(Direction dir) { currentState = RGState.GO_HOME; movement.GoToDirection(dir); TurnOffAllArrow(); raycasting = false; }
public void ForceDizzy() { dizzyAnimTimeCount = 0; movement.Run(); GetDizzyFX(transform.position + Vector3.up * 1.2f); currentState = RGState.DIZZY; PlayAnim(RGState.DIZZY); }
public void PlayAnim(RGState _currentState) { switch (_currentState) { case RGState.DIZZY: Anim.ResetTrigger("Stun"); Anim.ResetTrigger("Walk"); Anim.ResetTrigger("Idle"); Anim.ResetTrigger("Dizzy_Anim"); Anim.SetTrigger("Dizzy"); break; case RGState.DIZZY_ANIM: Anim.ResetTrigger("Walk"); Anim.ResetTrigger("StepFall"); Anim.SetTrigger("Dizzy_Anim"); break; case RGState.FALLING: Anim.ResetTrigger("Walk"); Anim.ResetTrigger("Dizzy"); Anim.SetTrigger("StepFall"); break; case RGState.FELL: Anim.ResetTrigger("StepFall"); Anim.SetTrigger("Fall"); break; case RGState.HIT: Anim.ResetTrigger("Dizzy"); Anim.ResetTrigger("Idle"); Anim.ResetTrigger("Walk"); Anim.SetTrigger("Stun"); break; case RGState.START: Anim.SetTrigger("Idle"); break; case RGState.WAIT: Anim.ResetTrigger("Dizzy_Anim"); Anim.ResetTrigger("Walk"); Anim.ResetTrigger("StepFall"); Anim.ResetTrigger("Dizzy"); Anim.SetTrigger("Idle"); break; case RGState.WALK: Anim.ResetTrigger("Stun"); Anim.ResetTrigger("Idle"); Anim.ResetTrigger("Dizzy"); Anim.ResetTrigger("StepFall"); Anim.SetTrigger("Walk"); break; } }
private void chkState_CheckedChanged(object sender, EventArgs e) { RGState.SetEditValue(null); if (chkState.Checked == true) { RGState.Enabled = true; } else { RGState.Enabled = false; } }
public void GPS(Vector3 position) { if (currentState != AI.RGState.GPS) { currentState = AI.RGState.GPS; } raycasting = false; GetGPSFX(transform.position + Vector3.up / 2); movement.GPS(); movement.FollowPath(position); ResetTimer(); }
public void Reset() { StopAllCoroutines(); isDead = false; currentState = RGState.START; cd = GetComponentInChildren <Image>(); _color = cd.color; cd.enabled = false; TurnOffAllArrow(); movement.enabled = true; movement.Run(); transform.localScale = Vector3.one; // ("RotateMesh",1); }
void Falling() { if (lastFallDirection != Direction.NONE && lastFallDirection != movement.direction) { return; } if (currentState == RGState.FALLING || currentState == RGState.FELL || currentState == RGState.HIT) { return; } else { lastFallDirection = movement.direction; currentState = RGState.FALLING; } movement.Stop(); }
void OnHit() { if (currentState != RGState.HIT) { currentState = RGState.HIT; } else { return; } Vector3 pos = transform.position + Vector3.up * 1.5f; GetStunFX(pos); AudioManager_RG.instance.PlayClip(AudioManager_RG.SoundFX.Stun, transform.position); movement.Stop(); raycasting = false; ResetTimer(); }
public void Dizzy() { if (currentState == RGState.DIZZY || currentState == RGState.START || currentState == RGState.HIT) { return; } if (currentState != RGState.DIZZY_ANIM) { currentState = RGState.DIZZY_ANIM; } else { return; } movement.Reverse(); movement.Stop(); ResetTimer(); }
void WalkBack() { if (Tutorial.instance != null) { if (Tutorial.instance.CurrentTutorial == 3) { movement.Reverse(); ForceDizzy(); Invoke("DelayRaycast", .1f); return; } } Anim.ResetTrigger("Stun"); Anim.ResetTrigger("Dizzy"); movement.Reverse(); currentState = RGState.WALK; Invoke("DelayRaycast", .1f); ResetTimer(); }
public void Wait() { currentState = RGState.WAIT; movement.Stop(); raycasting = false; }
public void WalkToDirection(Direction dir) { currentState = RGState.WALK; movement.GoToDirection(dir); ResetTimer(); }
public void Walk() { currentState = RGState.WALK; movement.GoToDirection(movement.direction); ResetTimer(); }
// void Wait() // { // currentState = RGState.WAIT; // movement.Stop (); // // ResetTimer (); // } void StopWait() { currentState = RGState.WALK; movement.Run(); }
void Fell() { currentState = RGState.FELL; movement.enabled = false; isDead = true; }
// Update is called once per frame void Update() { PlayAnim(currentState); if (currentState != RGState.DIZZY) { if (dizzyFX != null) { dizzyFX.transform.SetParent(null); dizzyFX.Destroy(); } } if (isDead) { return; } if (currentState == RGState.GPS) { movement.speed = WorldStates.instance.speed * 2; } if (currentState == RGState.FALLING) { fallTimeCount += Time.deltaTime; cd.enabled = true; cd.fillAmount = 1 - fallTimeCount / fallTime; _color.g = 1 - fallTimeCount / fallTime; cd.color = _color; if (fallTimeCount > fallTime) { Fell(); fallTimeCount = 0; } } else { cd.color = new Color(1, 1, 0); cd.enabled = false; } if (currentState == RGState.HIT) { hitTimeCount += Time.deltaTime; if (hitTimeCount > hitTime) { hitTimeCount = 0; WalkBack(); } } if (currentState == RGState.START) { transform.localScale = Vector3.one; raycasting = false; if (transform.position.y > 0) { transform.position += new Vector3(0, -Time.deltaTime * 3, 0); } else { if (!WorldStates.instance.isTut) { GetFallFX(transform.position + Vector3.up * 0.5f); raycasting = true; Walk(); } else { Walk(); //movement.Stop (); raycasting = true; } } } if (currentState == RGState.DIZZY_ANIM) { dizzyAnimTimeCount += Time.deltaTime; // if roller is not active, reset its position if (!roller.gameObject.activeInHierarchy) { roller.gameObject.SetActive(true); roller.localPosition = new Vector3(0, -0.5f, 0); } // move roller to position if (roller.localPosition != Vector3.zero) { roller.localPosition = Vector3.MoveTowards(roller.localPosition, Vector3.zero, 1.5f * Time.deltaTime); } // keep spinning it roller.localEulerAngles += new Vector3(0, 400, 0) * Time.deltaTime; movement.mesh.localEulerAngles += new Vector3(0, 600, 0) * Time.deltaTime; // Once anim dizzy is completed, get to dizzy state if (dizzyAnimTimeCount > dizzyAnimTime) { dizzyAnimTimeCount = 0; movement.Run(); GetDizzyFX(transform.position + Vector3.up * 1.2f); currentState = RGState.DIZZY; } } // allow dizzy to manually rotate mesh if (currentState == RGState.DIZZY_ANIM) { movement.rotateToTarget = false; roller.gameObject.SetActive(true); } else { movement.rotateToTarget = true; roller.gameObject.SetActive(false); } if (currentState == RGState.DIZZY) { dizzyTimeCount += Time.deltaTime; if (dizzyTimeCount > dizzyTime) { dizzyTimeCount = 0; Walk(); } } if (currentState != RGState.DIZZY_ANIM && raycasting) { isOutOfBound(); RaycastAI(); RaycastCenter(); } }
private void frmFilter_Load(object sender, EventArgs e) { FillEnquiry(); if (m_dtFilter.Rows.Count > 0) { if (m_dtFilter.Rows[0]["i_AptId"].ToString() != "") { chkApt.Checked = true; RGApt.SetEditValue(m_dtFilter.Rows[0]["i_AptId"].ToString()); } if (m_dtFilter.Rows[0]["i_AptSizeId"].ToString() != "") { chkAptSize.Checked = true; RGAptSize.SetEditValue(m_dtFilter.Rows[0]["i_AptSizeId"].ToString()); } if (m_dtFilter.Rows[0]["i_AptTypeId"].ToString() != "") { chkAptType.Checked = true; RGAptType.SetEditValue(m_dtFilter.Rows[0]["i_AptTypeId"].ToString()); } if (m_dtFilter.Rows[0]["i_AreaId"].ToString() != "") { chkArea.Checked = true; RGArea.SetEditValue(m_dtFilter.Rows[0]["i_AreaId"].ToString()); } if (m_dtFilter.Rows[0]["i_BuyerId"].ToString() != "") { chkBuyer.Checked = true; RGBuyer.SetEditValue(m_dtFilter.Rows[0]["i_BuyerId"].ToString()); } if (m_dtFilter.Rows[0]["s_City"].ToString() != "") { chkCity.Checked = true; RGCity.SetEditValue(m_dtFilter.Rows[0]["s_City"].ToString()); } if (m_dtFilter.Rows[0]["i_CostPrefId"].ToString() != "") { chkCostPre.Checked = true; RGCostPre.SetEditValue(m_dtFilter.Rows[0]["i_CostPrefId"].ToString()); } if (m_dtFilter.Rows[0]["i_CountryId"].ToString() != "") { chkCountry.Checked = true; RGCountry.SetEditValue(m_dtFilter.Rows[0]["i_CountryId"].ToString()); } if (m_dtFilter.Rows[0]["i_EmpId"].ToString() != "") { chkEmp.Checked = true; RGEmpStatus.SetEditValue(m_dtFilter.Rows[0]["i_EmpId"].ToString()); } if (m_dtFilter.Rows[0]["i_ExeId"].ToString() != "") { chkExe.Checked = true; RGExe.SetEditValue(m_dtFilter.Rows[0]["i_ExeId"].ToString()); } if (m_dtFilter.Rows[0]["i_FacId"].ToString() != "") { chkFac.Checked = true; RGFac.SetEditValue(m_dtFilter.Rows[0]["i_FacId"].ToString()); } if (m_dtFilter.Rows[0]["i_GuestHouId"].ToString() != "") { chkGuestHou.Checked = true; RGGuestHou.SetEditValue(m_dtFilter.Rows[0]["i_GuestHouId"].ToString()); } if (m_dtFilter.Rows[0]["s_Nat"].ToString() != "") { chkNat.Checked = true; RGNationality.EditValue = m_dtFilter.Rows[0]["s_Nat"].ToString(); } if (m_dtFilter.Rows[0]["i_PossId"].ToString() != "") { chkPoss.Checked = true; RGPoss.SetEditValue(m_dtFilter.Rows[0]["i_PossId"].ToString()); } if (m_dtFilter.Rows[0]["s_Prof"].ToString() != "") { chkProfession.Checked = true; RGProfession.EditValue = m_dtFilter.Rows[0]["s_Prof"].ToString(); } if (m_dtFilter.Rows[0]["i_ProjId"].ToString() != "") { chkProj.Checked = true; RGProj.SetEditValue(m_dtFilter.Rows[0]["i_ProjId"].ToString()); } if (m_dtFilter.Rows[0]["i_ReligionId"].ToString() != "") { chkReligion.Checked = true; RGReligion.SetEditValue(m_dtFilter.Rows[0]["i_ReligionId"].ToString()); } if (m_dtFilter.Rows[0]["s_State"].ToString() != "") { chkState.Checked = true; RGState.SetEditValue(m_dtFilter.Rows[0]["s_State"].ToString()); } if (m_dtFilter.Rows[0]["i_StayId"].ToString() != "") { chkStay.Checked = true; RGStay.SetEditValue(m_dtFilter.Rows[0]["i_StayId"].ToString()); } if (m_dtFilter.Rows[0]["i_SubSourId"].ToString() != "") { chkSubSou.Checked = true; RGSubSou.SetEditValue(m_dtFilter.Rows[0]["i_SubSourId"].ToString()); } if (m_dtFilter.Rows[0]["i_IncomeId"].ToString() != "") { chkYearlyInc.Checked = true; RGYearlyIncome.SetEditValue(m_dtFilter.Rows[0]["i_IncomeId"].ToString()); } if (m_dtFilter.Rows[0]["i_FinId"].ToString() != "") { chkFin.Checked = true; RGFinance.SetEditValue(m_dtFilter.Rows[0]["i_FinId"].ToString()); } if (m_dtFilter.Rows[0]["i_MaritalId"].ToString() != "") { chkMaritalS.Checked = true; RGMaritalSta.SetEditValue(m_dtFilter.Rows[0]["i_MaritalId"].ToString()); } } }