void TentacleSpawn() { GameObject go_TentacleClone; if(!bl_Spawned) { go_TentacleClone = (GameObject) Instantiate(go_Tentacle, new Vector3(transform.position.x - 10f, go_Water.transform.position.y - 2f, 0f), Quaternion.identity); lt_Tentacles.Add (go_TentacleClone); go_TentacleClone = (GameObject) Instantiate(go_Tentacle, new Vector3(transform.position.x - 20f, go_Water.transform.position.y - 2f, 0f), Quaternion.identity); lt_Tentacles.Add (go_TentacleClone); go_TentacleClone = (GameObject) Instantiate(go_Tentacle, new Vector3(transform.position.x - 30f, go_Water.transform.position.y - 2f, 0f), Quaternion.identity); lt_Tentacles.Add (go_TentacleClone); TentacleScript = go_TentacleClone.GetComponent<TL_TentacleThrust>(); bl_Spawned = true; } }
void TentacleStages(MPI_Level_Manager.DifficultyLevel dl_States) { switch(dl_States) { case MPI_Level_Manager.DifficultyLevel.Medium: if(fl_StageCooldown < Time.realtimeSinceStartup) { bl_Activate = !bl_Activate; if(lt_Tentacles[0].gameObject != null) { TentacleScript = lt_Tentacles[0].GetComponent<TL_TentacleThrust>(); TentacleScript.enabled = bl_Activate; } if(lt_Tentacles[2].gameObject != null) { TentacleScript = lt_Tentacles[2].GetComponent<TL_TentacleThrust>(); TentacleScript.enabled = bl_Activate; } fl_StageCooldown = 1.5f + Time.realtimeSinceStartup; } break; case MPI_Level_Manager.DifficultyLevel.Hard: if(fl_StageCooldown < Time.realtimeSinceStartup) { bl_Activate = !bl_Activate; if(lt_Tentacles[0].gameObject != null) { TentacleScript = lt_Tentacles[0].GetComponent<TL_TentacleThrust>(); TentacleScript.enabled = !bl_Activate; } if(lt_Tentacles[1].gameObject != null) { TentacleScript = lt_Tentacles[1].GetComponent<TL_TentacleThrust>(); TentacleScript.enabled = bl_Activate; } if(lt_Tentacles[2].gameObject != null) { TentacleScript = lt_Tentacles[2].GetComponent<TL_TentacleThrust>(); TentacleScript.enabled = bl_Activate; } fl_StageCooldown = 1.5f + Time.realtimeSinceStartup; } break; } }