Hi im a bit confused on how to ask this so ill do it in points
ok so my player has 4 gamobject under it called forward backward left and right and each have their own graphics and i enable and disable them deepening on what way im moving and each way gameobject has a game object called weapons under it for the different facing weapons now ill be using uinventory so i can use its custom activate to call something to enable the weapons using the array index shown below what would be the best way to tell what weapon i should enable i would like to use a name but i am unsure how to link it to the inventory
using UnityEngine;
using System.Collections;
[System.Serializable]
public struct Weapons {
public GameObject WeaponFront;
public GameObject WeaponBack;
public GameObject WeaponLeft;
public GameObject WeaponRight;
}
public class WeaponHandler : MonoBehaviour {
public Weapons[] Weapon;
}