コード例 #1
0
    //-------------------------碰撞對話-----------------------------

    /*public void BloodStation()  //補血站
     * {
     *      teachBlood = true;
     *      currentLine = 6;
     *      endAtLine = 16;
     *      NPCAppear();
     * }*/


    IEnumerator BeforeKing()
    {
        EnemyController = GameObject.Find("BossEnemy").GetComponent <DG_EnemyController>();

        yield return(new WaitForSeconds(1));

        gameManager.vsPanel.SetActive(true);
        vsKing.SetActive(true);
        yield return(new WaitForSeconds(3));

        gameManager.teachHintAni.SetTrigger("HintOpen");
        gameManager.teachHintText.text = "進入戰鬥";
        gameManager.drawGame.TransitionTo(10f);
        //BossKCollider.enabled = true;
        EnemyController.GetComponent <BoxCollider2D>().enabled = true;
        gameManager.attackRedImage.SetActive(true);
        EnemyController.isAttack = true;
        gameManager.vsPanel.SetActive(false);
        vsKing.SetActive(false);
        EnemyController.HealthCanvas.SetActive(true);
    }
コード例 #2
0
ファイル: DialogsScript2.cs プロジェクト: byebye90321/magic
    IEnumerator BeforeKBattle()
    {
        EnemyController = GameObject.Find("BossEnemy").GetComponent <DG_EnemyController>();
        playerAddParticle.SetActive(true);
        addText.SetActive(true);
        UpText.SetActive(true);
        yield return(new WaitForSeconds(3));

        gameManager.vsPanel.SetActive(true);
        vsYYK.SetActive(true);
        yield return(new WaitForSeconds(3));

        gameManager.teachHintAni.SetTrigger("HintOpen");
        gameManager.teachHintText.text = "進入戰鬥";
        gameManager.drawGame.TransitionTo(10f);
        BossKCollider.enabled = true;
        gesture.AddAttack     = 5;
        gameManager.attackRedImage.SetActive(true);
        EnemyController.isAttack = true;
        gameManager.vsPanel.SetActive(false);
        vsYYK.SetActive(false);
        EnemyController.HealthCanvas.SetActive(true);
    }
コード例 #3
0
ファイル: DialogsScript1.cs プロジェクト: byebye90321/magic
    public GameObject col; //碰撞器開關

    void Start()
    {
        Joystick.isMove       = true;
        StaticObject.nowClass = 0;
        if (StaticObject.nowClass == 0) //目前第一關(初始)
        {
            //產生物件
            currentLine = 1;
            endAtLine   = 10;

            //StaticObject.whoCharacter = 1;
            if (StaticObject.whoCharacter == 1)
            {
                TextAsset textFile1 = Resources.Load("Text/bother") as TextAsset;
                textFile      = textFile1;
                playerName    = "卡特";
                sister_angry  = Resources.Load("characterImage/bother/bother_angry", typeof(Sprite)) as Sprite;
                sister_happy  = Resources.Load("characterImage/bother/bother_happy", typeof(Sprite)) as Sprite;
                sister_normal = Resources.Load("characterImage/bother/bother_normal", typeof(Sprite)) as Sprite;
                sister_oops   = Resources.Load("characterImage/bother/bother_oops", typeof(Sprite)) as Sprite;
                sister_sad    = Resources.Load("characterImage/bother/bother_sad", typeof(Sprite)) as Sprite;
                sister_smile  = Resources.Load("characterImage/bother/bother_normal", typeof(Sprite)) as Sprite;
                vsBother.SetActive(true);
            }
            else if (StaticObject.whoCharacter == 2)
            {
                TextAsset textFile1 = Resources.Load("Text/sister") as TextAsset;
                textFile      = textFile1;
                playerName    = "緹緹";
                sister_angry  = Resources.Load("characterImage/sister/sister_angry", typeof(Sprite)) as Sprite;
                sister_happy  = Resources.Load("characterImage/sister/sister_happy", typeof(Sprite)) as Sprite;
                sister_normal = Resources.Load("characterImage/sister/sister_normal", typeof(Sprite)) as Sprite;
                sister_oops   = Resources.Load("characterImage/sister/sister_oops", typeof(Sprite)) as Sprite;
                sister_sad    = Resources.Load("characterImage/sister/sister_sad", typeof(Sprite)) as Sprite;
                sister_smile  = Resources.Load("characterImage/sister/sister_smile", typeof(Sprite)) as Sprite;
                vsSister.SetActive(true);
            }

            cameraFollow      = GameObject.Find("Main Camera").GetComponent <CameraFollow>();
            gameManager       = GameObject.Find("GameController").GetComponent <GameManager>();
            npcTask           = GameObject.Find("NPC").GetComponent <NPCTask>();
            EnemyController   = GameObject.Find("BossEnemy").GetComponent <DG_EnemyController>();
            MonsterController = GameObject.Find("MonsterEnemy").GetComponent <DG_EnemyController>();
            characterImage    = characterImageObj.GetComponent <Image>();
            otherImage        = otherImageObj.GetComponent <Image>();


            markAni            = markObj.GetComponent <Animator>();
            markCollider       = markObj.GetComponent <BoxCollider2D>();
            attackColliderCol  = attackCollider.GetComponent <BoxCollider2D>();
            monsterColliderCol = monsterCollider.GetComponent <BoxCollider2D>();
            statueCollider     = statueObj.GetComponent <BoxCollider2D>();
            vine3Collider      = vine3.GetComponent <BoxCollider2D>();
            mark2Collider      = mark2Obj.GetComponent <BoxCollider2D>();
            mark2Ani           = mark2Obj.GetComponent <Animator>();

            if (currentLine > endAtLine)
            {
                isActive = false;
                textBox.SetActive(false);
                GameEnd = false;
            }
            if (textFile != null)
            {
                textLines = (textFile.text.Split('\n'));
            }
            if (endAtLine == 0)
            {
                endAtLine = textLines.Length - 1;
            }

            if (isActive)
            {
                EnableTextBox();
            }
            else
            {
                DisableTextBox();
            }

            StaticObject.nowClass = 1f;
            PlayerPrefs.SetFloat("StaticObject.nowClass", StaticObject.nowClass);
        }
        StaticObject.chichi = 1;
        PlayerPrefs.SetInt("StaticObject.chichi", StaticObject.chichi);
        //usually.TransitionTo(10f);
        fadeOut = FadeOut.GetComponent <Animator>();
        StartCoroutine("fadeIn");
    }