Ejemplo n.º 1
0
 public void RemovePowerUp(MinifigControllerJ controller)
 {
     controller.maxForwardSpeed = initalPlayerSpeed;
     controller.acceleration    = initalPlayerAcceleration;
     controller.gameObject.GetComponent <JPlayerStats>().powerUpSpeed_IsActive = false;
     Debug.Log("Removed");
 }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
    }
Ejemplo n.º 4
0
    void PickUp(Collider player)
    {
        MinifigControllerJ controller = player.GetComponent <MinifigControllerJ>();

        controller.maxForwardSpeed *= 2;
        controller.acceleration    *= 2;
        Destroy(this.gameObject);
    }
Ejemplo n.º 5
0
 override public void OnStateMachineEnter(Animator animator, int stateMachinePathHash)
 {
     animator.SetBool(playSpecialHash, false);
     if (!minifigController)
     {
         minifigController = animator.transform.parent.GetComponent <MinifigControllerJ>();
     }
 }
Ejemplo n.º 6
0
    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);
    }
Ejemplo n.º 7
0
    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);
        }
    }
Ejemplo n.º 8
0
    // 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;
    }
Ejemplo n.º 9
0
 public void RemovePowerUp(MinifigControllerJ controller)
 {
     Debug.Log("Removed fireball");
 }
Ejemplo n.º 10
0
 public void ApplyPowerUp(MinifigControllerJ controller)
 {
     controller.gameObject.GetComponent <JPlayerStats>().fireballCount += 5;
     Debug.Log("Addd 5 Fireballs");
 }
Ejemplo n.º 11
0
 public void RemovePowerUp(MinifigControllerJ controller)
 {
     controller.punchable = true;
     Physics.IgnoreLayerCollision(controller.gameObject.layer, 21, false);
     Debug.Log("Removed shied");
 }