public void RemovePowerUp(MinifigControllerJ controller) { controller.maxForwardSpeed = initalPlayerSpeed; controller.acceleration = initalPlayerAcceleration; controller.gameObject.GetComponent <JPlayerStats>().powerUpSpeed_IsActive = false; Debug.Log("Removed"); }
GameObject CreateShield(GameObject shieldPrefab, MinifigControllerJ player) { var projectileObj = Instantiate(shieldPrefab, new Vector3(player.transform.position.x, player.transform.position.y + 1, player.transform.position.z), Quaternion.identity) as GameObject; projectileObj.transform.SetParent(player.transform); return(projectileObj); }
void PickUp(Collider player) { MinifigControllerJ controller = player.GetComponent <MinifigControllerJ>(); controller.GetComponent <JPlayerStats>().AddPowerUp(PowerUpType); Instantiate(pickUpEffect, new Vector3(player.transform.position.x, player.transform.position.y + 1, player.transform.position.z), transform.rotation); Destroy(this.gameObject); }
void PickUp(Collider player) { MinifigControllerJ controller = player.GetComponent <MinifigControllerJ>(); controller.maxForwardSpeed *= 2; controller.acceleration *= 2; Destroy(this.gameObject); }
override public void OnStateMachineEnter(Animator animator, int stateMachinePathHash) { animator.SetBool(playSpecialHash, false); if (!minifigController) { minifigController = animator.transform.parent.GetComponent <MinifigControllerJ>(); } }
public IEnumerator ApplyPowerUp(GameObject shieldPrefab, MinifigControllerJ controller) { //player.getcomponent.punchable = false?? // und wenn einmal gepunched dann shild zerstören? var shield = CreateShield(shieldPrefab, controller); controller.punchable = false; Physics.IgnoreLayerCollision(controller.gameObject.layer, 21, true); yield return(new WaitForSeconds(secondsToUse)); Destroy(shield); RemovePowerUp(controller); }
public IEnumerator ApplyPowerUp(MinifigControllerJ controller) { if (!controller.gameObject.GetComponent <JPlayerStats>().powerUpSpeed_IsActive) { initalPlayerAcceleration = controller.acceleration; initalPlayerSpeed = controller.maxForwardSpeed; controller.maxForwardSpeed *= 2; controller.acceleration *= 2; controller.gameObject.GetComponent <JPlayerStats>().powerUpSpeed_IsActive = true; yield return(new WaitForSeconds(secondsToUse)); RemovePowerUp(controller); } }
// Start is called before the first frame update void Start() { box = obstacle.GetComponent <BoxCollider>(); rb = this.GetComponent <Rigidbody>(); collisionDetector = this.GetComponent <CollisionDetector>(); if (collisionDetector.isTeam1 == true) { ownTeam = 1; } else { ownTeam = 2; } controller = GetComponent <CharacterController>(); animator = Minifig.GetComponent <Animator>(); controllerJ = GetComponent <MinifigControllerJ>(); explosion = controllerJ.explodeAudioClip; audio = GetComponent <AudioSource>(); obstacleTransform = obstacle.transform; foreach (GameObject go in GameObject.FindGameObjectsWithTag("Player")) { if (go.Equals(this.gameObject)) { continue; } players.Add(go); } controlScheme = GetComponent <PlayerInput>().defaultControlScheme; if (controlScheme == "AI") { controllerJ.enabled = false; } agent = GetComponent <NavMeshAgent>(); timer = wanderTimer; }
public void RemovePowerUp(MinifigControllerJ controller) { Debug.Log("Removed fireball"); }
public void ApplyPowerUp(MinifigControllerJ controller) { controller.gameObject.GetComponent <JPlayerStats>().fireballCount += 5; Debug.Log("Addd 5 Fireballs"); }
public void RemovePowerUp(MinifigControllerJ controller) { controller.punchable = true; Physics.IgnoreLayerCollision(controller.gameObject.layer, 21, false); Debug.Log("Removed shied"); }