Ejemplo n.º 1
0
        public override void onDiceLaunched(DiceInteractable dice, int number, DiceZone zone = null)
        {
            base.onDiceLaunched(dice, number);
            switch (dice.diceType)
            {
            case DiceInteractable.DICE_TYPE.NONE:
                break;

            case DiceInteractable.DICE_TYPE.MOVE_FORWARD:
                StartCoroutine(routineMove(number));
                break;

            case DiceInteractable.DICE_TYPE.TURN_LEFT:
                StartCoroutine(routineTurn(number, -1));
                break;

            case DiceInteractable.DICE_TYPE.TURN_RIGHT:
                StartCoroutine(routineTurn(number, 1));
                break;

            case DiceInteractable.DICE_TYPE.BRAKE:
                break;

            case DiceInteractable.DICE_TYPE.JUMP:
                break;

            case DiceInteractable.DICE_TYPE.SHOOT:
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
 public void init(DiceInteractable dice, int number)
 {
     attachedToDice = dice;
     //setRange(range);
     Invoke("autodestroy", duration * diceFactor * number);
     if (fxOnStart != null)
     {
         fxOnStart.trigger(gameObject);
     }
 }
Ejemplo n.º 3
0
        void OnCollisionEnter(Collision col)
        {
            float            volumeScale = Mathf.InverseLerp(0f, 25f, col.relativeVelocity.magnitude);
            DiceInteractable dice        = col.gameObject.GetComponent <DiceInteractable>();

            if (dice != null)
            {
                audioCollideSelf.trigger(gameObject, volumeScale);
                return;
            }

            Obstacle obstacle = col.gameObject.GetComponent <Obstacle>();

            if (obstacle != null)
            {
                return;
            }

            audioCollideWall.trigger(gameObject, volumeScale);
        }
Ejemplo n.º 4
0
 public virtual void onDiceLaunched(DiceInteractable dice, int number, DiceZone zone = null)
 {
 }