// Start is called before the first frame update void Start() { gun = this.gameObject.GetComponent <Gun>(); controller = this.gameObject.GetComponent <BasicPlayerController>(); health = this.gameObject.GetComponent <ActorHealth>(); damageText.text = "Damage: " + gun.damage; firedelayText.text = "Fire Delay: " + gun.shotCooldown; speedText.text = "Speed: " + controller.movementSpeed; healthText.text = "Health: " + health.currentHealth; }
private void Awake() { playerController = FindObjectOfType <BasicPlayerController>(); for (int i = 0; i < transform.childCount; i++) { oldColor = transform.GetChild(i).GetComponent <Renderer>().material.color; } oldSpinDegrees = spinDegrees; startRot = transform.rotation; }
private void OnTriggerEnter(Collider other) { BasicPlayerController player = other.GetComponent <BasicPlayerController>(); if (player != null) { pickedUp = true; if (this.gameObject.tag == "Ice") { foreach (NewPatrollingEnemy badguy in enemy) { badguy.GetComponent <NewPatrollingEnemy>().frozeTime = 5f; } foreach (MovingPlatforms platform in movers) { platform.GetComponent <MovingPlatforms>().freezeTime = 2.5f; } foreach (RotationSystem spinner in spinners) { spinner.GetComponent <RotationSystem>().frozenTime = 2.5f; } foreach (TurretWeapon turret in turrets) { turret.GetComponent <TurretWeapon>().freezeTurret = 5f; } } if (gameObject.tag == "Speed") { other.GetComponent <BasicPlayerController>().pickupTimer = 5f; } if (gameObject.CompareTag("ExtraJump")) { //other.GetComponent<NewJumpForMasters>().amountJumps += 1; other.GetComponent <BasicPlayerController>().jumpAmout += 1; other.GetComponent <BasicPlayerController>().prevJumpAmount += 1; other.GetComponent <BasicPlayerController>().prevJumpAmount = other.GetComponent <BasicPlayerController>().jumpAmout; } if (gameObject.tag == ("Health")) { other.GetComponent <PlayerHeath>().NewHealth(); Debug.Log("GotHealth"); other.GetComponent <PlayerHeath>().UpdateBar(); } } }
// Start is called before the first frame update void Start() { controller = this.gameObject.GetComponent <BasicPlayerController>(); player = GameObject.FindWithTag("Player"); gun = this.gameObject.GetComponent <Gun>(); body = this.gameObject.GetComponent <Rigidbody>(); image = this.gameObject.GetComponent <SpriteRenderer>(); moveDirection = Vector2.zero; //StartCoroutine(Attack()); ChangeMovement(); }
private void Awake() { player = FindObjectOfType <BasicPlayerController>(); oldColor = playerColor; transform.position = patrolPoints[0].position; for (int i = 0; i < transform.childCount; i++) { oldColor = transform.GetChild(i).GetComponent <Renderer>().material.color; } if (this.gameObject.GetComponent <Renderer>() != null) { oldColor = GetComponent <Renderer>().material.color; } oldSpeed = patrolSpeed; }