// Run from the player, also plays sound at this point. public void Run() { mMover.mCanUsePath = false; // if we're not already charging, set our state to charging if (!mIsFleeing) { string[] args = new string[] { "Grunt", "Cower" }; AUD_Manager.DynamicDialogue("VO_Negatives_E", args, gameObject); mAnim.mState = AnimState.FLEEING; mIsFleeing = true; mTimeStartedFlee = Time.time; // set the goal to somewhere behind the player. Vector3 dir = transform.position - mEntity.mPlayerTrans.Value.position; dir.y = 0f; Vector3 spot = transform.position + Vector3.Normalize(dir) * 100f; mEntity.mGoalPos = spot; } mEntity.mCurMaxVel = mEntity.GetBase().mMaxSpd * 1.2f; mRigid.rotation = mOrienter.OrientToDirection(mRigid.velocity); // handle if the flee state has finished. if (Time.time - mTimeStartedFlee > mEntity.GetBase().mFleeTime.Value) { mMover.mCanUsePath = true; mIsFleeing = false; mCanFlee = false; Invoke("CanFlee", 0.2f); mAnim.mState = AnimState.IDLE; } }
// of course, we actually need to play the specific whine for this particular enemy. public void GetHitByGrenade() { // here we check if we have a shield, and just return it if true. if (GetComponentInChildren <EnemyForceField>() != null) { Debug.Log("Shield in way"); return; } mGrenadedLogic.mTimeHitGrenade = Time.time; mOwner.mStateChange = STATE.GRENADED; string[] args = new string[] { sType, "GrossOut" }; AUD_Manager.DynamicDialogue("VO_Negatives_E", args, gameObject); mStunParticles.Activate(); }
public void OnObjectPickedUp(object data) { ThrowableObject obj = (ThrowableObject)data; if (obj != null) { // now here we find out if it's small, medium, or large switch (obj.properties.objSize) { case "Small": mArgs[1] = "PickupSmall"; break; case "Medium": mArgs[1] = "PickupMedium"; break; case "Large": mArgs[1] = "PickupLarge"; break; } AUD_Manager.DynamicDialogue(mEvent, mArgs, gameObject); } }
public void PostYourself() { AUD_Manager.DynamicDialogue(mEventName, mArgs, gameObject); }