public void Init(CommanderData data, List <TestMonster> listMonsters)
    {
        //가져온 데이터를 참조합니다
        this.data             = data;
        this.calculatedDamage = FormulaCalculator.GetInstance().AllCalculatedDamage_Commander(data.id);
        this.calculatedAspd   = FormulaCalculator.GetInstance().AllCalculatedAspd_Commander(data.id);

        if (this.animator == null)
        {
            this.animator = this.gameObject.GetComponentInChildren <Animator>();
        }

        //effectEvents를 초기화합니다
        this.effectEvents = this.GetComponentInChildren <EffectEvents>();
        //Debug.Log("============================");

        //Debug.Log(effectEvents);

        //boxCollider를 붙입니다(Hero Merge를 위함)
        this.boxCollider           = this.gameObject.AddComponent <BoxCollider>();
        this.boxCollider.size      = new Vector3(1, 3, 1);
        this.boxCollider.center    = new Vector3(0, 1.2f, 0);
        this.boxCollider.isTrigger = true;

        //몬스터 리스트 참조를 가져옵니다
        this.listMonsters = listMonsters;

        this.ChangeBehavior(eCommanderState.SEARCH);
    }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        var json = Resources.Load <TextAsset>("Data/defense_monster_data").text;
        var arr  = JsonConvert.DeserializeObject <DefenseMonsterData[]>(json);

        testMonster.Init(Vector3.zero, arr[0], fence, deMaterial);
        testMonster.hp = 50000;
        this.anim      = this.gameObject.GetComponentInChildren <Animator>();

        this.effectEvents = this.GetComponentInChildren <EffectEvents>();
        this.effectEvents.rangeMonstersAction = (listMonsters) =>
        {
            for (int i = 0; i < listMonsters.Count; i++)
            {
                int capt = i;

                listMonsters[capt].gameObject.GetComponent <TestMonster>().Hit(2);
                Debug.Log($"맞냐? {listMonsters.Count} ");
            }
        };
        this.btnAttack.onClick.Add(new EventDelegate(() =>
        {
            Attack();
        }));
    }
Esempio n. 3
0
        public CodingGeneController()
        {
            EffectEvents.Add(Consume);
            EffectEvents.Add(Decomposite);
            EffectEvents.Add(ProductChemical);
            EffectEvents.Add(ImportChemical);

            EffectEvents.Add(ModifyPopulation);
            EffectEvents.Add(StrainSpread);
        }
        private void ExternalControlEndpoint_StaticOnEffectEvent(object sender, EffectEventArgs e)
        {
            if (!NanoleafPlugin.getClient(this.SerialNumber).IP.Equals(e.IP))
            {
                return;
            }

            EffectEvents events = e.EffectEvents;

            if (events == null)
            {
                return;
            }

            this.CurrentValue = events.Events.First().Value;
        }
Esempio n. 5
0
    public void Init(HeroData data, List <TestMonster> listMonsters, UIRoot uiRoot)
    {
        //가져온 데이터를 참조합니다
        this.uiRoot = uiRoot;
        this.data   = data;
        this.bySelfDecreaedDelay   = 0;
        this.byOtherDecreasedDelay = 0;
        this.calculatedDamage      = FormulaCalculator.GetInstance().AllCalculatedDamage_Hero(data.id);
        this.calculatedAspd        = FormulaCalculator.GetInstance().AllCalculatedAspd_Hero(data.id);
        this.defaultPos            = this.transform.position;
        if (this.model == null)
        {
            this.model = this.gameObject.transform.GetChild(0).gameObject;
        }
        this.model.transform.localPosition = Vector3.zero;

        if (this.animator == null)
        {
            this.animator = this.gameObject.GetComponentInChildren <Animator>();
        }
        if (this.GetComponentInChildren <EffectEvents>() != null)
        {
            this.effectEvents = this.GetComponentInChildren <EffectEvents>();
        }
        //레이어를 Hero로 만듦
        this.gameObject.layer = LayerMask.NameToLayer("Hero");

        if (this.boxCollider == null)
        {
            //boxCollider를 붙입니다(Hero Merge를 위함)
            this.boxCollider           = this.gameObject.AddComponent <BoxCollider>();
            this.boxCollider.size      = new Vector3(2f, 2, 2f);
            this.boxCollider.center    = new Vector3(0, 1.2f, 0);
            this.boxCollider.isTrigger = true;
        }
        //몬스터 리스트 참조를 가져옵니다
        this.listMonsters = listMonsters;

        if (uIPopup_HeroLevel == null)
        {
            NewUiPopup_HeroLevel();
        }
        SetPositionUIPopup_Hero();
        var type = 0;

        if (data.type < 6)
        {
            type = 1;
        }
        else if (data.type < 11)
        {
            type = 2;
        }
        else if (data.type < 16)
        {
            type = 3;
        }
        uIPopup_HeroLevel.SetLevel(type);

        this.ChangeBehavior(eHeroState.SEARCH);
    }