void Awake()
    {
        _SkillTreeManager = GameObject.Find("SkillTreeManager").GetComponent <SkillTreeManager>();

        switch (this.gameObject.name)
        {
        case "Battlerage":
            type = SkillType.Battlerage;
            break;

        case "Sorcery":
            type = SkillType.Sorcery;
            break;

        case "Archery":
            type = SkillType.Archery;
            break;

        case "Shadowplay":
            type = SkillType.Shadowplay;
            break;

        case "Witchcraft":
            type = SkillType.Witchcraft;
            break;
        }
    }
Ejemplo n.º 2
0
    private void Start()
    {
        StartCoroutine(AllLoaded());

        if (!isLocalPlayer)
        {
            gameObject.GetComponentInChildren <Camera>().enabled = false;
        }

        characterAttacks = GetComponent <PlayerAttacks>();
        rb   = GetComponent <Rigidbody2D>();
        anim = GetComponent <Animator>();
        anim.SetFloat("Speed", 1.0f);
        downedCollider = GetComponent <CircleCollider2D>();
        m_speed        = characterAttacks.m_speed;
        m_normal_speed = m_speed;

        sushi_coins     = 0;
        ultimate_charge = 0;

        skillOneCooldown = characterAttacks.skillOneCooldown;
        skillTwoCooldown = characterAttacks.skillTwoCooldown;

        downedTime = ConstantsDictionary.MaxDownedTime;

        Slider[] DownedTimerSliders = GetComponentsInChildren <Slider>();
        foreach (Slider slider in DownedTimerSliders)
        {
            if (slider.gameObject.name.Contains("Neko"))
            {
                nekoDownedTimerSlider = slider;
            }
            else if (slider.gameObject.name.Contains("Octo"))
            {
                octoDownedTimerSlider = slider;
            }
            else if (slider.gameObject.name.Contains("Fisherman"))
            {
                fishermanDownedTimerSlider = slider;
            }
        }
        nekoDownedTimerSlider.maxValue      = downedTime;
        octoDownedTimerSlider.maxValue      = downedTime;
        fishermanDownedTimerSlider.maxValue = downedTime;
        nekoArrow.SetActive(false);
        octoArrow.SetActive(false);
        fishermanArrow.SetActive(false);

        lastMove     = new Vector2(0, -1);
        playerMoving = false;
        anim.SetBool("Moving", playerMoving);

        ultimateChargeSlider = GameObject.FindGameObjectWithTag("UI").GetComponentInChildren <Slider>();

        ultimateChargeSlider.value = 0;
        ultimateChargeSlider.GetComponent <Text>().text = "0%";

        stm = gameObject.GetComponent <SkillTreeManager>();
    }
Ejemplo n.º 3
0
 void Awake()
 {
     if (Instance != null)
     {
         Debug.Log("[SkillTreeManager] There is more than one skill tree Instance");
         return;
     }
     Instance = this;
 }
Ejemplo n.º 4
0
    void Awake()
    {
        instance = this;

        InitializeSkillList();

        for (int i = 0; i < _selectType.Length; i++)
        {
            _selectType[i]            = new SelectType();
            _selectType[i].type       = (SkillType)i;
            _selectType[i].isSelected = false;
        }

        prototypePos = SkillPrototype.GetComponent <RectTransform>().anchoredPosition;

        LoadData();
    }
Ejemplo n.º 5
0
    void Start()
    {
        SkillInfoTab        = GameObject.Find("SkillInfo").GetComponent <RectTransform>();
        SkillInfoTabPassive = GameObject.Find("SkillInfoPassive").GetComponent <RectTransform>();
        _SkillInfo          = GetComponent <SkillInfo>();
        _SkillTreeManager   = GameObject.Find("SkillTreeManager").GetComponent <SkillTreeManager>();

        EventTrigger eventTrigger = gameObject.AddComponent <EventTrigger>();

        EventTrigger.Entry entry_PointerDown = new EventTrigger.Entry();
        entry_PointerDown.eventID = EventTriggerType.PointerDown;
        entry_PointerDown.callback.AddListener((data) => { OnPointerDown((PointerEventData)data); });
        eventTrigger.triggers.Add(entry_PointerDown);

        EventTrigger.Entry entry_PointerEnter = new EventTrigger.Entry();
        entry_PointerEnter.eventID = EventTriggerType.PointerEnter;
        entry_PointerEnter.callback.AddListener((data) => { OnPointerEnter((PointerEventData)data); });
        eventTrigger.triggers.Add(entry_PointerEnter);

        EventTrigger.Entry entry_PointerExit = new EventTrigger.Entry();
        entry_PointerExit.eventID = EventTriggerType.PointerExit;
        entry_PointerExit.callback.AddListener((data) => { OnPointerExit((PointerEventData)data); });
        eventTrigger.triggers.Add(entry_PointerExit);
    }
Ejemplo n.º 6
0
 public void SetSTM(SkillTreeManager s)
 {
     stm = s;
 }
Ejemplo n.º 7
0
 public void AssignSTM(SkillTreeManager skillTreeManager)
 {
     stm = skillTreeManager;
 }
Ejemplo n.º 8
0
 void Awake()
 {
     current = this;
 }