Ejemplo n.º 1
0
        public GameObject BindEffectByPos(string sEffect, float nPosX, float nPosY, float nPosZ, float fLogicDir, float fDecTime)
        {
            GameObject oEffectObj = ResourceMgr.LoadAssetEx(sEffect, true);

            if (!oEffectObj)
            {
                DebugMsg("BindEffectByPos wrong sEffect:" + sEffect);
                return(null);
            }
            oEffectObj.SetActive(false);
            float fGraphPosZ = SceneMgr.Instance.GetGraphicsPosZ(nPosY);

            oEffectObj.transform.position = new Vector3(nPosX, nPosY, fGraphPosZ);
            oEffectObj.transform.rotation = GetGraphRotation(fLogicDir);

            UIMgr.SetLayer(oEffectObj, gameObject.layer);
            DealFixedRotation(oEffectObj);
            oEffectObj.SetActive(true);
            return(oEffectObj);
        }