void Update() { if (isActive) { tentaclesOnScreen = GameObject.FindGameObjectsWithTag("Tentacle's father"); for (int i = 0; i < tentaclesOnScreen.Length; i++) { propertiesOfTheTentacle = tentaclesOnScreen [i].transform.GetChild(0).GetComponent <TentacleProperties> (); propertiesOfTheTentacle.tentacleAnimation.SetFloat("runMultiplier", 0.1f); propertiesOfTheTentacle.tentacleAnimation.SetBool("Frozen", true); //propertiesOfTheTentacle.spriteRenderOfTheTentacle.color = Color.blue; propertiesOfTheTentacle.slowdownActivated = true; } isActive = false; gameObject.SetActive(false); } }
void Update() { if (playerLost) { tentaclesOnScreen = GameObject.FindGameObjectsWithTag("Tentacle's father"); spaceshipRenderer.color = Color.white; contentionShieldRenderer.color = Color.white; for (int i = 0; i < tentaclesOnScreen.Length; i++) { propertiesOfTheTentacle = tentaclesOnScreen [i].transform.GetChild(0).GetComponent <TentacleProperties> (); propertiesOfTheTentacle.tentacleAnimation.SetFloat("runMultiplier", 0f); } for (int i = 0; i < powerUpsAndController.Length; i++) { powerUpsAndController [i].SetActive(false); } keyOfPowerUp.enabled = false; playerLost = false; activateTimer = true; pauseScript.enabled = false; shootScript.enabled = false; contentionShieldHealthScript.enabled = false; spaceshipHealthScript.enabled = false; spaceshipSpecialMovementScript.enabled = false; spaceshipMovementeScript.enabled = false; cameraShakeScript.cameraShakeActivated = true; rightFireOfSpaceship.SetActive(false); leftFireOfSpaceship.SetActive(false); } if (activateTimer) { timer += Time.deltaTime; } if (timer >= 2f) { inGameMenu.SetActive(true); youLostImage.SetActive(true); Time.timeScale = 0; } }
void Update() { if (isActive) { tentaclesOnScreen = GameObject.FindGameObjectsWithTag("Tentacle's father"); for (int i = 0; i < tentaclesOnScreen.Length; i++) { tentaclesOnScreen [i].SetActive(false); propertiesOfTheTentacle = tentaclesOnScreen [i].transform.GetChild(0).GetComponent <TentacleProperties> (); propertiesOfTheTentacle.tentacleSpawnController.areEasySpawnPointsActive [propertiesOfTheTentacle.numberOfSpawnWhereIsTheTentacle] = true; if (propertiesOfTheTentacle.typeOfSpawnWhereIsTheTentacle == "medium") { propertiesOfTheTentacle.tentacleSpawnController.areMediumSpawnPointsActive [propertiesOfTheTentacle.numberOfSpawnWhereIsTheTentacle] = true; } if (propertiesOfTheTentacle.typeOfSpawnWhereIsTheTentacle == "hard") { propertiesOfTheTentacle.tentacleSpawnController.areHardSpawnPointsActive [propertiesOfTheTentacle.numberOfSpawnWhereIsTheTentacle] = true; } } isActive = false; gameObject.SetActive(false); } }
public TentacleProperties(TentacleProperties tp) { bendingDegrees = tp.bendingDegrees; bendingRecoverySpeed = tp.bendingRecoverySpeed; modifyRecoverySpeed = tp.modifyRecoverySpeed; rotationSpeedByModify = tp.rotationSpeedByModify; lengthenRatio = tp.lengthenRatio; minLength = tp.minLength; solid = tp.solid; useCylinder = tp.useCylinder; cylinder = tp.cylinder; thickness = tp.thickness; headSize = tp.headSize; tailSize = tp.tailSize; }
//float dd = Random.Range(1.0f, 5.0f); //float ff = Random.Range(1.0f, 5.0f); //void FixedUpdate() //{ // Theta += dd; // Phi += ff; //} void Awake() { TentacleProperties defaultPropertiex = new TentacleProperties(); propertiesDic["default"] = defaultPropertiex; }