Beispiel #1
0
        void Update()
        {
            Hen  under    = findHenUnder();
            bool henFound = false;

            if (under != null)
            {
                henFound = true;
                if (brushProgress == 0 || lastHen.GetInstanceID() != under.GetInstanceID())
                {
                    StopHenFlap(lastHen);
                    lastHen       = under;
                    brushProgress = maxBrushTimer;
                    MakeHenFlap(lastHen);
                    SoundManager.Instance().PlayAnySFX(SoundManager.SFXv2.Brush);
                }
            }
            if (!henFound && checkHenStillBeingPetTimer < 0)
            {
                StopHenFlap(lastHen);
                brushProgress = 0;
            }
            if (checkHenStillBeingPetTimer < 0)
            {
                checkHenStillBeingPetTimer = 0.5f;
            }
            checkHenStillBeingPetTimer -= Time.deltaTime;
            if (brushProgress > 0)
            {
                brushProgress -= Time.deltaTime;
                if (brushProgress <= 0)
                {
                    StartCoroutine(lastHen.love.increase(1 + .5f * InventoryPersist.getPettingLevel()));
                    brushProgress = 0;
                }
            }
            else
            {
                brushProgress = 0;
            }
        }
Beispiel #2
0
 public void RaiseLevel()
 {
     InventoryPersist.setPettingLevel(InventoryPersist.getPettingLevel() + 1);
     SetMaterial(InventoryPersist.getPettingLevel());
 }
 public override bool CanBeBought()
 {
     return(InventoryPersist.getPettingLevel() + 1 == level);
 }