示例#1
0
    IEnumerator Effect(Player_Net p)
    {
        yield return(new WaitForSeconds(duration));

        triggered = false;

        avaible.Play();
    }
示例#2
0
    public override void Action(Player_Net p)
    {
        p.Win();

        /*Cursor.lockState = CursorLockMode.None;
         * (GameObject.Find("PauseScript").GetComponent<PauseMenuScript>()).isActive = true;
         *
         * SceneManager.LoadScene("Menu");*/
    }
示例#3
0
    IEnumerator Effect(Player_Net p)
    {
        p.running_speed += speedValue;
        p.walking_speed += speedValue;

        yield return(new WaitForSeconds(duration));

        p.running_speed -= speedValue;
        p.walking_speed -= speedValue;

        triggered = false;

        avaible.Play();
    }
示例#4
0
    void OnTriggerEnter(Collider entity)
    {
        Player_Net p = entity.transform.GetComponent <Player_Net>();

        if (p != null && !triggered)
        {
            p.PlaySound(pickUpSound, 0.1f, false);
            triggered = true;
            Action(p);
            if (avaible != null)
            {
                avaible.Stop();
            }
        }
    }
    //private Vector3 FPSpos;

    // Use this for initialization
    void Start()
    {
        player = GetComponent <Player_Net>();
        if (Camera.main != null)
        {
            fpsCam = GetComponentInChildren <Camera>();
        }
        else
        {
            Debug.LogWarning(
                "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.", gameObject);
            // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
        }

        camRot = fpsCam.transform.rotation;
    }
示例#6
0
    //private int idleStateHash = Animator.StringToHash("Base Layer.Idle");
    //private int bendStateHash = Animator.StringToHash("Base Layer.Bending");

    // Use this for initialization
    void Start()
    {
        character = transform.parent.gameObject;
        player    = character.GetComponent <Player_Net>();

        if (!local) // On desactive la camera pour les autres joueurs multi
        {
            Camera cam = gameObject.transform.GetChild(0).gameObject.GetComponent <Camera>();
            cam.enabled = false;
            cam.GetComponent <AudioListener>().enabled = false;
            Destroy(this);
            return;
        }

        // On affiche pas le curseur en jeu
        Cursor.lockState = CursorLockMode.Locked;
    }
示例#7
0
 public override void Action(Player_Net p)
 {
     p.TakeDamage(damage, "");
     StartCoroutine(Effect(p));
 }
示例#8
0
 public abstract void Action(Player_Net p);
示例#9
0
 public override void Action(Player_Net p)
 {
     StartCoroutine(Effect(p));
 }
示例#10
0
 public override void Action(Player_Net p)
 {
     p.CmdHeal(heal);
     StartCoroutine(Effect(p));
 }