Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        skillDescription = transform.GetChild(1).GetComponent <Text>();
        skillName        = transform.GetChild(0).GetComponent <Text>();
        holder           = transform.parent.parent.parent.gameObject;
        playerTransform  = holder.GetComponent <Transform>();
        scrollSkill      = holder.GetComponent <PlayerScrollSkill>();

        //this.gameObject.transform.localPosition = Camera.main.WorldToScreenPoint(new Vector3(playerTransform.position.x - xOffset, playerTransform.position.y - yOffset, playerTransform.position.z));
        this.gameObject.transform.position = new Vector3(this.transform.parent.parent.parent.position.x, this.transform.parent.parent.parent.position.y + yOffset, this.transform.parent.parent.parent.position.z);
    }
 private void Awake()
 {
     if (this.gameObject.tag == "Player1")
     {
         playerButton = "P1_Button";
     }
     if (this.gameObject.tag == "Player2")
     {
         playerButton = "P2_Button";
     }
     scrollSkill = this.gameObject.GetComponent <PlayerScrollSkill>();
 }
    // Use this for initialization
    void Start()
    {
        //skillExecution = playerSpawnPoint.GetChild(0).gameObject.GetComponent<PlayerSkillExecution>();
        skillExecution = GameObject.FindGameObjectWithTag("Player1").GetComponent <PlayerSkillExecution>();

        if (gameObject.tag == "Player1Toggle")
        {
            //skillExecution = GameObject.FindGameObjectWithTag("Player1").GetComponent<PlayerSkillExecution>();
            skillExecution = Player1.instance.GetComponent <PlayerSkillExecution>();
        }
        else if (gameObject.tag == "Player2Toggle")
        {
            //skillExecution = GameObject.FindGameObjectWithTag("Player2").GetComponent<PlayerSkillExecution>();
            skillExecution = Player2.instance.GetComponent <PlayerSkillExecution>();
        }

        //skillScroll = playerSpawnPoint.GetChild(0).gameObject.GetComponent<PlayerScrollSkill>();

        if (gameObject.tag == "Player1Toggle")
        {
            //skillScroll = GameObject.FindGameObjectWithTag("Player1").GetComponent<PlayerScrollSkill>();
            skillScroll = Player1.instance.GetComponent <PlayerScrollSkill>();
        }
        else if (gameObject.tag == "Player2Toggle")
        {
            //skillScroll = GameObject.FindGameObjectWithTag("Player2").GetComponent<PlayerScrollSkill>();
            skillScroll = Player2.instance.GetComponent <PlayerScrollSkill>();
        }

        text         = GetComponentInChildren <Text>();
        sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <SceneManager>();
        for (int i = 0; i < sceneManager.playerList.Count; i++)
        {
            playerAtbList.Add(sceneManager.playerList[i].GetComponent <actionTimeBar>());
        }
        for (int i = 0; i < sceneManager.enemyList.Count; i++)
        {
            enemyAimIcon.Add(sceneManager.enemyList[i].GetComponent <EnemyVariableManager>().aimIcon);
        }
    }
 private void Awake()
 {
     actionTimerBarScript = this.GetComponent <actionTimeBar>();
     scrollSkill          = this.GetComponent <PlayerScrollSkill>();
     //statusUpdateScript = GetComponent<PlayerStatusUpdate>();
 }