コード例 #1
0
 // Use this for initialization
 void Start()
 {
     Gimmick     = FindObjectOfType <GimmickController>();
     myRigidBody = GetComponent <Rigidbody2D>();
     ShotCounter = waitBetweenShots;
     // myAnim = GetComponent<Animator>();
 }
コード例 #2
0
 void Start()
 {
     gController             = gimmickControl.GetComponent <GimmickController> ();
     wGimmick                = waterGimmick.GetComponent <WaterGimmick>();
     player                  = GameObject.FindGameObjectWithTag("Player");       //	プレイヤーを取得
     this.transform.position = player.transform.position + new Vector3(4, 0, 0); //	プレイヤーの頭上らへんに来るようにposition設定
     spRenderer              = GetComponent <SpriteRenderer>();
     spRenderer.color        = new Color(1, 1, 1, 0);                            //	雲のalpha値など
     popUpRainEffect         = Instantiate(nullObj);                             //	用意したnullobjectを代入
 }
コード例 #3
0
ファイル: GimmickController.cs プロジェクト: yoshika0330/Rein
 void Awake()
 {
     if (Instance != null)
     {
         enabled = false;
         DestroyImmediate(this);
         return;
     }
     Instance = this;
 }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        Gimmick         = FindObjectOfType <GimmickController>();
        rigidbody2D     = GetComponent <Rigidbody2D>();
        theLevelManager = FindObjectOfType <LevelManager>();

        if (Gimmick.transform.position.x < transform.position.x)
        {
            speed         = -speed;
            rotationSpeed = -rotationSpeed;
        }
    }
コード例 #5
0
    /// <summary>
    /// 初期化
    /// </summary>
    private void Init()
    {
        if (helpSprites.Length <= 0)
        {
            onReady = false;
            return;
        }
        gimmick = gameObject.GetComponentInChildren <GimmickController>();
        GameObject helpObject = new GameObject("Helpimage");

        helpObject.transform.parent        = gameObject.transform;
        helpObject.transform.localPosition = popPos;
        helpObject.transform.localScale    = new Vector3(1.5f, 1.5f, 1);
        helpObject.AddComponent <SpriteRenderer>();
        spr = helpObject.GetComponent <SpriteRenderer>();
        helpObject.GetComponent <SpriteRenderer>().sortingOrder = 102;
        spr.enabled = false;
        spr.sprite  = helpSprites[0];
        onReady     = true;
    }
コード例 #6
0
ファイル: LevelManager.cs プロジェクト: saleemb/Gimmickv2
    // Use this for initialization
    void Start()
    {
        // Initialize references to other objects
        Gimmick  = FindObjectOfType <GimmickController>();
        levelEnd = GameObject.Find("LevelEnd");

        // Disable level end of final level until boss is defeated
        if (SceneManager.GetActiveScene().name == "Forest Level")
        {
            levelEnd.GetComponent <SpriteRenderer>().enabled = false;
        }

        AudioManager.instance.PlayMusic(MainMusic);

        // Initialize various other variables
        if (PlayerPrefs.HasKey(maxHealthKey))
        {
            maxHealth = PlayerPrefs.GetInt(maxHealthKey);
        }
        healthCount    = maxHealth;
        flashTimer     = 0f;
        spriteRenderer = Gimmick.gameObject.GetComponent <SpriteRenderer> ();
        PointText.text = "Current Score: " + currentScore;
        theHighScore   = FindObjectOfType <HighScore> ();

        // Display correct hearts
        UpdateHeartMeter();

        // Set starting location
        int levelIndex = getLevelIndex();

        if (levelIndex > -1)
        {
            Gimmick.transform.position = restartLocations[levelIndex][PlayerPrefs.GetInt("Level Progress")];
        }
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     currentTarget   = topEndpoint.position;
     theLevelManager = FindObjectOfType <LevelManager> ();
     gimmick         = FindObjectOfType <GimmickController> ();
 }
