protected override void OnAwake(PlayerActor player) { player.EventKey = EventType.StorageIn; if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null)) { this._chestAnimation = (ChestAnimation)((Component)player.CurrentPoint).GetComponent <ChestAnimation>(); if (Object.op_Inequality((Object)this._chestAnimation, (Object)null)) { this._chestAnimation.PlayInAnimation(); } } ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnimation, 1), (Action <M0>)(_ => MapUIContainer.SetActiveItemBoxUI(true)), (Action)(() => ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ => { MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception); player.Controller.ChangeState("Normal"); })))); Singleton <Input> .Instance.ReserveState(Input.ValidType.UI); Singleton <Input> .Instance.SetupState(); ActorAnimInfo animInfo = player.Animation.AnimInfo; animInfo.outEnableBlend = true; animInfo.outBlendSec = 0.0f; player.Animation.AnimInfo = animInfo; }
void Start() { _lootController = LootController.instance; _chestAnimation = GetComponentInChildren <ChestAnimation>(); if (items.Count == 0) { //Store all Gameobjects in an array like this Object[] allItems = Resources.LoadAll("Items"); int numberOfItems = Random.Range(1, 5); for (int i = 0; i < numberOfItems; i++) { items.Add((Item)allItems[Random.Range(0, allItems.Length)]); } } }