public EnemySpawner(Vector3 pos, Directions directionFromPlayer, SwordCombat parent) { enemies = new List <enemy>(); TopLevel = parent; StartingPosition = pos; initialDirection = directionFromPlayer; AttackVector = -1 * pos.normalized; }
// Use this for initialization void Start() { //define what % of the screen is needed to be touched for a swipe to register //dragDistance = Screen.height * 15 / 100; playerPrefab = Resources.Load("Prefabs/Player") as GameObject; player = Instantiate(playerPrefab); script = player.GetComponent <SwordCombat>(); }
public enemy(Vector3 pos, Vector3 approachSpeed, EnemyType type_in, SwordCombat parent) { source = Instantiate(enemyPrefab); source.transform.position = pos; au_source = source.GetComponent <AudioSource>(); au_source.clip = enemyNoises[(int)type_in]; au_source.Play(); source.GetComponent <Rigidbody>().velocity = approachSpeed; source.GetComponent <EnemyLogic>().currentInstance = parent; source.GetComponent <EnemyLogic>().has_attacked_flag = false; source.GetComponent <EnemyLogic>().attack_delay = parent.attack_delay; this.parent = parent; parent.active_enemies++; type = type_in; weakness = (PlayerWeapons)type_in; }
// Use this for initialization void Start() { source = GetComponent <AudioSource>(); mode = Resources.Load("Sounds/BetaVoicelines/SurvivalGameModeSelect") as AudioClip; playerPrefab = Resources.Load("Prefabs/Player") as GameObject; player = Instantiate(playerPrefab); script = player.GetComponent <SwordCombat>(); screen_tear = GameObject.Find("/Canvas/Screen_Tear"); screen_tear.SetActive(false); script.screen_tear = screen_tear; StartCoroutine(playSound()); }
public enemy(Vector3 pos, Vector3 approachSpeed, SwordCombat parent) : this(pos, approachSpeed, (EnemyType)UnityEngine.Random.Range(0, numberOfEnemies), parent) { }