示例#1
0
    public override void Progress()
    {
        // if(TargetPlace!=null){
        //  Rigid.MovePosition(Vector3.MoveTowards(transform.position, TargetPlace.position, inversedMoveTime*Time.deltaTime));
        // }else{
        //  Rigid.MovePosition(Vector3.MoveTowards(transform.position, transform.position + speed*Direction, inversedMoveTime*Time.deltaTime));
        // }
        // lifeSpan--;
        // if(lifeSpan < 0) Interactive_Destroy();

        if ((k514SystemManager.InteractMgr.GetPlayerVector().z - transform.position.z) > 2f)
        {
            Interactive_Destroy();
        }

        if (currentPatterns == null && patterns.Count > 0)
        {
            currentPatterns = patterns[patternsIndex];
            patternsIndex++;
            if (LoopTrig)
            {
                patternsIndex = patternsIndex % patterns.Count;
            }
        }
        if (currentPatterns != null && currentPatterns.Progress())
        {
            // Progress 진행됨.
        }
        else
        {
            // Progress 종료됨.
            if (currentPatterns != null)
            {
                currentPatterns.EndProcess();
            }
            currentPatterns = null;
        }

        if (currentPatterns == null && patternsIndex == patterns.Count)
        {
            Interactive_Destroy();
        }
        ;
    }
示例#2
0
    void EndProcess()
    {
        ActivateTrig    = false;
        targetPlace     = null;
        patternsIndex   = 0;
        currentPatterns = null;

        // 패턴 제거
        Transform tmp = null;

        for (int i = 0; i < transform.childCount; i++)
        {
            tmp = transform.GetChild(i);
            if (tmp.name == "Pattern")
            {
                Destroy(tmp.gameObject);
            }
        }

        transform.parent = master;
        patterns.Clear();
    }
示例#3
0
    void Update()
    {
        if (!ActivateTrig)
        {
            return;
        }

        if (currentPatterns == null && patternsIndex == patterns.Count)
        {
            Interactive_Burst();
            return;
        }
        ;

        if (currentPatterns == null && patterns.Count > 0)
        {
            currentPatterns = patterns[patternsIndex];
            patternsIndex++;
            if (LoopTrig)
            {
                patternsIndex = patternsIndex % patterns.Count;
            }
        }
        if (currentPatterns != null && currentPatterns.Progress())
        {
            // Progress 진행됨.
        }
        else
        {
            // Progress 종료됨.
            if (currentPatterns != null)
            {
                currentPatterns.EndProcess();
            }
            currentPatterns = null;
        }
    }
示例#4
0
    protected virtual void Update()
    {
        // late start
        if (!OnceTrig)
        {
            OnceTrig = true;
            StartCoroutine(attack_patterns);
        }

        // bombs
        if (bombs_check.Count > 0)
        {
            int[] key = bombs_check.Keys.ToArray();
            for (int i = 0; i < key.Length; i++)
            {
                try{
                    if (!bombs_check[key[i]].isAlive())
                    {
                        DoInteract_HP(bombs_check[key[i]].GetDamage());
                        bombs_check.Remove(key[i]);
                        k514SystemManager.InteractMgr.GetPlayerTransform().GetComponent <k514PlayerController>().SP += Random.Range(0.008f, 0.012f);
                    }
                }catch (System.Exception e) {
                }
            }
        }



        if (currentPatterns == null && patternsIndex == patterns.Count)
        {
            return;
        }

        if (currentPatterns == null && patterns.Count > 0)
        {
            currentPatterns = patterns[patternsIndex];
            patternsIndex++;
            if (LoopTrig)
            {
                patternsIndex = patternsIndex % patterns.Count;
            }
        }
        if (currentPatterns != null && currentPatterns.Progress())
        {
            // Progress 진행됨.
        }
        else
        {
            // Progress 종료됨.
            if (currentPatterns != null)
            {
                currentPatterns.EndProcess();
            }
            currentPatterns = null;
        }
        if (RotateTrig)
        {
            CheckRotation();
        }
        else
        {
            SetTarget();
        }
    }
示例#5
0
 public void SetInfo(k514EnemyBehaviour target)
 {
     target.SetSpeed(this.speed);
     target.SetMoveTime(this.moveTime);
     target.SetLifeSpanCnt(this.lifeSpan);
 }