public void InitPoint(int nb) { CharacterInventoryModel inventory = GetComponent <CharacterInventoryModel>(); if (inventory == null) { return; } inventory.AddItem(ItemType.RecyclingPoints, nb); TipsHandler.RecyclingPoints(); }
private void Awake() { if (!Instance) { Instance = this; } else { Destroy(gameObject); } }
void StunEnnemy() { GetComponentInParent <InteractablePickup>().SetAuthorizePickup(true); myStunTime = stunTime; anim.SetBool("IsStunned", true); SetFrozen(true); if (stunnedShadow != null) { myShadow.SetActive(false); stunnedShadow.SetActive(true); } TipsHandler.PickUp(); }
public void GainPoints(int nb) { CharacterInventoryModel inventory = GetComponent <CharacterInventoryModel>(); if (inventory == null) { return; } inventory.AddItem(ItemType.RecyclingPoints, nb); TipsHandler.RecyclingPoints(); audio.clip = (AudioClip)pointsSound[Random.Range(0, pointsSound.Length)]; audio.Play(); }
//Pickup and carry an InteractablePickup item public void CarryObject(InteractablePickup objectToCarry) { if (IsCarrying()) { return; } carriedObject = objectToCarry; anim.SetTrigger("DoPickupObject"); //pickup animation anim.SetBool("IsPickingUp", true); //special Idle and Walk animation when carrying carriedObject.transform.parent = previewItemParent; //object becomes child of previewItemParent carriedObject.transform.localPosition = Vector3.zero; layerOfCarriedObject = carriedObject.GetComponentInChildren <SpriteRenderer>().sortingLayerName; carriedObject.GetComponentInChildren <SpriteRenderer>().sortingLayerName = "HighObjects"; //rendered above the character SetColliders(carriedObject.gameObject, false); //disable all coliders of the carried object EnemyBehavior objectBehavior = carriedObject.GetComponent <EnemyBehavior>(); if (objectBehavior != null) { objectBehavior.DisableShadow(); } TipsHandler.Recycle(); }
public void Awaken() { isAwake = true; anim.SetBool("IsMoving", true); TipsHandler.Ennemies(); }
void Awake() { Instance = this; }