Exemple #1
0
 /// <inheritdoc />
 public override void Init(PlayerController pc)
 {
     Type            = PowerTypes.Dash;
     _inputRotation  = Resources.Load <ScriptableObjectQuartenion>("Player/InputRotation");
     AudioQueue      = Resources.Load <AudioQueue>("Managers/Audio/AudioQueue");
     _playerInfo     = Resources.Load <PlayerInfo>("Player/DefaultPlayerInfo");
     _particleSystem = Instantiate(ParticleSystem, pc.transform).GetComponent <ParticleSystem>();
     _particleSystem.transform.localPosition = Vector3.zero;
     _particleSystem.Stop();
 }
Exemple #2
0
        private void Start()
        {
            XMovementControl = Resources.Load <AxisControl>("Managers/InputManager/XMovement");
            YMovementControl = Resources.Load <AxisControl>("Managers/InputManager/YMovement");
            Rbody            = GetComponent <Rigidbody>();
            Animator         = GetComponentInChildren <Animator>();
            Agent            = GetComponent <NavMeshAgent>();
            PlayerInfo       = Resources.Load <PlayerInfo>("Player/DefaultPlayerInfo");
            InputRotation    = Resources.Load <ScriptableObjectQuartenion>("Player/InputRotation");

            var spawnPoint = GameObject.Find("SPAWN_POINT");

            if (spawnPoint != null)
            {
                NavMeshHit spawnPointSample;
                NavMesh.SamplePosition(spawnPoint.transform.position, out spawnPointSample, 3.0f, NavMesh.AllAreas);
                Agent.Warp(spawnPointSample.position);
            }
        }