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; } }
public void init(DiceInteractable dice, int number) { attachedToDice = dice; //setRange(range); Invoke("autodestroy", duration * diceFactor * number); if (fxOnStart != null) { fxOnStart.trigger(gameObject); } }
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); }
public virtual void onDiceLaunched(DiceInteractable dice, int number, DiceZone zone = null) { }