コード例 #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);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        checkPoint      = FindObjectOfType <CheckpointManager>();
        Score           = FindObjectOfType <ScoreManager>();
        enemyStats      = FindObjectOfType <NG_EnemyStatManager>();
        upgradeProgress = FindObjectOfType <NG_UpgradeProgress>();
        audio           = FindObjectOfType <SoundManager>();
        controller2D    = GetComponent <NG_CharacterController2D>();

        LoadPlayerUpgrades();
        health.CurrentVal = health.MaxVal;
        maxLives          = upgradeProgress.highestLives;
        curLives          = maxLives;

        //health.MaxVal = 3;
        //energy.MaxVal = 10;
    }
コード例 #3
0
ファイル: NG_IceLaunch.cs プロジェクト: ninja-n8/Frost-Fight
 // Use this for initialization
 void Start()
 {
     controller2D = FindObjectOfType <NG_CharacterController2D>();
     minScale     = pillar.transform.localScale;
 }
コード例 #4
0
 private void Start()
 {
     player       = GetComponent <NG_Player>();
     controller2D = GetComponent <NG_CharacterController2D>();
 }