private void Start() { if (randomCharisma == true) { //Debug.Log("Random charisma"); spawnEntitiesScript = FindObjectOfType <SpawnEntitiesAtRandom>(); if (spawnEntitiesScript != null) { startingCharisma = Random.Range(spawnEntitiesScript.takerMinChar, spawnEntitiesScript.takerMaxChar); } else { startingCharisma = Random.Range(minStartingCharisma, maxStartingCharisma); } GetComponent <SphereOfInfluence>().currentCharisma = startingCharisma; } else { Debug.Log("Inherited charisma"); } rigidbody = GetComponent <Rigidbody>(); startingPosition = transform.position; roamingPosition = GetRoamingPosition(); hitPointsManager = GetComponent <HitPointsManager>(); playParticleEffect = GetComponent <PlayParticleEffect>(); }
//public AudioClip deathSound; void Start() { currentHitPoints = maxHitPoints; deathEffect = GetComponent <PlayParticleEffect>(); mainCamera = Camera.main; // DEBUG: Show entity name. if (entityName != null) { entityName.text = this.name.ToString(); } if (healthBar != null) { healthBar.SetMaxHealth(maxHitPoints); } }
void Start() { gameSettings = FindObjectOfType <GameManager>(); isIdle = true; isWalking = false; //animator = GetComponentInChildren<Animator>(); /* * forward = Camera.main.transform.forward; * forward.y = 0; * forward = Vector3.Normalize(forward); * right = Quaternion.Euler(new Vector3(0, 90, 0)) * forward; */ currentCharisma = startingCharisma; hitPointsManager = GetComponent <HitPointsManager>(); playParticleEffect = GetComponent <PlayParticleEffect>(); }