Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //Finding Scripts
        controller2D    = GetComponent <NG_CharacterController2D>();
        Nrg             = FindObjectOfType <NG_StatManager>();
        upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();
        animator        = GetComponent <Animator>();

        //Finding components/Children objects
        rb             = GetComponent <Rigidbody2D>();
        playerGraphics = gameObject.transform.Find("Graphics");
        if (playerGraphics == null)
        {
            Debug.Log("No object 'Graphics' can be found as a child of the Player.");
        }
        if (playerGraphics != null)
        {
            graphicScale = playerGraphics.transform.localScale;
        }
        arm = GetComponentInChildren <NG_ThrowArm>().transform;

        curBall  = snowBall;
        canShoot = true;

        gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
        print("Gravity: " + gravity + " Jump Velocity: " + maxJumpVelocity);
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     Stat            = FindObjectOfType <NG_StatManager>();
     weapon          = FindObjectOfType <NG_Weapon>();
     upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();
     normalColor     = GetComponent <SpriteRenderer>().color;
 }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        RB             = GetComponent <Rigidbody2D>();
        curBall        = snowBall;
        anim           = GetComponent <Animator>();
        canShoot       = true;
        playerGraphics = gameObject.transform.Find("Graphics");
        if (playerGraphics == null)
        {
            Debug.Log("No object 'Graphics' can be found as a child of the Player.");
        }
        forcePush      = this.transform.Find("ForcePush").gameObject;
        wallCheckPoint = playerGraphics.Find("WallCheck");


        //Find NG_StatManager on Player
        Nrg = FindObjectOfType <NG_StatManager>();

        //var upgrades = GameObject.Find("UpgradeMenu");
        //Upgrades = upgrades.GetComponent<NG_UpgradeMenu>();
        upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();

        //iceLaunch = FindObjectOfType<NG_IceLaunch>();
        //if (iceLaunch == null)
        //return;

        BC     = FindObjectOfType <BatChase>();
        icicle = FindObjectOfType <IcicleFall>();
    }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     Sno = FindObjectOfType <SnowBall>();
     //Sno = this.gameObject.GetComponent<SnowBall>();
     StartCoroutine(rang());
     stat = FindObjectOfType <NG_StatManager>();
 }
Ejemplo n.º 5
0
 // Use this for initialization
 public override void Start()
 {
     base.Start();
     collisions.faceDir = 1;
     playerScript       = GetComponent <NG_Player>(); //Getting reference to the player input script so I can make the player slip on ice. -NG
     playerStats        = GetComponent <NG_StatManager>();
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        playerStats = GameObject.Find("PlayerCharacter").GetComponent <NG_StatManager>();
        tripWire    = gameObject.transform.GetChild(0).GetComponent <Collider2D>();
        rb          = gameObject.GetComponent <Rigidbody2D>();

        inactiveGravity = rb.gravityScale;
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     //Find NG_StatManager on Player
     PlayerStats = FindObjectOfType <NG_StatManager>();
     Sound       = FindObjectOfType <SoundManager>();
     CPM         = FindObjectOfType <CheckpointManager>();
     //StartCoroutine(drip());
 }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     timeText     = GetComponent <Text>();
     TimeoD       = FindObjectOfType <NG_StatManager>();
     soundManager = FindObjectOfType <SoundManager>();
     tempTime     = startTime;
     maxTime      = startTime;
 }
Ejemplo n.º 9
0
 private void OnEnable()
 {
     player          = FindObjectOfType <NG_Player>();
     playerStats     = FindObjectOfType <NG_StatManager>();
     playerWeapon    = FindObjectOfType <NG_Weapon>();
     scoreManager    = FindObjectOfType <ScoreManager>();
     upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();
     circleMenu      = FindObjectOfType <NG_CircleMenu>();
     UpdateValues();
 }
Ejemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType <NG_Player>();
     stats  = FindObjectOfType <NG_StatManager>();
     if (player.transform.localScale.x < 0)
     {
         angle.x = -angle.x;
     }
     stats.Energy.CurrentVal -= NRG;
 }
Ejemplo n.º 11
0
    private NG_EnemyStatManager enemyStats; //Reference to Enemy stats -NG

    // Use this for initialization
    void Start()
    {
        target = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> ();
        CPM    = FindObjectOfType <CheckpointManager>();
        SM     = FindObjectOfType <SoundManager>();

        //Get NG_StatManager & NG_EnemyStatManager -NG
        playerStats = FindObjectOfType <NG_StatManager>();
        enemyStats  = GetComponent <NG_EnemyStatManager>();
    }
Ejemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        //Find NG_StatManager on Player
        PlayerStats = FindObjectOfType <NG_StatManager>();

        if (chkPntDown.activeInHierarchy == true)
        {
            chkPntUp.SetActive(false);
        }


        Tm = FindObjectOfType <TimeManager>();
    }
Ejemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        player = FindObjectOfType <PlayerController> ();

        RB = FindObjectOfType <Rigidbody2D>();

        SM = FindObjectOfType <NG_StatManager>();

        sound = FindObjectOfType <SoundManager>();
        if (player.transform.localScale.x < 0)
        {
            speed = -speed;
        }
    }
