public void Start() { maxHealth = Health; _randomSound = GetComponent <PlayRandomSound>(); _knockback = GetComponent <Knockback>(); }
// Use this for initialization void Start () { rndSoundPlayer = GetComponent<PlayRandomSound>(); if(spawnOnStart) Spawn (); }
void Start() { //rigidbody = GetComponent<Rigidbody>(); attackSound = GetComponent <PlayRandomSound>(); navMeshAgent = GetComponent <NavMeshAgent>(); startingPosition = transform.position; currentState = State.Idle; // Find the player. player = GameObject.FindGameObjectWithTag("Player"); agentCollider = GetComponent <Collider>(); // Start with default colors. ChangeMaterial(clothes, idleMaterial); ChangeMaterial(skin, skinMaterial); }
void Start() { spawnEntitiesScript = FindObjectOfType <SpawnEntitiesAtRandom>(); rigidbody = GetComponent <Rigidbody>(); attackSound = GetComponent <PlayRandomSound>(); navMeshAgent = GetComponent <NavMeshAgent>(); navMeshAgent.SetDestination(destination.position); gameManager = FindObjectOfType <GameManager>(); currentState = State.Idle; isClickable = false; overrideTarget = false; isTraitor = false; startBetrayal = false; isAttackTarget = false; isConversionTarget = false; leveledUp = false; attackCurrentTime = attackTimer; attackDamage = initialDamage; convertCooldown = initialConvertCooldown; // Generate random charisma. if (spawnEntitiesScript != null) { startingCharisma = Random.Range(spawnEntitiesScript.followerMinChar, spawnEntitiesScript.followerMaxChar); } else { startingCharisma = Random.Range(minStartingCharisma, maxStartingCharisma); } currentCharisma = startingCharisma; currentLoyalty = startingLoyalty; currentViolence = startingViolence; mainCamera = Camera.main; // Find the player. player = GameObject.FindGameObjectWithTag("Player"); agentCollider = GetComponent <Collider>(); ChangeMaterial(clothes, idleMaterial); ChangeMaterial(skin, skinMaterial); }