// Use this for initialization void Start() { currentMode = startMode; displayImage.material = anonymousMaterial; typeDisplayImage.material = nullMaterial; audioSrc = gameObject.AddComponent <AudioSource>(); audioSrc.clip = soundEffect; }
// Update is called once per frame /// <summary> /// /// </summary> void Update() { if (currentMode == AnonymousInventoryMode.Start) { InitializeObjectLists(); OverrideItemMaterials(anonymousMaterial); //Automatically move on to location/time currentMode = AnonymousInventoryMode.LocationTime; } else if (currentMode == AnonymousInventoryMode.LocationTime) { if (objectHeldList.Count == 0) { SetImageMaterial(displayImage, emptyMaterial); } else { SetImageMaterial(displayImage, anonymousMaterial); } if (DetectPlacedButtonRisingEdge()) { if (!AttemptPerformPickup(DetectSelectionHit())) //No object is being picked up, drop the current item { AttemptPlaceItem(); } } if (InventoryIsEmpty() && DetectNextStateButtonRisingEdge()) { currentMode = AnonymousInventoryMode.Rewind; ReinitializeInventoryForIdentifyPhase(); } } else if (currentMode == AnonymousInventoryMode.Rewind) { if (time.time <= 0) { timeController.controlEnabled = true; currentMode = AnonymousInventoryMode.Identity; } } else if (currentMode == AnonymousInventoryMode.Identity) { UpdateEventType(); UpdateInventoryState(); if (DetectPlacedButtonRisingEdge()) { AttemptAssignItem(DetectSelectionHit()); } } }