Esempio n. 1
0
 void ToggleElectricalPlateState()
 {
     if (currentElectricalPlate.isActivated)
     {
         currentElectricalPlate.Desactivate();
         currentElectricalPlateToggleCD = bossSettings.electricalPlateSettings.desactivationDuration;
     }
     else
     {
         currentElectricalPlate.Activate();
         currentElectricalPlateToggleCD = bossSettings.electricalPlateSettings.activationDuration;
     }
 }
Esempio n. 2
0
    IEnumerator SpawnElectricalPlate_C()
    {
        GameObject electricalPlate = Instantiate(bossSettings.electricalPlateSettings.platePrefab, transform);

        currentElectricalPlate = electricalPlate.GetComponent <PuzzleEletricPlate>();
        currentElectricalPlate.Desactivate();
        electricalPlate.transform.localScale = new Vector3(1f, 0.1f, 1f);
        Vector3 startPosition = transform.position + Vector3.down * 5f;
        Vector3 endPosition   = transform.position + Vector3.down * -0.1f;

        for (float i = 0; i < 1f; i += Time.deltaTime)
        {
            electricalPlate.transform.position = Vector3.Lerp(startPosition, endPosition, i / 1f);
            yield return(null);
        }
        yield return(new WaitForSeconds(bossSettings.electricalPlateSettings.duration));

        DespawnElectricalPlate();
    }