コード例 #8
0
    /// <summary>
    /// ボタンが押された時の処理
    /// </summary>
    private void Move(ButtonType btn)
    {
        switch (btn)
        {
        case ButtonType.JUMP:
            _onCrossCross = true;
            if (crossAxisDown.getKeepDown)
            {
                return;
            }
            //アイテムを捨てる処理
            if (alchemyUI_ctr.ChooseWindow)
            {
                alchemyUI_ctr.ChooseThrow(false);
                return;
            }
            if (player_ctr.GetAlchemyUIFlag)
            {
                alchemyUI_ctr.ActiveThrowItemUI();
                return;
            }
            if (!leg_col.isLanding)
            {
                return;
            }

            if (player_ctr.GetAlchemyUIFlag)
            {
                return;
            }

            //ジャンプの方向別アニメーション
            if (direc == Direction.RIGHT)
            {
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHTJUMP);
            }
            else
            {
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFTJUMP);
            }

            rig.velocity = new Vector2(5, 1f * speed);
            //弟のジャンプ処理
            PotObject.GetComponent <PotController>().JumpPot();
            _jumping = true;
            break;

        case ButtonType.LEFTJOYSTICK_LEFT:
            if (direc != Direction.LEFT && Jumping)
            {
                return;
            }
            else if (direc == Direction.LEFT && Jumping)
            {
            }
            //右ジョイスティックとジャンプ同時押し

            direc = Direction.LEFT;
            if (!_ActiveRightLeft)
            {
                return;
            }

            if (player_ctr.GetAlchemyUIFlag)
            {
                return;
            }

            if (leg_col.isLanding && !Jumping)
            {
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFT_WALK);
            }
            if (CheckMoveable())
            {
                rig.velocity = new Vector2(-5f, rig.velocity.y);
            }
            //弟の移動処理
            PotObject.GetComponent <PotController>().LeftMove();
            break;

        case ButtonType.LEFTJOYSTICK_RIGHT:
            if (direc != Direction.RIGHT && Jumping)
            {
                return;
            }
            else if (direc == Direction.RIGHT && Jumping)
            {
            }
            //右ジョイスティックとジャンプ同時押し

            direc = Direction.RIGHT;

            if (!_ActiveRightLeft)
            {
                return;
            }
            if (player_ctr.GetAlchemyUIFlag)
            {
                return;
            }

            if (leg_col.isLanding && !Jumping)
            {
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHT_WALK);
            }

            if (CheckMoveable())
            {
                rig.velocity = new Vector2(5f, rig.velocity.y);
            }
            //弟の移動処理
            PotObject.GetComponent <PotController>().RightMove();
            break;

        case ButtonType.LEFTJOYSTICK_UP:
            _onUp          = true;
            ladderDownFlag = false;

            if (player_ctr.GetAlchemyUIFlag)
            {
                return;
            }

            if (InLadderCount > 0)
            {
                Ladder(ladderSpeed, 1);
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LADDER_UP);
            }

            break;

        case ButtonType.LEFTJOYSTICK_DOWN:
            _onDown = true;

            if (player_ctr.GetAlchemyUIFlag)
            {
                return;
            }
            if (ladderDownFlag)
            {
                return;
            }

            if (InLadderCount > 0)
            {
                Ladder(ladderSpeed, -1);
                anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LADDER_UP);
            }
            break;

        case ButtonType.RIGHTJOYSTICK_LEFT:
            //錬金UIが閉じてたらreturn
            if (!player_ctr.GetAlchemyUIFlag)
            {
                return;
            }
            _onRJoystickLeft = true;
            break;

        case ButtonType.RIGHTJOYSTICK_RIGHT:
            //錬金UIが閉じてたらreturn
            if (!player_ctr.GetAlchemyUIFlag)
            {
                return;
            }
            _onRJoystickRight = true;
            break;

        case ButtonType.RIGHTJOYSTICK_UP:
            //錬金UIが閉じてたらreturn
            if (!player_ctr.GetAlchemyUIFlag)
            {
                return;
            }
            _onRJoystickUp = true;
            break;

        case ButtonType.RIGHTJOYSTICK_DOWN:
            //錬金UIが閉じてたらreturn
            if (!player_ctr.GetAlchemyUIFlag)
            {
                return;
            }
            _onRJoystickDown = true;
            break;

        case ButtonType.CIRCLE:
            _onCircle = true;
            //錬金UI中の捨てるかどうかのウィンドウが出ている時に〇を押した時の処理
            if (alchemyUI_ctr.ChooseWindow)
            {
                alchemyUI_ctr.ChooseThrow(true);
                return;
            }
            //錬金UIが出ている時に〇を押した時の処理
            if (player_ctr.GetAlchemyUIFlag)
            {
                alchemyUI_ctr.PickItem();
            }
            else
            {
                if (gameObject.layer == LayerMask.NameToLayer("LadderPlayer"))
                {
                    return;
                }
                if (direc == Direction.LEFT)
                {
                    if (pManager.GetSwordType == PlayerStatus.SWORDTYPE.VAJURA)
                    {
                        anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFT_VAJURA);
                    }
                    else
                    {
                        anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.SWORDATTACK_LEFT);
                    }
                }
                else
                {
                    if (pManager.GetSwordType == PlayerStatus.SWORDTYPE.VAJURA)
                    {
                        anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHT_VAJURA);
                    }
                    else
                    {
                        anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.SWORDATTACK_RIGHT);
                    }
                }
            }
            break;

        case ButtonType.SQUARE:
            _onSquare = true;
            //スイッチを踏む処理
            if (switchGimmick != null)
            {
                if (direc == Direction.LEFT)
                {
                    anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.LEFTIDLE);
                }
                else
                {
                    anim_ctr.ChangeAnimatorState(AnimController.AnimState.AnimType.RIGHTIDLE);
                }
                rig.velocity = new Vector2(0, 0);
                GimmickController gCon = switchGimmick.GetComponent <GimmickController>();
                gCon.StartSride();
                return;
            }
            //アイテムを拾う処理
            bringctr.SquereButton();
            player_ctr.pickUpFlag = true;
            target = null;
            break;

        case ButtonType.TRIANGLE:
            //錬金したアイテム使用
            if (player_ctr.getCreateItemList().Count <= 0)
            {
                return;
            }
            player_ctr.UseAlchemyItem(alchemyUI_ctr.getNowAlchemyItem);
            break;

        case ButtonType.R1:
            //錬金したアイテムの切り替え
            if (player_ctr.getCreateItemList().Count <= 1)
            {
                return;
            }
            alchemyUI_ctr.setNowAlchemyItem();
            break;

        case ButtonType.L2:
            //全体のマップを表示する処理
            miniMap_ctr.ActiveMiniMap();
            break;

        case ButtonType.R2:
            //錬金UIを開いたり閉じたりする処理
            if (_jumping)
            {
                return;
            }
            player_ctr.OpenAlchemy();
            break;

        case ButtonType.OPTION:
            //PouseManagerにOption処理が書いてある(Escapeと同じ処理)
            break;

        case ButtonType.CROSSX_RIGTH:
            //剣の切り替え
            if (!player_ctr.GetAlchemyUIFlag)
            {
                player_ctr.SwordNumList(1);
                return;
            }
            _onCrossRight = true;
            break;

        case ButtonType.CROSSX_LEFT:
            //剣の切り替え
            if (!player_ctr.GetAlchemyUIFlag)
            {
                player_ctr.SwordNumList(3);
                return;
            }
            _onCrossLeft = true;
            break;

        case ButtonType.CROSSY_UP:
            //剣の切り替え
            if (!player_ctr.GetAlchemyUIFlag)
            {
                player_ctr.SwordNumList(0);
                return;
            }
            _onCrossUp = true;
            break;

        case ButtonType.CROSSY_DOWN:
            //剣の切り替え
            if (!player_ctr.GetAlchemyUIFlag)
            {
                player_ctr.SwordNumList(2);
                return;
            }
            _onCrossDown = true;
            break;
        }
    }
