Пример #1
0
    // Start is called before the first frame update
    void Awake()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();
        commonUtils  = gameManager.GetComponentInChildren <CommonUtils>();
    }
Пример #2
0
    public override void Awake()
    {
        base.Awake();
        playerMovementController = gameObject.GetComponentInParent <PlayerMovementController>();
        playerController         = GetComponent <PlayerController>();

        alignment = AlignmentType.Player;

        GameObject   gameManager  = GameObject.FindGameObjectWithTag("GameController");
        PrafabHolder prafabHolder = gameManager.GetComponent <PrafabHolder>();

        GameObject MageFireBall = prafabHolder.GetSkill("MageFireBall");

        AddSkill(MageFireBall);

        //GameObject BlizardSkill = prafabHolder.GetSkill("Blizard");
        //AddSkill(BlizardSkill);

        //GameObject FireSpraySkill = prafabHolder.GetSkill("FireSpray");
        //AddSkill(FireSpraySkill);

        //GameObject LightningStrick = prafabHolder.GetSkill("LightningStrick");
        //AddSkill(LightningStrick);

        //GameObject AttackSpeedUp = prafabHolder.GetSkill("AttackSpeedUp");
        //AddSkill(AttackSpeedUp);

        //GameObject AttackSpeedBuff1 = Instantiate(prafabHolder.GetBuff("attackSpeed"));
        //AddBuff(AttackSpeedBuff1, GetComponent<Role>());
        //GameObject AttackSpeedBuff2 = Instantiate(prafabHolder.GetBuff("attackSpeed"));
        //AddBuff(AttackSpeedBuff2, GetComponent<Role>());
    }
Пример #3
0
    void Start()
    {
        triggeredMap = new Dictionary <int, float>();
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();
    }
Пример #4
0
    public override void OnSkillCast()
    {
        GameObject      gameManager     = GameObject.FindGameObjectWithTag("GameController");
        PrafabHolder    prafabHolder    = gameManager.GetComponent <PrafabHolder>();
        GameObject      lightningPrafab = prafabHolder.GetEffect("LightningArc");
        SkillController skillController = skillControllerObj.GetComponent <SkillController>();

        GameObject lightningArc = Instantiate(lightningPrafab);

        LightningLink[] links = lightningPrafab.GetComponents <LightningLink>();

        foreach (LightningLink link in links)
        {
            link.m_StartPoint = skillController.GeneratePositionByType(PositionType.SELF);
            link.m_EndPoint   = skillController.GeneratePositionByType(PositionType.TARGET);
        }

        lightningArc.AddComponent <AutoDestroy>().timeToLive = duration;
        Role role = skillController.GeneratePositionByType(PositionType.TARGET).GetComponent <Role>();

        if (role != null)
        {
            role.ReduceHealth(CalculateValue());
            ApplyBuffsToRole(onApplyBuffDefs, role);
        }
    }
Пример #5
0
    void Start()
    {
        orbBullet = GetComponent <OrbBullet>();
        OrbSkillReady();

        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();
    }
Пример #6
0
    private void Awake()
    {
        GameObject gameManagerObj = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder         = gameManagerObj.GetComponent <PrafabHolder>();
        gameManager          = gameManagerObj.GetComponent <GameManager>();
        bulletColliderRadius = new Dictionary <BulletSize, float>();
        bulletColliderRadius.Add(BulletSize.Tiny, 0.3f);
        bulletColliderRadius.Add(BulletSize.Small, 0.45f);
        bulletColliderRadius.Add(BulletSize.Normal, 0.6f);
        bulletColliderRadius.Add(BulletSize.Mega, 0.85f);
    }
Пример #7
0
    public override void OnSkillAd()
    {
        GameObject   gameManager  = GameObject.FindGameObjectWithTag("GameController");
        PrafabHolder prafabHolder = gameManager.GetComponent <PrafabHolder>();

        GameObject      skillHolderBuff = Instantiate(prafabHolder.SkillHolderBuff);
        SkillHolderBuff buff            = skillHolderBuff.GetComponent <SkillHolderBuff>();

        buff.attachedSkillName = skillName;
        buff.buffName          = skillName + "-TriggerBuff";

        owner.GetComponent <Role>().AddBuff(skillHolderBuff, owner.GetComponent <Role>());
    }
Пример #8
0
    // Update is called once per frame
    void Awake()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();

        player           = GetComponent <Player>();
        shootController  = GetComponent <ShootController>();
        playerController = GetComponent <PlayerController>();

        animationController = GetComponentInChildren <PlayerAnimationController>();
        eventHelper         = GetComponentInChildren <SimpleEventHelper>();

        eventHelper.notifyRangeAttack += OnAttackFired;
    }
Пример #9
0
    // Fix Call
    void Awake()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();

        playerMovementController = gameObject.GetComponentInParent <PlayerMovementController>();
        animationController      = GetComponentInChildren <PlayerAnimationController>();
        eventHelper = GetComponentInChildren <SimpleEventHelper>();


        player           = GetComponent <Player>();
        shootController  = GetComponent <ShootController>();
        attackController = GetComponent <AttackController>();
        autoAming        = GetComponent <AutoAming>();
    }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        charController           = GetComponent <PrTopDownCharController>();
        Inventory                = GetComponent <PrTopDownCharInventory>();
        playerController         = GetComponent <PlayerController>();
        playerMovementController = gameObject.GetComponentInParent <PlayerMovementController>();
        player             = GetComponent <Player>();
        AutoAttackDistance = GetComponent <Role>().attackDistance;
        layer_mask         = LayerMask.GetMask("Enemy", "Wall");
        currentTarget      = null;

        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();
        RecreatorIndicator();
    }
Пример #11
0
    public virtual void Awake()
    {
        baseAgentController = transform.GetComponent <BaseAgentController>();
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder        = gameManager.GetComponent <PrafabHolder>();
        aiUtils             = gameManager.GetComponentInChildren <AIUtils>();
        animationController = transform.GetComponentInChildren <CustomAnimationController>();
        eventHelper         = transform.GetComponentInChildren <SimpleEventHelper>();
        shootPoint          = aiUtils.GetShootPoint(transform);

        player      = GameObject.FindGameObjectWithTag("Player");
        currentRole = GetComponent <Enemy>();
        currentRole.statusManager.notifyStatusChange += OnStatusChange;
        eventHelper.notifyGetHit += OnGetHit;

        currentState   = AIState.IDLE;
        stateStartTime = Time.time;
        progress       = AIProgress.END;
        resetPatrolPoint();
    }
Пример #12
0
    public virtual void Start()
    {
        GameObject gameManager = GameObject.FindGameObjectWithTag("GameController");

        prafabHolder = gameManager.GetComponent <PrafabHolder>();
        holder       = GetComponentInParent <Role>();
        PlayerController playerController = GetComponentInParent <PlayerController>();
        BaseAI           baseAI           = GetComponentInParent <BaseAI>();

        if (baseAI != null)
        {
            eventHelper = baseAI.eventHelper;
        }
        if (playerController != null)
        {
            eventHelper = playerController.eventHelper;
        }

        RegisterEventListener();

        OnBuffApply();
        ShowEffect(OnApplyEffect);
        ShowEffect(LivingEffect);
    }