コード例 #1
0
    private void Start()
    {
        playerObjct = GameObject.Find("NekketsuManager");
        Nmng        = playerObjct.GetComponent <NekketsuManager>();

        audioSource = gameObject.GetComponent <AudioSource>();
    }
コード例 #2
0
    /// <summary>
    /// 先頭を走るプレイヤーのプレイヤー番号(1~4)を返す
    /// </summary>
    /// <param name="Nmng"></param>
    /// <returns>TopPlayerNum</returns>
    int TopPlayerNumber(NekketsuManager Nmng)
    {
        //★TODO★
        //LINQ使えると思うので再度ためす
        //インデックスを返したい

        float[] playersX;
        int     TopPlayerNum = 0;

        playersX = new float[2];

        playersX[0] = Nmng.Player[0].NVariable.X;
        playersX[1] = Nmng.Player[1].NVariable.X;
        //playersX[2] = Nmng.Player[2].NVariable.X;
        //playersX[3] = Nmng.Player[3].NVariable.X;

        if (playersX[1] < playersX[0] &&
            (Nmng.Player[0].NVariable.DeathFlag != DeathPattern.death ||
             Nmng.Player[1].NVariable.DeathFlag == DeathPattern.death))
        {
            TopPlayerNum = 0;
        }
        else if (playersX[0] < playersX[1] &&
                 (Nmng.Player[1].NVariable.DeathFlag != DeathPattern.death ||
                  Nmng.Player[0].NVariable.DeathFlag == DeathPattern.death))
        {
            TopPlayerNum = 1;
        }

        return(TopPlayerNum);
    }
コード例 #3
0
ファイル: NekketsuAction.cs プロジェクト: Unibo12/UmaiKunio
    void Start()
    {
        // 最初に行う
        pos      = transform.position;
        animator = this.GetComponent <Animator>();

        //自分にアタッチされている効果音、変数クラスを取得
        ThisGameObjct = this.gameObject;
        NSound        = ThisGameObjct.GetComponent <NekketsuSound>();
        NVariable     = ThisGameObjct.GetComponent <NekketsuVariable>();
        NMoveV        = ThisGameObjct.GetComponent <NekketsuMoveVariable>();
        NJumpV        = ThisGameObjct.GetComponent <NekketsuJumpVariable>();
        NAttackV      = ThisGameObjct.GetComponent <NekketsuAttackVariable>();

        //熱血マネージャ取得
        NmngGameObjct = GameObject.Find("NekketsuManager");
        Nmng          = NmngGameObjct.GetComponent <NekketsuManager>();

        // 生成(コンストラクタ)の引数にNekketsuActionを渡してやる
        NMove          = new NekketsuMove(this);
        NJump          = new NekketsuJump(this);
        NInput         = new NekketsuInput(this);
        NHurtBox       = new NekketsuHurtBox(this);
        NStateChange   = new NekketsuStateChange(this);
        NHaveItem      = new NekketsuHaveItem(this);
        NMerikomiCheck = new NekketsuMerikomiCheck(this);

        shadeTransform = GameObject.Find(this.gameObject.name + "_Shade").transform;

        NVariable.map = new float[0, 0, 0];
    }
コード例 #4
0
    void Start()   // 最初に行う
                   // カメラの元の位置を覚えておく
    {
        base_pos = Camera.main.gameObject.transform.position;

        playerObjct = GameObject.Find("NekketsuManager");
        Nmng        = playerObjct.GetComponent <NekketsuManager>();
    }
コード例 #5
0
    void Start()
    {
        PlayerObjct = GameObject.Find("NekketsuManager");
        Nmng        = PlayerObjct.GetComponent <NekketsuManager>();

        // スライダーを取得する
        Slider = GameObject.Find("Slider").GetComponent <Slider>();

        Slider.maxValue = Nmng.Player1.st_life;
    }
コード例 #6
0
ファイル: UmaiboSandbag.cs プロジェクト: ishidafuu/UmaiKunio
    void Start()
    {
        // 最初に行う
        pos      = transform.position;
        animator = this.GetComponent <Animator>();

        //Nmng = new NekketsuManager(this);

        playerObjct = GameObject.Find("NekketsuManager");
        Nmng        = playerObjct.GetComponent <NekketsuManager>();

        audioSource = gameObject.GetComponent <AudioSource>();
    }
コード例 #7
0
    // Start is called before the first frame update
    void Start()
    {
        playerObjct = GameObject.Find("NekketsuManager");
        Nmng        = playerObjct.GetComponent <NekketsuManager>();

        switch (itemType)
        {
        case ItemPattern.bokutou:
            itemBox   = new Rect(Settings.Instance.Item.bokutouRect);
            itemBox.x = X;
            itemBox.y = Y + Z;
            break;

        default:
            itemBox = new Rect(0, 0, 0, 0);
            break;
        }
    }
コード例 #8
0
    public float st_brake    = 0.5f; //ぶれーき
    //♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡♡

    // *****共通変数*****

    #endregion

    void Start()
    {
        // 最初に行う
        pos      = transform.position;
        animator = this.GetComponent <Animator>();

        gameObjct = this.gameObject;
        NSound    = gameObjct.GetComponent <NekketsuSound>();

        gameObjct = GameObject.Find("NekketsuManager");
        Nmng      = gameObjct.GetComponent <NekketsuManager>();

        // 生成(コンストラクタ)の引数にNekketsuActionを渡してやる
        NMove        = new NekketsuMove(this);
        NJump        = new NekketsuJump(this);
        NInput       = new NekketsuInput(this);
        NHurtBox     = new NekketsuHurtBox(this);
        NStateChange = new NekketsuStateChange(this);
    }