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; } }
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); }