示例#1
0
    // Use this for initialization
    void Start()
    {
        //
        parentMenu  = this.gameObject.GetComponentInParent <charaMenu_parent> ();
        parentChara = parentMenu.getAllCharaScript();
        thisAnime   = this.gameObject.GetComponentInParent <Animator> ();

        //

        /*
         * thisPosition = this.gameObject.transform;
         *
         * Vector3 tmpV = new Vector3 (-10f, 0f, 0f);
         * tmpV = tmpV + thisPosition.localPosition ;
         *
         * this.gameObject.transform.localPosition = tmpV;
         */
        thisSpriteR = this.gameObject.GetComponent <SpriteRenderer>();

        Color tmpC = thisSpriteR.color;

        tmpC.a            = 1f;
        thisSpriteR.color = tmpC;

        //スキルボタン、且つクールタイムが終わっていない場合、ボタンは削除される
        if (thisButtonType == 3)
        {
            float tmpF = parentChara.getRestCoolTime();
            if (tmpF > 0.01f)
            {
                Destroy(this.gameObject);
            }
        }
    }
    public void setBaseCharaScript(allCharaBase argsChara)
    {
        thisChara = argsChara;

        Animator tmpAnime = thisChara.gameObject.GetComponentInChildren <Animator>();

        tmpAnime.SetTrigger("gotoSkillDo");
        //Debug.Log (thisChara.thisChara.charaNo);
    }
    void Start()
    {
        parentMenu  = this.gameObject.GetComponentInParent <charaMenu_parent> ();
        parentChara = parentMenu.getAllCharaScript();

        thisSR = this.GetComponent <SpriteRenderer> ();

        this.autoSetSprite();
    }
 void OnTriggerEnter2D(Collider2D c)
 {
     //Enterなので1体に対して複数回は発生しない
     if (c.gameObject.name.Substring(0, 9) == "charaBase")
     {
         allCharaBase charaB = c.gameObject.GetComponent <allCharaBase> ();
         charaB.setDamage(dealDamade);
     }
 }
示例#5
0
    // Use this for initialization
    void Start()
    {
        thisAnimetor     = this.transform.parent.GetComponentInChildren <Animator>();
        parentCharaScrpt = this.gameObject.GetComponentInParent <allCharaBase>();
        thisCldr         = this.GetComponent <CircleCollider2D> ();

        lastFrameAttackTarget = new List <Transform> ();

        StartCoroutine(mainLoop());
    }
    void OnTriggerEnter2D(Collider2D c)
    {
        //void OnTriggerStay2D(Collider2D c){
        if (c.gameObject.name.Substring(0, 9) == "charaBase")
        {
            allCharaBase charaB = c.gameObject.GetComponent <allCharaBase> ();
            charaB.setDamage(dealDamade);

            StartCoroutine(this.colliderDisabled());
        }
    }
示例#7
0
    public void setBaseCharaScript(allCharaBase argsChara)
    {
        thisChara = argsChara;

        Animator tmpAnime = thisChara.gameObject.GetComponentInChildren <Animator>();

        //シオンの場合は自動遷移後
        tmpAnime.SetTrigger("gotoSkillDo");

        thisChara.transform.Find("charaAnime").GetComponent <charaAnimationSubScript>().destorySubAnime();
    }
示例#8
0
 void OnTriggerEnter2D(Collider2D co)
 {
     if (co.name.Length > 9)
     {
         if (co.name.Substring(0, 9) == "charaBase")
         {
             allCharaBase tmpAC = co.gameObject.GetComponent <allCharaBase>();
             tmpAC.setHealing(2);
         }
     }
 }
示例#9
0
    // Use this for initialization
    void Start()
    {
        hpBar        = this.transform.Find("1_hpBar");
        skillTimeBar = this.transform.Find("2_skillBar");
        expBar       = this.transform.Find("3_expBar");
        //modeIcon = this.transform.Find("4_modeIcon");

        thisCharaBase      = GameManagerGetter.getGameManager().loadedCharaList.charalist [_charalistIndex].charaBase;
        thisCharaBaseScrpt = thisCharaBase.GetComponentInChildren <allCharaBase> ();

        //charaUserStatus a = new charaUserStatus(
    }
