private void Start() { playerID = "P1_"; Tower.TowerTeam = team; Tower.Init(this); Helper = Tower.returnHelper(); Helper.INIT(this, this.team); status = new STATUS(); Gun newGun = new Gun(100, 20, 1.5f, 1, 1, 1); status.changeWeapon(newGun); status.getCurrentweapon.Attack = 1; Invoke("InIt", 2); skillparticle = GetComponentInChildren <ParticleSystem>(); c = GetComponentInChildren <Camera>(); spark = GetComponentInChildren <ParticleSystem>(); playerMarker = icon.GetComponent <SpriteRenderer>().sprite; }
public void INIT(B_Player p) { anim = GetComponent <Animator>(); player = p; ag = GetComponent <NavMeshAgent>(); status = new STATUS(); int selecting = UnityEngine.Random.Range(0, 3); switch (selecting) { case 0: aiType = CpuType.aggressive; break; case 1: aiType = CpuType.balanced; break; case 2: aiType = CpuType.defensive; break; default: aiType = CpuType.aggressive; break; } Weapon wp = new Gun(100, 25, 1f, 1, 1, 1); status.changeWeapon(wp); player.Tower.gameObject.AddComponent <AttackingDetector>(); player.Tower.GetComponent <AttackingDetector>().brainConnetting(this); cpu = new PlayerCPU(anim, player, ag, status, this.transform); cpu.findNewTarget(); ag.speed = 20; GetComponentInChildren <BulletSpawner>().INITIALIZING(player); player.reciveAnimator(anim); initialized = true; tm = player.team; player.onDead(); isfrozen = false; rb = GetComponent <Rigidbody>(); coll = GetComponent <CapsuleCollider>(); BulletSpawner spawner = GetComponentInChildren <BulletSpawner>(); spawner.INITIALIZING(player); }