private void SetRefrences() { inventoryManager = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>(); eventSystem = this.GetComponent <EventSystem>(); gRaycaster = canvas.GetComponent <GraphicRaycaster>(); equipmentManager = GameObject.FindGameObjectWithTag("Player").GetComponent <Equipment_Manager>(); characterStats = GameObject.FindGameObjectWithTag("Player").GetComponent <Character_Stats>(); }
// Use this for initialization void Start() { Equipment = EquipmentManager.GetComponent <Equipment_Manager>(); for (int i = 0; i < CharacterStatModifiers.Length; ++i) { // Initalize everything to 0 CharacterStatModifiers[i] = 0; } }
private void SetRefrences() { playerAnim = this.GetComponent <Animator>(); weaponAnim = this.GetComponentInChildren <Weapon_Controller>().GetComponent <Animator>(); armourAnim = this.GetComponentInChildren <Armour_Controller>().GetComponent <Animator>(); charStats = this.GetComponent <Character_Stats>(); equipmentManager = this.GetComponent <Equipment_Manager>(); equipmentManager.equipWeapon += EquipWeaponForAnim; charStats.callingDeath += LiveOrDie; callingAttack += BodyAttackAnim; equipmentManager.restartAnimationEvent += AnimationSyncer; }
private void SetRefrences() { playerMovement = this.GetComponent <Player_Movement_TwoDSS>(); animCon = this.GetComponent <Animator_Controller>(); spriteRen = this.GetComponent <SpriteRenderer>(); rb = this.GetComponent <Rigidbody2D>(); if (IsPlayer()) { equipmentManager = this.GetComponent <Equipment_Manager>(); } }
private void SetRefrences() { anim = this.GetComponent <Animator>(); animCon = this.GetComponentInParent <Animator_Controller>(); aIAnimCon = this.GetComponentInParent <AI_Animator_Controller>(); characterStats = this.GetComponentInParent <Character_Stats>(); equipmentManager = this.GetComponentInParent <Equipment_Manager>(); hitBox = this.GetComponent <PolygonCollider2D>(); //cloneAnimOveride = Instantiate(animOveride); }
// Use this for initialization void Start() { //Initalize weapons InventoryManager = GetComponentInParent <Inventory_Manager>(); offSet = 0; Weapons newWeapon = new Weapons("Pew Rifle", 29, 20, 3, 3, 1); // Rifle WeaponList.Add(newWeapon); newWeapon = new Weapons("Laser Sword", 35, 15, 3, 3, 2); // Sword WeaponList.Add(newWeapon); newWeapon = new Weapons("Shield", 10, 5, 3, 2, 3); // Shield WeaponList.Add(newWeapon); newWeapon = new Weapons("Strong Rifle", 45, 29, 3, 4, 4); WeaponList.Add(newWeapon); // Legendary rifle newWeapon = new Weapons("OP Sword", 60, 35, 3, 4, 5); WeaponList.Add(newWeapon); newWeapon = new Weapons("Test Sword", 30, 15, 3, 4, 6); WeaponList.Add(newWeapon); newWeapon = new Weapons("Final Sword", 43, 12, 3, 4, 7); WeaponList.Add(newWeapon); newWeapon = new Weapons("Filler Rifle", 43, 12, 3, 4, 8); WeaponList.Add(newWeapon); newWeapon = new Weapons("Helmet", 29, 20, 1, 3, 9); // Rifle ApparelList.Add(newWeapon); newWeapon = new Weapons("Chest Piece", 35, 15, 2, 3, 10); // Sword ApparelList.Add(newWeapon); newWeapon = new Weapons("Leggings", 10, 5, 4, 2, 11); // Shield ApparelList.Add(newWeapon); newWeapon = new Weapons("Boots", 45, 29, 5, 4, 12); ApparelList.Add(newWeapon); // Legendary rifle newWeapon = new Weapons("Testing Chest", 30, 15, 2, 4, 13); ApparelList.Add(newWeapon); newWeapon = new Weapons("Testing Leggings", 10, 15, 4, 4, 13); ApparelList.Add(newWeapon); newWeapon = new Weapons("Testing Helmet", 5, 5, 1, 4, 13); ApparelList.Add(newWeapon); for (int i = 0; i < ItemSlots.Length; ++i) { ItemSlots[i].transform.parent.gameObject.GetComponent <Image>().enabled = false; // works // ItemSlots[i].GetComponentInParent<Image>().enabled = false; // doesnt work // idk why lol } EMScript = EquipmentManager.GetComponent <Equipment_Manager>(); ItemSelectionTransform = ItemSelectionBox.GetComponent <RectTransform>(); isShown = false; }
void Awake() { instance = this; }