private void Start() { _gameManager = GameManager.currentManager; _hexEditor = _gameManager._hexMapEditor; _nutrientManager = NutrientManager.currentNutrientManager; _camera = Camera.main; }
public GameObject nutrientLostSound; //!< for holding a reference to the nutrient lost sound /** * the function to generate what nutrients are on the food blob */ public void GenerateEnzymes(int minNutrients, int maxNutrients, Color[] availableColors) { NumNutrients = Random.Range(minNutrients, maxNutrients + 1); // randomly choose the number of nutrients on the blob // find a reference to the current nutrient manager and game manager m_NutrientManager = FindObjectOfType(typeof(NutrientManager)) as NutrientManager; m_GameManager = FindObjectOfType(typeof(IntestineGameManager)) as IntestineGameManager; // populate the number of nutrients decided earlier for (int i = 0; i < NumNutrients; i++) { float radius = .4f; // choose .4f as a radius to start with float angle = ((2 * Mathf.PI) / NumNutrients) * i; // divide the circle into the right number of angle chunks in rads float xPos = radius * Mathf.Cos(angle); // find the x position as radius*cos(theta) float zPos = radius * Mathf.Sin(angle); // find the y position as radius*sin(theta) Vector3 position = transform.position; // 3 dimensional vector for position position.x += xPos; // set the x position of the vector position.z += zPos; // set the z position of the vector position.y = .5f; // set the y position of the vector // randomly choose a color for the nutrient int randomIndex = MDPUtility.RandomInt(availableColors.Length); Nutrient nutrient = m_NutrientManager.InstantiateNutrient(availableColors[randomIndex], position); nutrient.intestineGameManager = m_GameManager; // assign the game manager reference on the nutrient to be // the same as the one referenced in this class // Attach new enzyme as a child object nutrient.transform.parent = gameObject.transform; ((Behaviour)nutrient.GetComponent("Halo")).enabled = false; // halo should be false unless explicitly enabled } }
private void Start() { _nutrientManager = NutrientManager.currentNutrientManager; originalTextColor = nutrientCostText.color; _audioManager = FindObjectOfType <AudioManager>(); StopMusic(); treeScoreText.text = "Trees: " + touchedTrees.Count + "/" + treesInScene.Count; }
private void Awake() { if (currentNutrientManager == null) { currentNutrientManager = this; } else { Destroy(this); } }
private Color Fats1Color = new Color(37f / 255f, 97f / 255f, 139f / 255f, 1); //!< create a new color for the Fats1 Particles /** * Use this for initialization * Find manager, set variables, set parent. */ void Start() { nutrientManager = FindObjectOfType(typeof(NutrientManager)) as NutrientManager; // find the nutrient manager Collider = new CircleCollider(this); // add a circle collider to the nutrient IsTargetted = false; // the nutrient starts off not tragetted // assign the parent reference if the nutrient has one (which it should) if (gameObject.transform.parent) { m_Parent = gameObject.transform.parent.gameObject; } }
private bool m_CanFire; //!< a flag that says whether a tower can currently fire /** * Use this for initialization * INitializes tower values on spawn */ void Start() { gameObject.layer = LayerMask.NameToLayer("Tower"); // move the tower to the tower layer once placed // make sure we aren't in tutorial if (Application.loadedLevelName != "SmallIntestineTutorial") { // if we aren't in the tutorial get the debugger debugConfig = ((GameObject)GameObject.Find("Debug Config")).GetComponent <DebugConfig>(); if (debugConfig.debugActive) // if we're using the debugger get the costs from there { TOWER_BASE_COST = debugConfig.TOWER_BASE_COST; TOWER_UPGRADE_LEVEL_1_COST = debugConfig.TOWER_UPGRADE_LEVEL_1_COST; TOWER_UPGRADE_LEVEL_2_COST = debugConfig.TOWER_UPGRADE_LEVEL_2_COST; } } m_Cooldown = BaseCooldown; // set the base cooldown m_CurrentCooldown = m_Cooldown; // initialize the cooldown timer m_CanFire = true; // set that the tower can fire m_NutrientManager = GameObject.Find("Managers").GetComponent <NutrientManager>(); // find the nutrient manager m_GameManager = GameObject.Find("Managers").GetComponent <IntestineGameManager>(); // find the game manager }
// Start is called before the first frame update void Start() { GetCellLocation(); //GameManager.onTurnEnd += NewCycle; //GameManager.nutrientEvent += GetNutrients; // GameManager.addExpansionEvent += CheckNeighbors; GameManager.currentManager.treesInScene.Add(this); _nutrientManager = NutrientManager.currentNutrientManager; _weatherManager = WeatherManager.currentWeatherManager; _collectableManager = GameManager.currentManager._sugarCollectableAnimation; _skinnedMeshRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); skinnedMesh = _skinnedMeshRenderer.sharedMesh; newBlendValue = oldBlendValue; oldTreeLeavesNumber = treeLeavesNumber; treeText = gameObject.GetComponent <DisplayUI>().myText; //healthyTreeDetails = healthyTreeVisualsContainer.GetComponentsInChildren<SkinnedMeshRenderer>(); upgradeParticles = particleContainer.GetComponentsInChildren <ParticleSystem>(); TreeVisualChange(); }
private void Start() { _nutrientManager = NutrientManager.currentNutrientManager; _gameManager = GameManager.currentManager; fungiNeighbor = true; }