Ejemplo n.º 14
0
    //pushback getters and setters*************************************

    /*public float Pushback
     * { get { return pushback; } set { pushback = value; } }
     * public float PushbackDistance
     * { get { return pushbackDistance; } set { pushbackDistance = value; } }
     * public float PushbackTimer
     * { get { return pushbackTimer; } set { pushbackTimer = value; } }
     * public bool PushedFromRight
     * { get { return pushedFromRight; } set { pushedFromRight = value; } }*/
    //*******************************************************************

    //actually we are using this for initialization -NG
    private void Awake()
    {
        enemyHealth.Initialize();

        healthBarFollow = GetComponent <NG_BarFollow>();
        if (healthBarFollow == null)
        {
            Debug.Log("NG_BarFollow.cs has not been assigned to the enemy.");
        }
        Stat            = FindObjectOfType <NG_StatManager>();
        weapon          = FindObjectOfType <NG_Weapon>();
        upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();
        tmpSpeed        = moveSpeed;
    }
Ejemplo n.º 15
0
 // Use this for initialization
 void Start()
 {
     RB    = GetComponent <Rigidbody2D>();
     SM    = FindObjectOfType <NG_StatManager>();
     sound = FindObjectOfType <SoundManager>();
     //Assigning the player script -NG
     player = FindObjectOfType <NG_Player>();
     sound.snoSound();
     SM.Energy.CurrentVal--;
     SM.Energy.CurrentVal--;
     //Check to see if the player is facing left -NG
     if (player.transform.localScale.x < 0)
     {
         throwSpeed = -throwSpeed;
     }
 }
Ejemplo n.º 16
0
    private void Start()
    {
        playerStats = FindObjectOfType <NG_StatManager>();
        upgradeMenu = FindObjectOfType <NG_UpgradeMenu>();
        circleMenu  = FindObjectOfType <NG_CircleMenu>();
        score       = FindObjectOfType <ScoreManager>();
        if (score == null)
        {
            Debug.Log("ScoreManager didn't load between scenes.");
        }

        highestShards = score.shardCount;
        highestHealth = playerStats.Health.MaxVal;
        highestEnergy = playerStats.Energy.MaxVal;
        highestLives  = playerStats.MaxLives;
    }
Ejemplo n.º 17
0
    // Use this for initializati
    void Start()
    {
        Manager = FindObjectOfType <NG_StatManager> ();

        rb = GetComponent <Rigidbody2D> ();

        Shoot = FindObjectOfType <KA_AIShoot> ();

        if (Shoot.transform.localScale.x < 0)
        {
            speed = -speed;
        }

        player = GameObject.FindGameObjectWithTag("Player").transform;

        //target = new Vector2 (player.position.x, player.position.y);
    }
Ejemplo n.º 18
0
    // Use this for initialization
    void Start()
    {
        SM   = FindObjectOfType <SoundManager>();
        RB   = GetComponent <Rigidbody2D>();
        stat = FindObjectOfType <NG_StatManager>();
        SM.snoSound();

        //Assigning the player script -NG
        player = FindObjectOfType <NG_Player>();
        weapon = FindObjectOfType <NG_Weapon>();

        stat.Energy.CurrentVal -= NRG;
        player.CurBallCost      = NRG;
        //Check to see if the player is facing left -NG
        if (player.transform.localScale.x < 0)
        {
            throwSpeed = -throwSpeed;
        }
    }
Ejemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     player      = FindObjectOfType <NG_Player>();
     playerStats = FindObjectOfType <NG_StatManager>();
     sounds      = FindObjectOfType <SoundManager>();
 }
Ejemplo n.º 20
0
 // Use this for initialization
 void Start()
 {
     SM    = FindObjectOfType <NG_StatManager>();
     sound = FindObjectOfType <SoundManager>();
 }
Ejemplo n.º 21
0
 // Use this for initialization
 void Start()
 {
     SM    = FindObjectOfType <NG_StatManager>();
     sound = FindObjectOfType <SoundManager>();
     StartCoroutine(SpikeHit());
 }
Ejemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     rb    = GetComponent <Rigidbody2D>();
     stats = FindObjectOfType <NG_StatManager>();
 }
Ejemplo n.º 23
0
 // Use this for initialization
 void Start()
 {
     RB    = FindObjectOfType <Rigidbody2D>();
     SM    = FindObjectOfType <NG_StatManager>();
     sound = FindObjectOfType <SoundManager>();
 }
Ejemplo n.º 24
0
 private void Start()
 {
     playerStats = GameObject.Find("PlayerCharacter").GetComponent <NG_StatManager>();
     normalColor = fallPlat.GetComponent <SpriteRenderer>().color;
 }
Ejemplo n.º 25
0
 private void Start()
 {
     Stat = FindObjectOfType <NG_StatManager>();
 }
Ejemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     stat   = FindObjectOfType <NG_StatManager>();
     SM     = FindObjectOfType <SoundManager>();
 }