Beispiel #1
0
    public int AttackBehaviour()
    {
        if (DataManager.instance.isMulti)
        {
            CmdPlaySound(1, 8, 0.3f, 0, 0, 0.0f, 0, false, AudioType.SFX);
            CmdAttackBehaviour();
        }
        else
        {
            currentAttack = Instantiate(attackHitbox, transform.position + Vector3.up, transform.rotation).GetComponent <AttackWarrior>();

            currentAttack.caster           = gameObject;
            currentAttack.transform.parent = gameObject.transform;

            /*if(DataManager.instance.isMulti)
             * {
             *  CmdPlaySound(1, 8, 0.3f, 0, 0, 0.0f, 0);
             * }
             * else
             * {*/
            SoundCharacter(1, 8, 0.3f, AudioType.SFX);
            //}
        }
        return(0);
    }
Beispiel #2
0
    void CmdAttackBehaviour()
    {
        currentAttack = Instantiate(attackHitbox).GetComponent <AttackWarrior>();
        NetworkServer.Spawn(currentAttack.gameObject);

        currentAttack.caster = gameObject;

        RpcParentObjectOnce(currentAttack.gameObject, gameObject);
        RpcAttackObjectOnce(currentAttack.gameObject);
    }