Example #1
0
    public void InitPoint(int nb)
    {
        CharacterInventoryModel inventory = GetComponent <CharacterInventoryModel>();

        if (inventory == null)
        {
            return;
        }
        inventory.AddItem(ItemType.RecyclingPoints, nb);
        TipsHandler.RecyclingPoints();
    }
Example #2
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #3
0
 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();
 }
Example #4
0
    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();
    }
Example #5
0
    //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();
    }
Example #6
0
 public void Awaken()
 {
     isAwake = true;
     anim.SetBool("IsMoving", true);
     TipsHandler.Ennemies();
 }
Example #7
0
 void Awake()
 {
     Instance = this;
 }