コード例 #1
0
 //initializes objects and sets up animator
 void Start()
 {
     gm             = FindObjectOfType <GM>();
     pHealth        = FindObjectOfType <HealthDepletion>();
     playerRb       = GetComponent <Rigidbody>();
     playerCollider = GetComponent <CapsuleCollider>();
     jointRbs       = characterGameObj.GetComponentsInChildren <Rigidbody>();
     jointCols      = characterGameObj.GetComponentsInChildren <Collider>();
     inputCtrl      = FindObjectOfType <FWSInput>();
     initPlayerPos  = transform.position;
     isDead         = false;
     DisableRagdoll();
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        phase = Phases.EXPLORE;

        frozen = false;

        //init GO's
        currLevel = SceneManager.GetActiveScene();

        //for restart array
        interactables    = GameObject.FindGameObjectsWithTag("Interactable");
        hazards          = GameObject.FindGameObjectsWithTag("Hazard");
        normCollectibles = GameObject.FindGameObjectsWithTag("normieCollectible");
        healCollectibles = GameObject.FindGameObjectsWithTag("healCollectible");
        golCollectables  = GameObject.FindGameObjectsWithTag("scoreCollectible");

        GenerateObjectArrays(interactables, i_positions, i_rotations);
        GenerateObjectArrays(hazards, h_positions, h_rotations);
        GenerateObjectArrays(normCollectibles, nc_positions, nc_rotations);
        GenerateObjectArrays(healCollectibles, hc_positions, hc_rotations);
        GenerateObjectArrays(golCollectables, gc_positions, gc_rotations);

        resetLevel  = false;
        gameOver    = false;
        touchHazard = false;

        relic.SetActive(true);

        hd        = FindObjectOfType <HealthDepletion>();
        inputCtrl = FindObjectOfType <FWSInput>();
        pCtrl     = FindObjectOfType <SideScrollController>();
        healthVal = hd.healthVal;

        startTime = 6000;

        mode = SoundManager.mode;

        //mode = Modes.ENDLESS;

        if (mode == Modes.CLASSIC || mode == Modes.ENDLESS || mode == Modes.SOULLESS)
        {
            gCtrl.shots = 0;
        }
        else if (mode == GM.Modes.LIMSWINGS)
        {
            gCtrl.shots = 15;
        }
        if (mode == Modes.ENDLESS)
        {
            clock.rectTransform.sizeDelta      *= 3;
            clock.gameObject.transform.position = new Vector3(clock.transform.position.x, clock.transform.position.y + 3, clock.transform.position.z);
        }

        if (mode == Modes.SOULLESS)
        {
            timer = 0;
        }

        levelName = currLevel.name;
        if (levelName.Equals("Tutorial-pass2"))
        {
            level = Levels.TUTORIAL;
        }
        else if (levelName.Equals("Level_1-pass3"))
        {
            level = Levels.LEVEL1;
        }
        else if (levelName.Equals("Level_2-new"))
        {
            level = Levels.LEVEL2;
        }
        else if (levelName.Equals("Level_3_pass2"))
        {
            level = Levels.LEVEL3;
        }
    }
コード例 #3
0
 private void Start()
 {
     gm    = FindObjectOfType <GM>();
     hd    = FindObjectOfType <HealthDepletion>();
     pCtrl = FindObjectOfType <SideScrollController>();
 }