示例#10
0
    public bool exec()
    {
        allCharaBase attackCharaBase = attackChara.GetComponent <allCharaBase>();

        //基本チェック
        if (targetEnemy == null)
        {
            Debug.Log("isNull!!");
            return(false);
        }

        this.attackColliderOptional(targetEnemy, attackChara);

        //Script別チェック
        allEnemyBase chkBase = targetEnemy.gameObject.GetComponent <allEnemyBase> ();

        if (chkBase != null)
        {
            if (chkBase.destoryF == true)
            {
                //Debug.Log ("isDestoryFlag!!");
                return(false);
            }

            chkBase.setDamage(dealDamage, attackCharaBase.thisCharaIndex);
            //Check OK
            return(true);
        }

        bulletBase_CanDestory chkBlt = targetEnemy.gameObject.GetComponent <bulletBase_CanDestory> ();

        if (chkBlt != null)
        {
            if (chkBlt.destoryF == true)
            {
                //Debug.Log ("isDestoryFlag!!");
                return(false);
            }
            //Check OK

            chkBlt.interceptedThisBullet();
            return(true);
        }

        //Debug.Log ("not Selected");

        return(false);
    }
示例#11
0
    void OnMouseDown()
    {
        thisCharaBase = this.transform.parent.GetComponent <charaIconsetManager> ().thisCharaBase;
        thisCharaFlag = this.transform.parent.GetComponent <charaIconsetManager> ().thisCharaFlag;

        dragCancelF = false;

        if (doubleClickCheck == false)
        {
            doubleClickCheck = true;
            StartCoroutine(doubleClickWait());
        }
        else
        {
            //ダブルクリックされた
            doubleClickCheck = false;

            //トラッキングのリセット(他キャラをロックしている場合、移動しないため)
            trackingObj.GetComponentInChildren <cameraTrackerScript>().setCharaTrackReset();

            Vector3 tmpV = new Vector3(thisCharaBase.transform.position.x, thisCharaBase.transform.position.y, -20f);
            Camera.main.transform.position = tmpV;

            //スキルウェイト中は表示しない
            allCharaBase thisCharaBaseScrpt = thisCharaBase.GetComponentInChildren <allCharaBase> ();
            if (thisCharaBaseScrpt.thisChara.battleStatus.charaMode == characterMode.Skill)
            {
                soundManagerGetter.getManager().playOneShotSound(enm_oneShotSound.skillCancel);
                return;
            }

            soundManagerGetter.getManager().playOneShotSound(enm_oneShotSound.charaMenu);

            charaMenuInstance = Instantiate(_characterMenu) as GameObject;
            charaMenu_parent cmp = charaMenuInstance.GetComponentInChildren <charaMenu_parent> ();
            cmp.setParentChara(thisCharaBase);
            cmp.setParentIconSet(this.gameObject.transform.parent.gameObject);

            charaMenu_statusLabel tmpLabel = charaMenuInstance.GetComponentInChildren <charaMenu_statusLabel> ();
            tmpLabel._labelStatus = this.transform.parent.GetComponent <charaIconsetManager> ().labelStatus;
        }
    }
    // Use this for initialization
    void Start()
    {
        thisTrgt = new skillTargetInfo();

        thisTrgt.worldPosision = new Vector3(0, 0, 0);
        thisTrgt.zAngle        = 0f;

        parentMenu       = this.transform.parent.GetComponent <charaMenu_parent>();
        parentChara      = parentMenu.getAllCharaScript();
        thisTrgt.charaNo = parentChara.thisChara.charaNo;

        Vector3 tmpV_zero = new Vector3(0, 0, 0);

        switch (parentChara.thisChara.charaNo)
        {
        case enumCharaNum.syusuran_02:
        case enumCharaNum.akane_04:
        case enumCharaNum.mokuren_06:
        case enumCharaNum.sion_08:
        case enumCharaNum.hiragi_09:

            thisSkilltgt = Instantiate(_SkillTarget_Arrow) as GameObject;

            thisSkilltgt.transform.parent        = this.transform;
            thisSkilltgt.transform.localPosition = tmpV_zero;

            thisTrgt.zAngle = thisSkilltgt.transform.localRotation.z;

            break;

        default:

            thisSkilltgt = Instantiate(_SkillTarget_Circle) as GameObject;

            thisSkilltgt.transform.parent        = this.transform;
            thisSkilltgt.transform.localPosition = tmpV_zero;

            break;
        }
    }
    // Use this for initialization
    void Start()
    {
        thisChara = this.transform.parent.GetComponent <allCharaBase> ();


        //自立移動は親子解除
        switch (thisCharaNo)
        {
        case enumCharaNum.akane_04:
        case enumCharaNum.mokuren_06:
        case enumCharaNum.hiragi_09:
            this.transform.parent = null;
            break;

        case enumCharaNum.sion_08:
            this.transform.parent    = null;
            this.transform.position += Vector3.forward * -1f;
            break;
        }

        StartCoroutine(waitPositionChange_hiragi());
        StartCoroutine(createColliderTimer());
        StartCoroutine(freezeAndDestoryCheck());
    }
