Esempio n. 1
0
        //=======================

        public IGREffectParticles createEffect(string id)
        {
            IGREffectParticles eff = _world.createEntity(Define.GREntityType.EFFECT_PARTICLE, id) as IGREffectParticles;
            string             path;

            if (id.Length < 20)
            {
                Variant conf = GraphMgr.getEffectConf(id);
                if (conf == null)
                {
                    GameTools.PrintError("createEffect[" + id + "] no conf ERR!");
                    return(null);
                }
                path = conf["file"]._str;
            }
            else
            {
                path = id;
            }

            eff.asset = os.asset.getAsset <IAssetParticles>(path);
            if (eff == null)
            {
                GameTools.PrintError("createEffect[" + id + "] ERR!");
                return(null);
            }

            return(eff);
        }
Esempio n. 2
0
        protected void _debugAvatar()
        {
            new CrossApp(true);

            ConfigManager confMgr = CrossApp.singleton.getPlugin("conf") as ConfigManager;

            confMgr.loadExtendConfig("gconf/avatar", (Variant v) =>
            {
                GraphManager.singleton._formatAvatarConf(v);

                confMgr.loadExtendConfig("gconf/effect", (Variant vv) =>
                {
                    GraphManager.singleton._formatEffectConf(vv);

                    confMgr.loadExtendConfig("gconf/material", (Variant vvv) =>
                    {
                        GraphManager.singleton._formatMaterialConf(vvv);

                        m_world = GraphManager.singleton.createWorld3D("main");

                        m_world.cam.pos = new Vec3(0, 0, 4);
                        m_world.cam.lookAt(new Vec3(0, 0, 0));

                        m_char = m_world.createEntity(Define.GREntityType.CHARACTER) as GRCharacter3D;
                        m_char.load(GraphManager.singleton.getCharacterConf("0"));
                        m_char.applyAvatar(GraphManager.singleton.getAvatarConf("0", "2016"));
                        m_char.applyAvatar(GraphManager.singleton.getAvatarConf("0", "9999"));

                        os.sys.addGlobalEventListener(Define.EventType.UI_MOUSE_UP, (Cross.Event e) =>
                        {
                            m_char.removeAvatar("wing");
                        });
                    });
                });
            });
        }