Beispiel #1
0
 private void OuterFlow()
 {
     if (overFlow > 1)
     {
         float transfer = (overFlow * overFlowRate) * Time.deltaTime;
         overFlow -= transfer;
         Faucet.spawnWater(spawnPoint.transform.position, transfer, true);
     }
 }
Beispiel #2
0
    private void OverFlow()
    {
        float   transfer     = (overFlow * overFlowRate) * Time.deltaTime;
        Vector3 positionEdge = transform.position;

        positionEdge.y = Edge + 0.5f;

        Faucet.spawnWater(positionEdge + new Vector3(Random.Range(-bassinWidth / 2, bassinWidth / 2), 0, (bassinLenght / 2) + 1.9f), transfer / 12);
        Faucet.spawnWater(positionEdge + new Vector3((bassinWidth / 2) + 1.9f, 0, Random.Range(-bassinLenght / 2, bassinLenght / 2)), transfer / 12);
        Faucet.spawnWater(positionEdge + new Vector3(Random.Range(-bassinWidth / 2, bassinWidth / 2), 0, (-bassinLenght / 2) - 1.9f), transfer / 12);
        Faucet.spawnWater(positionEdge + new Vector3((-bassinWidth / 2) - 1.9f, 0, Random.Range(-bassinLenght / 2, bassinLenght / 2)), transfer / 12);

        //instance.transform.localScale = new Vector3(overflow, overflow, overflow) * 2;
        WaterLevel -= transfer / volume;
        Water.transform.position = Water.transform.position - new Vector3(0, transfer / volume, 0);

        /* foreach (Bassin child in childs)
         * {
         *   child.outerWaterOffset = Mathf.Max(((Edge - Deept + WaterLevel) - (child.WaterLevel - child.Deept + child.Edge)),0);
         * }*/
    }