示例#14
0
 public void setParentChara(GameObject arsGO)
 {
     argsChara = arsGO.GetComponentInChildren <allCharaBase>();
 }
示例#15
0
    IEnumerator mostNearEnemyAttacking()
    {
        Vector3   tmpV;
        float     minLength  = 99999f;
        Transform nearTarget = null;

        //再接近ターゲットの確認
        foreach (Transform t in lastFrameAttackTarget)
        {
            if (t != null)
            {
                tmpV = t.transform.position - this.transform.position;

                if (tmpV.magnitude < minLength)
                {
                    minLength  = tmpV.magnitude;
                    nearTarget = t;
                }
            }
        }

        if (nearTarget == null)
        {
            Debug.Log("isNull!!");
            yield break;
            //稀に破壊されてNullになるため
        }

        allCharaBase charaB = nearTarget.gameObject.GetComponent <allCharaBase> ();

        if (charaB.destroyF == true)
        {
            Debug.Log("isDestoryFlag!!");
            yield break;
        }

        lastFrameAttackTarget.Clear();
        deleyFlag = true;

        if (_animetionPrefabs != null)
        {
            //アニメーションがセットしてある場合
            _animetionPrefabs.enabled = true;
        }

        int tmpDm = 1 + Mathf.FloorToInt(aEB.getAttackingPower() + (Random.value * 2));

        charaB.setDamage(tmpDm);

        if (_attackEffectPrefab != null)
        {
            Instantiate(_attackEffectPrefab, nearTarget.transform.position, Quaternion.identity);
        }

        this.GetComponent <chara_attackEreaVisible>().setVisibleThisCicle();

        //ここで再取得
        thisEnemyAttackDeleySec = aEB.getAttackingDelay();

        StartCoroutine(this.attackDeleyClearer());
    }
    IEnumerator mostNearEnemyAttacking()
    {
        Vector3   tmpV;
        float     minLength  = 99999f;
        Transform nearTarget = null;

        //再接近ターゲットの確認
        foreach (Transform t in lastFrameAttackTarget)
        {
            if (t != null)
            {
                tmpV = t.transform.position - this.transform.position;

                if (tmpV.magnitude < minLength)
                {
                    minLength  = tmpV.magnitude;
                    nearTarget = t;
                }
            }
        }

        if (nearTarget == null)
        {
            Debug.Log("isNull!!");
            yield break;
            //稀に破壊されてNullになるため
        }

        allCharaBase charaB = nearTarget.gameObject.GetComponent <allCharaBase> ();

        if (charaB.destroyF == true)
        {
            Debug.Log("isDestoryFlag!!");
            yield break;
        }

        lastFrameAttackTarget.Clear();

        deleyFlag = true;

        //Debug.Log ("skill!!");

        wolfSkillAnimationPosition tmpPosiS = _animationBase.GetComponent <wolfSkillAnimationPosition> ();

        tmpPosiS.setTargetPosition(nearTarget.transform.position);
        tmpPosiS.startXPosition();


        Animator thisAnimetor = _animationBase.GetComponentInChildren <Animator>();

        thisAnimetor.SetTrigger("setSkill");

        _basicAttackCollider.enabled = false;           //通常攻撃の停止

        this.GetComponent <chara_attackEreaVisible>().setVisibleThisCicle();

        StartCoroutine(this.skillAttackWait(nearTarget.transform.position, aEB.getAttackingPower() * 2.1f));
        //Debug.Log ("1");
        StartCoroutine(this.basicAttackWait());
        //Debug.Log ("2");
        StartCoroutine(this.attackDeleyClearer());
        //Debug.Log ("3");
    }
示例#17
0
    void Start()
    {
        thisChara = this.transform.parent.GetComponent <allCharaBase> ();

        StartCoroutine(flyingCheckLoop());
    }