コード例 #1
0
ファイル: MJ.cs プロジェクト: dydlegd/DT
        public void Init(MJType type, MJ_STAGE stage, int playerId, Panel_Player playerPanel)
        {
            mTrans = this.transform;
            SetType(type);
            this.stage       = stage;
            PlayerID         = playerId;
            Depth            = 0;
            this.playerPanel = playerPanel;
            sprite.color     = Color.white;
            GetComponent <BoxCollider>().enabled = false;
            if ((stage == MJ_STAGE.IN || stage == MJ_STAGE.CPGResult) && !DataCenter.Instance.hFdata.IsHuiFanging)
            {
                GetComponent <BoxCollider>().enabled = true;
            }
            //ShowArrow(false);
            MJ_Drag md = GetComponent <MJ_Drag>();

            if (md)
            {
                md.enabled = false;
            }
        }
コード例 #2
0
        public MJ SpawnMJ(Transform parent, MJType type, int playerId, MJ_STAGE stage, bool bBack, Panel_Player playerPanel)
        {
            Transform ts = pool.Spawn(prefab, pool.transform);

            ts.transform.localScale = Vector3.one;
            MJ mj = ts.GetComponent <MJ>();

            mj.Init(type, stage, playerId, playerPanel);
            int w = 0, h = 0;

            GetSpriteWH(ref w, ref h, playerId, stage);
            mj.InitSprite(GetSpriteName(type, playerId, stage, bBack), w, h);
            return(mj);
        }