Exemplo n.º 1
0
    /// <summary>
    /// change la rope
    /// </summary>
    private void ModifyRope(float strain)
    {
        //ici quelqu'un est gripped, (ou pret pour ungrip), ne pas ajouter / diminuer pour l'instant
        //si on a commencé a raccourcir
        //si on a commencer a ralonger
        //   -> NON return;
        if (playerManager.IsSomeOneGripped() || grippedPrepareLessSetup || onGroundLenghting || !playerManager.AreBothGrounded())
        {
            //Debug.Log("ici quelqu'un est gripped, (ou pret pour ungrip), ne pas ajouter / diminuer pour l'instant");

            /*if (isGripped)
             * {
             *  isGripped = false;
             *  Debug.Log("ici reset le grip");
             * }*/

            return;
        }

        if (strain > stretchAdd && rope.PooledParticles > minParticle) //ici la rope est tendu !
        {
            /*
             * if (playerManager.AreBothPlayerInOpositeInputDirection())
             * {
             *  Debug.Log("add");
             *  ChangeParticleInRope(true, hookExtendRetractSpeed);
             * }
             * else
             * {
             *  Debug.Log("ici n'ajoute pas si les 2 players sont dans la même direction...");
             * }
             */
            Debug.Log("add");
            ChangeParticleInRope(true, hookExtendRetractSpeed);



            //cursor.normalizedCoord = 0.5f;
        }
        else if (strain < stretchRemove && rope.PooledParticles < maxParticle)
        {
            Debug.Log("less");
            ChangeParticleInRope(false, hookExtendRetractSpeed);
            //cursor.normalizedCoord = 0.5f;
        }
    }