// Use this for initialization void Start() { mainCamera = Camera.main.transform; inputManager = FindObjectOfType <InputManager>(); //cameraControl = mainCamera.GetComponent<SpringCamera>(); cameraControl = FindObjectOfType <SpringCamera>(); rb = GetComponent <Rigidbody>(); repulsor = GetComponent <Repulsor>(); gameManager = FindObjectOfType <GameManager>(); audioSource = GetComponent <AudioSource>(); //impactInfoManager = FindObjectOfType<ImpactInfoManager>(); bulletPool = FindObjectOfType <BulletPool>(); // TODO: No hacerlo tan hardcodeado bulletPool.RegisterBullets(elipticProyectilePrefab, 30, 10); // PlayerReference.Initiate(gameObject); // lastAxisXZ = Vector3.forward; // proyectileToUse = elipticProyectilePrefab; proyectileRb = proyectileToUse.GetComponent <Rigidbody>(); PlayerReference.currentProyectileRB = proyectileRb; // Recordar que la masa va en gramos (de momento) currentMuzzleSpeed = gameManager.playerAttributes.forcePerSecond.CurrentValue / (gameManager.playerAttributes.massPerSecond / 1000); // Debug.Log("Muzzle speed :" + currentMuzzleSpeed); }
// Use this for initialization void Start() { rep = transform.parent.gameObject.GetComponent<Repulsor>(); if(rep.isGravityPlane){ //transform.localScale = transform.parent.localScale/10f; transform.localScale = new Vector3(1,1,1); particleSystem.emissionRate = transform.parent.localScale.x * transform.parent.localScale.y * transform.parent.localScale.z * 10; } }
void Awake() { //player = GameObject.Find("Monster Token"); player = FindObjectOfType <PlayerController>().GetComponent <CharMotor>(); audio = FindObjectOfType <stealthSounds>().GetComponent <stealthSounds>(); Mtr = GetComponent <CharMotor>(); Anim = GetComponentInChildren <Animation>(); Vis = GetComponentInChildren <Vision>(); Rep = GetComponent <Repulsor>(); LnRndr = GetComponentInChildren <LineRenderer>(); Vis.Recv = this; MaxVisRange = Mathf.Max(MaxVisRange, Vis.Radius); }
protected void Start() { if(WavMn == null) WavMn = FindObjectOfType<WaveMan>(); WavMn.enemySpawned(); Speed = SpeedWander; base.Start(); //Target = FindObjectOfType<PlayerController>().Motor; Rep = GetComponent<Repulsor>(); Vis = GetComponentInChildren<Vision>(); Vis.Recv = this; targetWP(); }
protected void Start() { if (WavMn == null) { WavMn = FindObjectOfType <WaveMan>(); } WavMn.enemySpawned(); Speed = SpeedWander; base.Start(); //Target = FindObjectOfType<PlayerController>().Motor; Rep = GetComponent <Repulsor>(); Vis = GetComponentInChildren <Vision>(); Vis.Recv = this; targetWP(); }
//Attributes //Methods public override void Initialize(StateMachine owner) { this.owner = (Repulsor)owner; }