/// <summary> /// Awake Function, basic init & call 'onAwake' method. /// </summary> public void Awake() { main = this; invContent = new List <GameObject[]>(); onAwake(); }
/// <summary> /// Start Function, initialize propreties, and inputs, and make first selection. /// </summary> void Start() { generatorInstance = GetComponentInChildren <InventoryGenerator>(); InventoryHand = MGR_VRControls.mainHand; SwitchButton = (InventoryHand == VRHand.Hand.RIGHT) ? VRButton.Code.B : VRButton.Code.Y; transform.SetParent(InventoryHand == VRHand.Hand.RIGHT ? MGR_VRControls.get.RightHand.transform : MGR_VRControls.get.LeftHand.transform); transform.localPosition = new Vector3(0, .25f, 0); generatorInstance.gameObject.SetActive(CurrentInventoryState); tInvSize = generatorInstance.invContent.Count; // First Select switch (MGR_VRControls.mainHand) { case VRHand.Hand.LEFT: LeftHandIndex = 0; RightHandIndex = 1; break; case VRHand.Hand.RIGHT: RightHandIndex = 0; LeftHandIndex = 1; break; default: break; } ComputeSelection(MGR_VRControls.get.RightHand, MGR_VRControls.get.LeftHand); generatorInstance.holdOn(0, MGR_VRControls.get.primary.handColor); generatorInstance.holdOn(1, MGR_VRControls.get.secondary.handColor); MGR_VRControls.get.primary.LateStart(); MGR_VRControls.get.secondary.LateStart(); }
public static void Main(string[] args) { Console.WriteLine($"Mutant Power: {CharacterGenerator.RandomMutation()}"); Console.WriteLine($"Secret Society: {CharacterGenerator.RandomSociety()}"); Console.WriteLine("Inventory:"); var awesomeList = new List <Item>(); var itemCount = 6; for (int i = 0; i < itemCount; i++) { awesomeList.Add(InventoryGenerator.RandomItem()); } var sortedList = awesomeList.OrderBy(x => (int)(x.Clearance)).ToList(); foreach (var element in sortedList) { Console.WriteLine($"{element.Name} - Clearance: {element.Clearance}"); } }