示例#1
0
        private void MovePickup(ControlPickupEnum moveThis, Vector3 moveItHere)
        {
            switch (moveThis)
            {
            case ControlPickupEnum.Forward:
                forwardPickup.transform.position = moveItHere;
                break;

            case ControlPickupEnum.Backward:
                backPickup.transform.position = moveItHere;
                break;

            case ControlPickupEnum.Left:
                leftPickup.transform.position = moveItHere;
                break;

            case ControlPickupEnum.Right:
                rightPickup.transform.position = moveItHere;
                break;

            case ControlPickupEnum.Jump:
                jumpPickup.transform.position = moveItHere;
                break;
            }
        }
示例#2
0
        public void MakePickupPlayNoise(ControlPickupEnum noisemaker)
        {
            int       n        = Random.Range(1, pickupNoises.Length);
            AudioClip playThis = pickupNoises[n];

            pickupNoises[n] = pickupNoises[0];
            pickupNoises[0] = playThis;
            switch (noisemaker)
            {
            case ControlPickupEnum.Forward:
                forwardPickup.PlayTheNoise(playThis);
                break;

            case ControlPickupEnum.Backward:
                backPickup.PlayTheNoise(playThis);
                break;

            case ControlPickupEnum.Left:
                leftPickup.PlayTheNoise(playThis);
                break;

            case ControlPickupEnum.Right:
                rightPickup.PlayTheNoise(playThis);
                break;

            case ControlPickupEnum.Jump:
                jumpPickup.PlayTheNoise(playThis);
                break;
            }
        }
示例#3
0
        public List <ControlPickupEnum> LoseControls(int numberToLose)
        {
            List <ControlPickupEnum> lostControls = new List <ControlPickupEnum>();

            if (canForward)
            {
                lostControls.Add(ControlPickupEnum.Forward);
            }
            if (canBackward)
            {
                lostControls.Add(ControlPickupEnum.Backward);
            }
            if (canLeft)
            {
                lostControls.Add(ControlPickupEnum.Left);
            }
            if (canRight)
            {
                lostControls.Add(ControlPickupEnum.Right);
            }

            if (lostControls.Count <= 1)
            {
                return(new List <ControlPickupEnum>());
            }
            else
            {
                int yote = 0;
                List <ControlPickupEnum> yeetThese = new List <ControlPickupEnum>();
                do
                {
                    int yeet = Random.Range(0, lostControls.Count);
                    ControlPickupEnum yeetThis = lostControls[yeet];
                    switch (yeetThis)
                    {
                    case ControlPickupEnum.Forward:
                        canForward = false;
                        break;

                    case ControlPickupEnum.Backward:
                        canBackward = false;
                        break;

                    case ControlPickupEnum.Left:
                        canLeft = false;
                        break;

                    case ControlPickupEnum.Right:
                        canRight = false;
                        break;
                    }
                    yeetThese.Add(yeetThis);
                    lostControls.RemoveAt(yeet);
                    yote++;
                } while (yote < numberToLose && lostControls.Count > 1);

                return(yeetThese);
            }
        }
示例#4
0
 public void MakePickupPlayNoise(ControlPickupEnum noisemaker)
 {
     pickupParent.MakePickupPlayNoise(noisemaker);
 }
示例#5
0
 public void PickupPickedUp(ControlPickupEnum thePickup)
 {
     MovePickup(thePickup, holdingPosition.transform.position);
 }