コード例 #9
0
ファイル: DamageBounceBack.cs プロジェクト: saleemb/Gimmickv2
    public int damageToTake;              // damage the enemy will do to Gimmick

    // Use this for initialization
    void Start()
    {
        gimmick         = FindObjectOfType <GimmickController> ();
        theLevelManager = FindObjectOfType <LevelManager>();
    }
コード例 #10
0
ファイル: PauseScreen.cs プロジェクト: saleemb/Gimmickv2
 // Use this for initialization
 void Start()
 {
     theLevelManager = FindObjectOfType <LevelManager>();
     thePlayer       = FindObjectOfType <GimmickController>();
     theEventSystem  = GameObject.Find("EventSystem").GetComponent <EventSystem>();
 }
コード例 #11
0
ファイル: BrigeSignScript.cs プロジェクト: yoshika0330/Rein
 void Start()
 {
     gimiCon        = gimmickController.GetComponent <GimmickController> ();
     birgeSignAnima = GetComponent <Animator> ();
 }
コード例 #12
0
ファイル: SignScript.cs プロジェクト: yoshika0330/Rein
 // Use this for initialization
 void Start()
 {
     gimiCon = gimmickControl.GetComponent <GimmickController> ();
     texCon  = textController.GetComponent <TextController> ();
     CS      = GameObject.Find("Canvas").GetComponent <CanvasScript> ();
 }