Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (!gotCig)
     {
         if (!cig.activeInHierarchy)
         {
             //if theres no cig object then the bois got it i guess
             moonFace.SetRandomFace(cigFace);
             gotCig = true;
         }
     }
     if (!gotLip)
     {
         if (!lipstick.activeInHierarchy)
         {
             moonFace.SetRandomFace(lipFace);
             gotLip = true;
         }
     }
 }
Ejemplo n.º 2
0
    public override void OnHeartCollide(float heartVal, DetachedPiece thisHeart)
    {
        if (catchingIsStopped == false)
        {
            if (NextPosFree())
            {
                health += heartVal;
                if (health > maxHealth)
                {
                    health = maxHealth;
                }
                BlockHealthCheck();
                SetHighlight();
                thisHeart.collidedOnce = true;

                LookAtObject newBoiFace   = playerBlockParent.GetChild((int)health - 1).GetComponentInChildren <LookAtObject>();
                LookAtObject looseBoiFace = thisHeart.GetComponentInChildren <LookAtObject>();
                newBoiFace.randomizeFace = false;
                if (!newBoiFace.alreadyGotSpecialFace)
                {
                    newBoiFace.GetComponent <SpriteRenderer>().sprite = looseBoiFace.GetComponent <SpriteRenderer>().sprite;
                }
                else if (latestFaceProfile != null)
                {
                    if (!looseBoiFace.alreadyGotSpecialFace)
                    {
                        newBoiFace.SetRandomFace(latestFaceProfile); //asign the lipstick on attachment now i guess
                    }
                    else
                    {
                        newBoiFace.GetComponent <SpriteRenderer>().sprite = looseBoiFace.GetComponent <SpriteRenderer>().sprite;
                    }
                }

                Destroy(thisHeart.gameObject);

                // play Get Piece sound
                fModGetPieceEvent.start();

                if (health > 1 && rotationIndicatorIcon.activeSelf == false)
                {
                    rotationIndicatorIcon.SetActive(true);
                }

                PlayerPieceAnimatorManager animationManager = GetComponent <PlayerPieceAnimatorManager>();
                if (animationManager)
                {
                    //animationManager.ActivateAnimatorTrigger("Catch");
                }
            }
        }
    }