Esempio n. 1
0
        public override void EnterState()
        {
            base.EnterState();

            var newObjectToCatch = controller.NextObjectToCatch;

            if (newObjectToCatch == null)
            {
                controller.CurrentState = controller.Idle;
                return;
            }

            objectToCatch    = newObjectToCatch;
            objectInteracted = false;

            controller.Antura.SetTarget(objectToCatch.transform, false);
            objectRigidBody           = objectToCatch.GetComponent <Rigidbody>();
            controller.Antura.Excited = true;
        }
Esempio n. 2
0
        public void HitObject(ThrowableObject throwableObject)
        {
            if (spawnedObjects.Remove(throwableObject))
            {
                AudioManager.I.PlaySound(Sfx.EggMove);

                AnturaHappiness += 0.2f;
                if (AnturaHappiness > 1)
                {
                    AnturaHappiness = 1;
                }


                if (onHitObject != null)
                {
                    onHitObject();
                }

                throwableObject.GetComponent <Rigidbody>().AddForce(Vector3.up * 20, ForceMode.Impulse);
            }
        }