private void Update() { if (life.getLife() <= 0) { if (!isDieing) { isDieing = true; animation.Play("Anim_Death"); dieingSound.Play(); deathParticles.SetActive(true); Destroy(gameObject, animation.clip.length); } return; } if (navMeshAgent.isStopped) { state = StateAI.Attacking; if (!animation.isPlaying) { animation.Play("Anim_Attack"); playerLife.decreaseLife(attackPower * Time.deltaTime); attackSound.Play(); } } else { state = StateAI.Walking; if (!animation.isPlaying) { animation.Play("Anim_Run"); } } }
private void UpdateInformation() { //use it //state.regions[i].data.CalculateIncome(); - Доход провинции //state.army[i].GetUpkeep(); StateAI ai = state.stateAI; allBudgetText.text = ai.treasury.ToString(); }
public void SetState02(StateAI _state) { if (state02 != null) { state02.ExitAction(); } state02 = _state; state02.EntryAction(); }
public void SetState01(StateAI _state) { if (state01 != null) { state01.ExitAction(); } state01 = _state; state01.EntryAction(); }
public State() { regions = new List <Region>(); army = new List <Army>(); persons = new List <Person>(); ships = new List <Ship>(); regiments = new BaseRegiment[GameConst.MaxRegimentCount]; GameObject.Instantiate(PrefabHandler.TechnologyTree).InitializeTree(this); stateAI = new StateAI(this); stateAI.IncomeResources(new Treasury(500, 2000, 100, 100, 20)); GameTimer.AddListener(StateDecaSecondUpdate, this); }
void RunBrainStates() { currentState = FindState(stateName); if (currentState == null) { stateName = "Not running any state..."; stateDecision = "..."; return; } stateName = currentState.RunState(); stateDecision = currentState.currentDecision; }
void Start() { agent = GetComponent <Agent>(); animationController = GetComponent <AnimationController>(); agent.SetSpeed(character.speed); print("employeeData.construct " + employeeData.construct); if (employeeData.construct != "") { targetObject = GameObject.Find(employeeData.construct); } current_StateAI = AIAsset.instance.FindState(employeeData.stateAI); current_ActionAI = AIAsset.instance.FindAction(employeeData.actionAI); }
public AutoReasercher(StateAI state) { this.state = state; technologyTree = state.Data.technologyTree; }
public AutoPersonControl(StateAI stateAI) { state = stateAI; }
public static void UpdateWantToTrade(StateAI state, List <(float, ResourcesType)> sortList)
public AutoDiplomacy(StateAI stateAI) { state = stateAI; }
public AutoBuilder(StateAI state) { this.state = state; provinces = state.Data.regions; }
public AutoRegimentBuilder(StateAI aI) { (stateAI, RiskI, RiskII, RiskIII) = (aI, new HashSet <RegionProxi>(), new HashSet <RegionProxi>(), new HashSet <RegionProxi>()); //CreateTemplates(); }
public void TransitionToState(StateAI new_StateAI) { current_StateAI = new_StateAI; }