コード例 #1
0
    // Use this for initialization
    void Start()
    {
        // Get necessary components
        healthScript = GetComponent<Script_PlayerHealth>();
        healthScript.EventRespawn += EnablePlayer;

        crossHairImage = GameObject.Find("Crosshair Image").GetComponent<Image>();

        respawnUI = GameObject.Find("Canvas").transform.GetChild(3).gameObject;
        respawnTimeText = respawnUI.transform.GetChild(1).GetComponent<Text>();

        // Set initial time that counts down
        countdownTime = respawnTime;

        if (isLocalPlayer)
        {
            InvokeRepeating("CountdownTimer", 0f, 1.0f);
        }
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     crossHairImage         = GameObject.Find("SimpleCrosshairImage").GetComponent <Image>();
     healthScript           = GetComponent <Script_PlayerHealth>();
     healthScript.EventDie += DisablePlayer;
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     crossHairImage = GameObject.Find("SimpleCrosshairImage").GetComponent<Image>();
     healthScript = GetComponent<Script_PlayerHealth>();
     healthScript.EventDie += DisablePlayer;
 }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        blueSpawnPoints = GameObject.FindGameObjectsWithTag("BlueSpawn");
        redSpawnPoints = GameObject.FindGameObjectsWithTag("RedSpawn");

        healthScript = GetComponent<Script_PlayerHealth>();
        healthScript.EventRespawn += EnablePlayer;
        crossHairImage = GameObject.Find("SimpleCrosshairImage").GetComponent<Image>();
        SetRespawnButton();
    }