Exemple #1
0
    void Start()
    {
        spawnPos           = GameObject.Find("SpawnPositions/Spawn_" + gameObject.tag);
        livesText          = GameObject.Find("Canvas/InGameUI/lives_" + gameObject.tag).GetComponent <Text>() as Text;
        damageText         = GameObject.Find("Canvas/InGameUI/damage_" + gameObject.tag).GetComponent <Text>() as Text;
        transform.position = spawnPos.transform.position;
        Instantiate(spawnEffect, transform.position, Quaternion.identity);
        UpdateLifeText();
        UpdateDamageText();
        jumpPad       = GameObject.Find(Tags.str_jumpPad);
        jumpPadScript = jumpPad.GetComponent <jumpPadScript>();

        playerRigidbody = GetComponent <Rigidbody>();
        player          = this.gameObject;

        controller = GetComponent <Controller>();

        playerRigidbody.mass = 10;
    }
Exemple #2
0
    void Start()
    {
        spawnPos = GameObject.Find("SpawnPositions/Spawn_"+gameObject.tag);
        livesText = GameObject.Find("Canvas/InGameUI/lives_" + gameObject.tag).GetComponent<Text>() as Text;
        damageText = GameObject.Find("Canvas/InGameUI/damage_" + gameObject.tag).GetComponent<Text>() as Text;
        transform.position = spawnPos.transform.position;
        Instantiate(spawnEffect, transform.position, Quaternion.identity);
        UpdateLifeText();
        UpdateDamageText();
        jumpPad = GameObject.Find(Tags.str_jumpPad);
        jumpPadScript = jumpPad.GetComponent<jumpPadScript>();

        playerRigidbody = GetComponent<Rigidbody>();
        player = this.gameObject;

        controller = GetComponent<Controller>();

        playerRigidbody.mass = 10;
    }