// Use this for initialization void Start() { //Find the Player, their inventory, as well as the dropoff point playerObject = GameObject.Find("Player"); inventoryLocation = GameObject.Find("Player_Inventory"); inventoryDropoff = GameObject.Find("Player_Inventory_Dropoff"); //Gets the instance of the Player_Pickup script on the Player object pickUpObjects = playerObject.GetComponent <Player_Pickup>(); //Creates a new List of GameObjects inventory = new List <GameObject>(); }
private void Start() { jump = gameObject.AddComponent <Jump>(); jump.SetVals(jumpSpeed, MAX_JUMPS, wallJump, this); eightWayMovement = gameObject.AddComponent <EightWayMovement>(); eightWayMovement.SetVals(walkingspeed, turnSpeed, RunningSpeed); dash = gameObject.AddComponent <Dash>(); dash.SetVals(DashSpeed, dashDuration); weaponManager = gameObject.AddComponent <Weapon_Manager>(); weaponManager.SetVals(InputType, items, gameObject, WeaponAttackObj, powerUpTime); playerHealth = gameObject.AddComponent <PlayerHealth>(); playerHealth.SetVals(health, numOfHearts, hearts, fullHeart, emptyHeart); playerPickup = gameObject.AddComponent <Player_Pickup>(); playerPickup.SetVals(SnapZone, throwForce, this); vehicle = gameObject.AddComponent <GetIntoVehicle>(); vehicle.SetVal(this); pushScript = gameObject.AddComponent <Pushing_Script>(); pushScript.SetVals(pushSpeed, this); }