void Start() { // InitItem ItemProto.Mgr.Instance.Foreach((item) => { if (item.IsBlock()) { SelItemGrid_N addItem = Instantiate(mItemPerfab) as SelItemGrid_N; addItem.transform.parent = mItemGrid.transform; addItem.transform.localScale = Vector3.one; addItem.SetItem(item); } }); mItemGrid.Reposition(); // InitNpc SelItemGrid_N addNpc = Instantiate(mItemPerfab) as SelItemGrid_N; addNpc.transform.parent = mNpcGrid.transform; addNpc.transform.localScale = Vector3.one; addNpc.SetNpc("Model/PlayerModel/Male", "head_m02"); mNpcGrid.Reposition(); mPosX.text = "0"; mPosY.text = "0"; mPosZ.text = "0"; mRotX.text = "0"; mRotY.text = "0"; mRotZ.text = "0"; }
void PutItemDown() { if (mPutOutItem) { mPutOutItem.GetComponent <Collider>().enabled = true; } mPutOutItem = null; mCurrentSelItem = null; }
void CancelOp() { if (mSelectedItem) { mSelectedItem.SetActive(false); } mSelectedItem = null; mPutOutItem = null; //mCurrentReq = null; mCurrentSelItem = null; }
public void OnNpcPutOut(SelItemGrid_N selItem) { if (mCurrentSelItem != selItem) { mCurrentSelItem = selItem; CreateReq req = new CreateReq(); req.mType = OpType.NpcSetting; // req.mReq = AssetBundlesMan.Instance.AddReq(mCurrentSelItem.mNpcPath, Vector3.zero, Quaternion.identity); // req.mReq.ReqFinishWithReqHandler += OnSpawned; // mCreateReqList.Add(req); CreateMode(Instantiate(Resources.Load(mCurrentSelItem.mNpcPath)) as GameObject, req); } }