示例#1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.CompareTag("PlayerWall"))
     {
         PlayerWall wall = collision.collider.GetComponent <PlayerWall>();
         //wall.StopGrowing();
         gm.GameOver();
         Explode();
     }
 }
示例#2
0
    void Awake()
    {
        Animator     = GetComponent <Animator>();
        PlayerStatus = GetComponent <PlayerStatus>();
        Rigidbody    = GetComponent <Rigidbody2D>();

        PlayerGround            = new PlayerGround(this);
        PlayerGroundDash        = new PlayerGroundDash(this);
        PlayerAirDash           = new PlayerAirDash(this);
        PlayerWallDash          = new PlayerWallDash(this);
        PlayerAir               = new PlayerAir(this);
        PlayerJump              = new PlayerJump(this);
        PlayerTakingDamage      = new PlayerTakingDamage(this);
        PlayerAttackWeakGround  = new PlayerAttackWeakGround(this);
        PlayerAttackWeakAir     = new PlayerAttackWeakAir(this);
        PlayerAttackHeavyGround = new PlayerAttackHeavyGround(this);
        PlayerAttackHeavyAir    = new PlayerAttackHeavyAir(this);
        PlayerWall              = new PlayerWall(this);

        input = GetComponent <IInput>();
    }
示例#3
0
    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();
        }
    }