/// <summary> /// Deactivate the world gear object /// </summary> private void DeactivateGear() { gameObject.layer = 8; gearVisual.enabled = false; UI_InventoryGear = null; GearActives--; }
/// <summary> /// Activate the gear with a little animation /// </summary> /// <param name="gearColor"></param> /// <param name="inventoryGear"></param> public void ActivateGear(Color32 gearColor, UI_InventoryGear inventoryGear) { gearVisual.transform.localScale = Vector3.one * 0.8f; //Scale down the image to do an animation later gameObject.layer = 0; gearVisual.color = gearColor; gearVisual.enabled = true; vfxSmoke.Play(); gearVisual.transform.DOScale(1, 0.4f).SetEase(Ease.OutElastic); //Animate the entrance of the image UI_InventoryGear = inventoryGear; //Save the reference of the gear of the inventory GearActives++; }