Beispiel #1
0
    public void OnTriggerExit2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent <ControllerPhysicsVolume2D>();

        if (parameters == null)
        {
            return;
        }
        _overrideParameters = null;
    }
Beispiel #2
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent <ControllerPhysicsVolume2D>();

        if (parameters == null)
        {
            return;
        }

        _overrideParameters = parameters.Parameters;    // Here we overrive the default parameters with the trigger's parameters
    }
    /// <summary>
    /// Wyjscie ze srodowiska o zmienionych parametrach.
    /// </summary>
    public void OnTriggerExit2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent <ControllerPhysicsVolume2D>();

        if (parameters == null)
        {
            return;
        }

        /// Parametry nie sa juz nadpisywane poprzednimi wartosciami.
        _overrideParameters = null;
    }
    /// <summary>
    /// Wykrycie ze gracz znalazl sie w innym srodowisku (np. wodzie).
    /// </summary>
    public void OnTriggerEnter2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent <ControllerPhysicsVolume2D>();

        if (parameters == null)
        {
            return;
        }

        /// Nadpisanie parametrow kontrolera.
        _overrideParameters = parameters.Parameters;
    }
    /*handles the situation where the ControllerParameters2D need to be overrided, in dif volumes*/
    public void OnTriggerEnter2D(Collider2D other)
    {
        // if enter a new object has ControllerPhysicsVolume2D attached to it, then overwrite the parameters

        var parameters = other.gameObject.GetComponent <ControllerPhysicsVolume2D>();

        if (parameters == null)
        {
            return;
        }

        _overrideParameters = parameters.Parameters;
    }
    public void OnTriggerExit2D( Collider2D other )
    {
        var parameters = other.gameObject.GetComponent<ControllerPhysicsVolume2D>();
        if ( parameters == null )
            return;

        _overrideParameters = null;
        InsideVolume = "None";
    }
    public void OnTriggerExit2D(Collider2D other)
    {
        var volume = other.gameObject.GetComponent<ControllerPhysicsVolumes>();
        if (volume == null)
            return;

        _overrideParameters = null;
    }
    // Wyjscie ze srodowiska o zmienionych parametrach.
    public void OnTriggerExit2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent<ControllerPhysicsVolume2D>();

        if (parameters == null)
            return;

        // Parametry nie sa juz nadpisywane poprzednimi wartosciami.
        _overrideParameters = null;
    }
    // Wykrycie ze gracz znalazl sie w innym srodowisku (np. wodzie).
    public void OnTriggerEnter2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent<ControllerPhysicsVolume2D>();

        if (parameters == null)
            return;

        // Nadpisanie parametrow kontrolera.
        _overrideParameters = parameters.Parameters;
    }
    public void OnTriggerEnter2D(Collider2D other) {

        var parameters = other.gameObject.GetComponent<ControllerPhysichs2D>();

        if (parameters == null)
            return;

        _overrideParameters = parameters.Parameters;
    }
 public void ResetParameters()
 {
     _overrideParameters = null;
     _swimming = false;
 }
    public void OnTriggerExit2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent<ControllerPhysicsVolume2D>();
        if (parameters == null)
            return;

        _overrideParameters = null;    // When we exit the volume we return it to null
    }
    public void OnTriggerEnter2D(Collider2D other)
    {
        var parameters = other.gameObject.GetComponent<ControllerPhysicsVolume2D>();
        if (parameters == null)
            return;

        _overrideParameters = parameters.Parameters;    // Here we overrive the default parameters with the trigger's parameters
    }
Beispiel #14
0
 public void Start()
 {
     controller    = GetComponent <CharacterController2D>();
     IsFacingRight = transform.localScale.x > 0;
     Parameters    = new ControllerParameters2D();
 }