private void Awake() { move = GetComponent <Animator>(); playerBase = gameObject.GetComponent <Player_Base>(); rigidbody2d = transform.GetComponent <Rigidbody2D>(); boxCollider2d = transform.GetComponent <BoxCollider2D>(); }
IEnumerator DropGunTimer() { yield return(new WaitForSeconds(1.3f)); player = null; gunSlot = null; }
void OnTriggerEnter(Collider coll) { if (coll.tag == "Player" && player == null) { Debug.Log("Collided with: " + coll.name); Player_Base _player = coll.GetComponent <Player_Base>(); if (_player != null) { GunSlot_Base _gunSlot = _player.GunSlot; if (_gunSlot != null && _gunSlot.TryPickup(this)) { player = _player; gunSlot = _gunSlot; gameObject.transform.parent = _gunSlot.transform; Destroy(GetComponent <Rigidbody>()); enabled = true; Collider[] colliders = GetComponents <Collider>(); foreach (Collider c in colliders) { c.enabled = false; } transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.Euler(0, 180, 0); AlignGun(); } } } }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); playerRigidbody2D = gameObject.GetComponent <Rigidbody2D>(); SetStateNormal(); health = 4; }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); material = transform.Find("Body").GetComponent <MeshRenderer>().material; materialTintColor = new Color(1, 0, 0, 0); SetStateNormal(); }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); rigidbody2d = transform.GetComponent <Rigidbody2D>(); boxCollider2d = transform.GetComponent <BoxCollider2D>(); isDead = false; }
void Start() { m_pPlayerReference = ImportantObjectsManager.Player.GetComponent <Player_Base>(); //m_pSliderReference = GetComponent<UISlider>(); m_iCooldownTimerID = sm_lProgressBars.Count; //AddCooldownProgressBar(this); }
void StartVaribles() { player_base = GetComponent <Player_Base>(); p_control = GetComponent <PlayerController>(); reached_enemy = false; state = State.Busy; encounter = false; timer = 0; }
private void Awake() { characterAimBase = GetComponent <CharacterAim_Base>(); playerAim = GetComponent <PlayerAim>(); playerBase = GetComponent <Player_Base>(); playerPunch = GetComponent <PlayerPunch>(); playerBase.enabled = false; playerPunch.enabled = false; }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); material = transform.Find("Body").GetComponent <MeshRenderer>().material; materialTintColor = new Color(1, 0, 0, 0); selectionCircleTransform = transform.Find("SelectionCircle"); attackUnitAnimType = GameAssets.UnitAnimTypeEnum.dSwordTwoHandedBack_Sword; HideSelectionCircle(); SetStateIdle(); }
private void Awake() { Instance = this; playerBase = GetComponent <Player_Base>(); playerPunch = GetComponent <PlayerPunch>(); playerSword = GetComponent <PlayerSword>(); playerBase.enabled = true; playerPunch.enabled = false; playerSword.enabled = false; healthPotionAmount = 1; }
private void Awake() { characterAimBase = GetComponent <CharacterAim_Base>(); playerAim = GetComponent <PlayerAim>(); playerBase = GetComponent <Player_Base>(); playerPunch = GetComponent <PlayerPunch>(); playerSword = GetComponent <PlayerSword>(); playerBase.enabled = false; playerPunch.enabled = false; playerSword.enabled = false; characterAimBase.OnShoot += CharacterAimBase_OnShoot; }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); rigidbody2d = transform.GetComponent <Rigidbody2D>(); boxCollider2d = transform.GetComponent <BoxCollider2D>(); waitForStart = true; isDead = false; Application.runInBackground = true; //allows unity to update when not in focus //************* Instantiate the OSC Handler... OSCHandler.Instance.Init(); //OSCReciever.Open(8001); OSCHandler.Instance.SendMessageToClient("pd", "/unity/music", 1); }
void FindGunSlotAndPlayer() { Transform parent = transform.parent; if (parent == null) { enabled = false; return; } GunSlot weaponSlot = parent.GetComponent <GunSlot>(); if (weaponSlot != null) { this.gunSlot = weaponSlot; Player player = weaponSlot.Player; if (player != null) { this.player = player; } } }
void Awake() { player_base = GetComponent <Player_Base>(); m_Collider = GameObject.FindGameObjectWithTag("encounter_Spawn").GetComponent <BoxCollider2D>(); }
private void Awake() { playerBase = gameObject.GetComponent <Player_Base>(); }
private void Awake() { playerBase = gameObject.GetComponent <Player_Base>(); rigidbody2D = transform.GetComponent <Rigidbody2D>(); boxCollider2D = transform.GetComponent <BoxCollider2D>(); }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); SetStateNormal(); }
private void Awake() { // 'private void Awake' is a private variable that makes the equipping, player objects, and materials move into action // playerBase = gameObject.GetComponent<Player_Base>(); // To initiate the playerBase, you need to initiate the component that holds the variable using gameObject.GetComponent<Player_Base> // material = transform.Find("Body").GetComponent<MeshRenderer>().material; // To make sure all materials work in correlation to the body of the player, you need to initiate the MeshRenderer that holds the component of the moving materials // materialTintColor = new Color(1, 0, 0, 0); // To make sure the TintColor variable is activated, you must pinpoint all the colors // SetEquip(Equip.None); // The SetEquip variable is meant to set up the equipping action of the game, at which the player wears the material assets such as Helmet1 and Helmet2 // }
public void SetPlayer(Player_Base player) { this.player = player; }