Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(transform.gameObject);

        controllerThing = GameObject.Find("Controller Thing");
        controller      = controllerThing.GetComponent <ControllerThing>();
        abilities       = controllerThing.GetComponent <PlayerAbilityController>();
        cooldowns       = controllerThing.GetComponent <PlayerCDController>();
        health          = GetComponent <Health>();
        anim            = GetComponent <Animator>();
        h2 = health.health;
    }
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(transform.gameObject);
        healVisual = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
        healVisual.SetActive(false);
        DontDestroyOnLoad(healVisual);

        healVisual.GetComponent <Renderer>().material.color = Color.green;
        controllerThing = GameObject.Find("Controller Thing");

        controller = controllerThing.GetComponent <ControllerThing>();
        abilities  = controllerThing.GetComponent <PlayerAbilityController>();
        cooldowns  = controllerThing.GetComponent <PlayerCDController>();
        health     = GetComponent <Health>();
        anim       = GetComponent <Animator>();
        h2         = health.health;
    }
    // Use this for initialization
    void Start()
    {
        controllerThing = GameObject.Find("Controller Thing");
        controller      = controllerThing.GetComponent <ControllerThing>();
        players         = new GameObject[4];
        playerHealth    = new Health[4];
        texts           = GetComponentsInChildren <Text>();
        images          = GetComponentsInChildren <Image>();
        timer           = 600;
        bossHealth      = boss.GetComponent <Health>();
        playerCooldowns = controller.GetComponent <PlayerCDController>();
        healths1        = new float[4];

        healths2 = new float[4];

        // Assigns players to slots based on IDs, for use with UI placement.
        //IE: Tank is in the top left, always.
        //This might be changed to player positions. So P1 is in the top left, P2 top right, etc
        for (int i = 0; i < controller.IDs.Length; i++)
        {
            players[i]      = controller.IDs[i].gameObject;
            playerHealth[i] = players[i].GetComponent <Health>();
            healths2[i]     = playerHealth[i].health;
        }

        foreach (Image element in images)
        {
            if (element.tag == "AbilityIcon")
            {
                icons.Add(element);
            }
            if (element.tag == "HealthBar")
            {
                healthBars.Add(element);
            }
            if (element.tag == "PlayerPortrait")
            {
                portraits.Add(element);
            }
        }
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     cooldown   = GetComponent <PlayerCDController>();
     controller = GetComponent <ControllerThing>();
 }