예제 #1
0
    private void SetUpVariableFireNova(int viewId)
    {
        FireNovaController fnc = PhotonView.Find(viewId).gameObject.GetComponent <FireNovaController>();

        fnc.CharId      = photonView.viewID;
        fnc.Damage      = _fn.Damage;
        fnc.Power       = _fn.Power;
        fnc.Range       = _fn.Range;
        fnc.CastingTime = _fn.CastingTime;
    }
예제 #2
0
    // Generic Method to cast spell
    public void CastSpell(Spell spell)
    {
        photonView.RPC("PlayAnim", PhotonTargets.All, "Move|Cast");

        if (spell is FireBall)
        {
            FireBallController fbc = CastFireBall();
            if (fbc == null)
            {
                return;
            }
            photonView.RPC("SetUpVariableFireBall", PhotonTargets.All, fbc.photonView.viewID);
            _fb.CurrentCooldown = 0;
        }
        if (spell is FireNova)
        {
            FireNovaController fnc = CastFireNova();
            photonView.RPC("SetUpVariableFireNova", PhotonTargets.All, fnc.photonView.viewID);
            _fn.CurrentCooldown = 0;
        }
    }