void OnAwake() { alchemyOrganizer = this; SetupPotionLoaders(); SetupRecipes(); CreateIngredientList(); }
public bool Interact(Transform interactor) { if (_enabled && (isUnderwater == false || !FPSMovement.IsSwimming())) { if (FlowerLibrary.GetFlowerDiscoverAmount(_flowerData.itemName) == 0) { BookManager.SetPickedFlower(_flowerData); if (onPickUpEvent != null) { onPickUpEvent.Invoke(" " + _flowerData.itemName, _flowerData.itemIcon); } } //Pickup save system PickUp(); //NotificationObject.name = _flowerData.itemName; // For notification system(not needed anymore, but leave it?) //NotificationObject.sprite = _flowerData.itemIcon; // For notification system(not needed anymore, but leave it?) Play_PickupSound(_flowerData.itemName); FlowerLibrary.IncrementFlower(_flowerData.itemName, _flowersReturned); if (_gameobjectOverload.Length == 0) { if (_pickupAlpha != null) { GetComponent <MeshRenderer>().material.SetTexture("_Alpha", _pickupAlpha); GetComponent <Collider>().enabled = false; //This may not work since there are multiple colliders } else { Destroy(this.gameObject); } } else { foreach (GameObject gObject in _gameobjectOverload) { if (_pickupAlpha != null) { gObject.GetComponent <MeshRenderer>().material.SetTexture("_Alpha", _pickupAlpha); } else { Destroy(gObject); } } GetComponent <Collider>().enabled = false;//This may not work since there are multiple colliders } StartCoroutine(ShakeFlower(interactor, _pickupAnimationTime, _pickupAnimationForce)); _pickupAction.Invoke(); AlchemyOrganizer_2.DiscoverRecipes(_flowerData); if (_dissableTriggerafterPickup) { GetComponent <Collider>().enabled = false; } return(true); //Doesn't really have a purpose for this } return(false); }
// Start is called before the first frame update void Start() { _mainCam = Camera.main; //slow rect = GetComponent <RectTransform>(); AlchemyOrganizer_2 alchOrger = _bookManager._book.GetComponentInChildren <AlchemyOrganizer_2>(true); alchOrger.SetupPotionLoaders(); _allPotions = alchOrger.GetAllPotions(); SetUpRegions(); }
//Load in stuff from memory, called on startup private void Load() { if (_load) { ValidateSave(); Noise.Load(); Player.Load(); PrefabSpawnerSaveData.Load(); MapGenerator.Load(); Menu.Load(); FlowerLibrary.Load(); AlchemyOrganizer_2.UpdateAfterLoad(); } //Used to make clear circle around player on spawn PrefabSpawnerSaveData.ClearStartArea(_meshSettings.NumVertsPerLine / 2, _clearAreaSize); Ready = true; }