// Use this for initialization private void Start() { m_CharacterController = GetComponent <CharacterController>(); m_Camera = Camera.main; m_OriginalCameraPosition = m_Camera.transform.localPosition; m_FovKick.Setup(m_Camera); m_HeadBob.Setup(m_Camera, m_StepInterval); m_StepCycle = 0f; m_NextStep = m_StepCycle / 2f; m_Jumping = false; m_AudioSource = GetComponent <AudioSource>(); m_MouseLook.Init(transform, m_Camera.transform); m_Animator = GetComponent <Animator>(); m_ForwardAmount = 0f; m_UpwardAmount = 0f; m_PlayerCrouch = GetComponent <PlayerCrouch>(); GameObject obj = GameObject.Find("Manager(Clone)"); m_ScoreManager = obj.GetComponent <ScoreManager>(); Assert.IsNotNull(m_ScoreManager); }
void Start() { boxCollider = GetComponent <BoxCollider2D>(); circleCollider = GetComponent <CircleCollider2D>(); goodSpawn = GameObject.Find("EndSpawnBack"); groundCheck = transform.Find("groundCheck"); frontCheckTop = new GameObject("frontCheckTop"); frontCheckBot = new GameObject("frontCheckBot"); playerJump = GetComponent <PlayerJump>(); playerWall = GetComponent <PlayerWall>(); playerRun = GetComponent <PlayerRun>(); playerCrouch = GetComponent <PlayerCrouch>(); playerDash = GetComponent <PlayerDash>(); playerPlatform = GetComponent <PlayerPlatform>(); normalRotation = transform.localRotation; animator = GetComponent <Animator>(); pickup = GetComponent <Pickup>(); cam = GetComponentInChildren <CameraFollowFinal> (); came = GameObject.FindWithTag("MainCamera"); frontCheckTop.transform.parent = transform; frontCheckBot.transform.parent = transform; sG = (Resources.Load("Weapons/Sounds/ReloadShotgun")) as AudioClip; wG = (Resources.Load("Weapons/Sounds/ReloadWatergun")) as AudioClip; bulletPrefab = (Resources.Load("Weapons/Rocket/Player Bullet")) as GameObject; rocketKick = (Resources.Load("Weapons/WeaponKicks/RocketKick")) as GameObject; shotgunBullet = (Resources.Load("Weapons/Shotgun/ShotgunSpraySystem")) as GameObject; shotgunKick = (Resources.Load("Weapons/WeaponKicks/ShotgunKick")) as GameObject; staffBullet = (Resources.Load("Weapons/Staff/Fireball")) as GameObject; granadeBullet = (Resources.Load("Weapons/Granade/Granade2")) as GameObject; watergunBullet = (Resources.Load("Weapons/Watergun/WaterGunBullet")) as GameObject; watergunKick = (Resources.Load("Weapons/WeaponKicks/WatergunKick")) as GameObject; machinegunBullet = (Resources.Load("Weapons/Machinegun/MachineGunBullet")) as GameObject; machinegunKick = (Resources.Load("Weapons/WeaponKicks/MachinegunKick")) as GameObject; boomerangBullet = (Resources.Load("Weapons/Boomerang/Boomerang2")) as GameObject; power = (Resources.Load("Weapons/Staff/Power")) as GameObject; boom = (Resources.Load("Weapons/Staff/Boom")) as GameObject; Launch = (Resources.Load("Weapons/Sounds/DoodleRocketLaunch")) as AudioClip; shotgunShot = (Resources.Load("Weapons/Sounds/DoodleShotgunShot")) as AudioClip; staffShot = (Resources.Load("Weapons/Sounds/DoodleStaffShot")) as AudioClip; staffBoom = (Resources.Load("Weapons/Sounds/DoodleStaffSlam")) as AudioClip; granadeShot = (Resources.Load("Weapons/Sounds/DoodleGranadeThrow")) as AudioClip; watergunShot = (Resources.Load("Weapons/Sounds/DoodleWatergun")) as AudioClip; machinegunShot = (Resources.Load("Weapons/Sounds/DoodleMachinegunFire")) as AudioClip; boomerangShot = (Resources.Load("Weapons/Sounds/DoodleGranadeThrow")) as AudioClip; outOfAmmo = (Resources.Load("Weapons/Sounds/Click")) as AudioClip; fightButton = GameObject.Find("Fight"); fightButton.SetActive(false); //transform.position = ss.transform.position; if (spriteDirection == Direction.Right) { facingRight = true; } else { facingRight = false; Flip(); } }