示例#1
0
    private DiceBlock SpawnDiceAndRoll(Vector3 direction)
    {
        GameObject go        = ObjectPool.Instance.GetObject(PoolObjectType.DiceBlock);
        DiceBlock  diceBlock = null;

        if (go)
        {
            diceBlock = go.GetComponent <DiceBlock>();
            if (diceBlock)
            {
                diceBlock.transform.position = bulletSpawnPoint.position;
                diceBlock.transform.rotation = transform.rotation;
                diceBlock.Roll(direction);

                if (wielderStats.gameObject.CompareTag(Strings.Tags.PLAYER))
                {
                    diceBlock.SetShooterType(true);
                }
                else
                {
                    diceBlock.SetShooterType(false);
                }
            }
        }
        animator.SetTrigger("Shoot");
        return(diceBlock);
    }
示例#2
0
    protected override void DoWeaponActions()
    {
        blasterEffect.Play();
        DiceBlock diceBlock = SpawnDiceAndRoll(bulletSpawnPoint.forward);

        if (diceBlock)
        {
            diceBlock.PrimeExplosion(armTimeTilExplosion);
        }
    }