/// <inheritdoc /> private void Start() { InteractControl = Resources.Load <Control>("Managers/InputManager/Interact"); CurrentDialogueReference = Resources.Load <CurrentDialogue>("DialogueSystem/CurrentDialogue"); paramsInstance = new QuestNpcParams() { NpcTransform = transform, Npc = this, NavAgent = GetComponent <NavMeshAgent>(), Animator = GetComponent <Animator>(), OriginPosistion = transform.position, MovementType = Options.MovementType, WanderDistance = Options.WanderDistance, IdleTime = Options.IdleTime, TimeLeftIdle = Options.IdleTime, PatrolPoints = Options.PatrolPoints, CurrentPatrolPoint = Options.StartingPatrolPoint, Player = FindObjectOfType <PlayerController>(), Dialogue = Options.Dialogue }; stateMachine = new UStateMachine <QuestNpcParams>(paramsInstance, new Conversing(), new Idle(), new Move()); stateMachine.SetState(typeof(Idle), paramsInstance); _manipulationType = Manipulations.Normal; paramsInstance.NavAgent.speed = paramsInstance.MovementSpeed * TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier; paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier; }
private void Start() { Setup(); DeathSound = Options.DeathSound; GetAudioQueue(); paramsInstance = new ShootingAIParams() { NpcTransform = transform, Npc = this, NavAgent = GetComponent <NavMeshAgent>(), Animator = GetComponent <Animator>(), OriginPosistion = transform.position, MovementType = Options.MovementType, WanderDistance = Options.WanderDistance, IdleTime = Options.IdleTime, TimeLeftIdle = Options.IdleTime, PatrolPoints = Options.PatrolPoints, CurrentPatrolPoint = Options.StartingPatorlPoint, Player = FindObjectOfType <PlayerController>(), AggroDistance = Options.AggroDistance, LoseAggroDistance = Options.LoseAggroDistance, RigidBody = GetComponent <Rigidbody>(), MovementSpeed = Options.MovementSpeed, TimeBetweenAttacks = Options.TimeBetweenAttacks, BulletPrefab = Options.BulletPrefab, ShootDelay = Options.ShootDelay, Renderer = Renderer, Chase = Options.Chase, ChaseDistance = Options.ChaseDistance, ShootingSound = Options.ShootingSound, DeathSound = Options.DeathSound }; stateMachine = new UStateMachine <ShootingAIParams>(paramsInstance, new Chase(), new Attacking(), new Idle(), new Move()); stateMachine.SetState(typeof(Idle), paramsInstance); _manipulationType = Manipulations.Normal; paramsInstance.NavAgent.speed = paramsInstance.MovementSpeed * TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier; paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier; //paramsInstance.MovementModifier = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier; _localTimeScale = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.PhysicsModifier; }