コード例 #1
0
ファイル: FightCtllerView.cs プロジェクト: drawpixel/DHunter
    public void Create(FightCtller ctller)
    {
        m_ctller = ctller;

        for (int i = 0; i < m_fgv.Length; ++i)
        {
            m_fgv[i] = Util.NewGameObject("Grid_" + ctller.FGrids[i].Dir.ToString(), gameObject).AddComponent<FightGridView>();
            m_fgv[i].Create(this, m_ctller.FGrids[i]);
        }

        m_field = ResMgr.Instance.CreateGameObject(string.Format("Field/{0}", "F01"), gameObject);
    }
コード例 #2
0
ファイル: Launcher.cs プロジェクト: drawpixel/Assets
    void SetupFightCtller()
    {
        //ResMgr.Instance.CreateGameObject("BG/BG01", gameObject);

        m_fc = new FightCtller();
        m_fc.Create();

        GameObject ctl = Util.NewGameObject("FCtller", CanvasUI.gameObject);

        m_fcv = ctl.AddComponent <FightCtllerView>();
        m_fcv.Create(m_fc);

        string[] keys = null;
        Int2D[]  pts  = null;

        keys = new string[] { "Hadis", "Cretos", "Aflotiter", "Bosadon", "Giant", "Bosadon", "Bosadon", "Bosadon", "Bosadon" };
        pts  = new Int2D[] { new Int2D(0, 0), new Int2D(2, 0), new Int2D(0, 1), new Int2D(2, 1), new Int2D(3, 1), new Int2D(4, 1), new Int2D(2, 2), new Int2D(3, 2), new Int2D(4, 2) };
        for (int p = 0; p < keys.Length; ++p)
        {
            string       k    = keys[p];
            InfoCreature info = new InfoCreature(ProtoMgr.Instance.GetByKey <ProtoCreature>(k));
            info.Skills = new InfoSkill[info.Proto.Skills.Length];
            for (int s = 0; s < info.Skills.Length; ++s)
            {
                info.Skills[s] = new InfoSkill(ProtoMgr.Instance.GetByID <ProtoSkill>(info.Proto.Skills[s]));
            }


            Creature ac = new Creature();
            ac.Create(info);
            m_fc.FGrids[0].AddCreature(ac, pts[p]);
        }

        keys = new string[] { "Hadis", "Kerboros", "Aflotiter", "Bosadon", "Giant", "Bosadon", "Bosadon", "Cretos" };
        pts  = new Int2D[] { new Int2D(0, 0), new Int2D(2, 0), new Int2D(3, 0), new Int2D(0, 1), new Int2D(1, 1), new Int2D(0, 2), new Int2D(1, 2), new Int2D(2, 2) };
        for (int p = 0; p < keys.Length; ++p)
        {
            string       k    = keys[p];
            InfoCreature info = new InfoCreature(ProtoMgr.Instance.GetByKey <ProtoCreature>(k));
            info.Skills = new InfoSkill[info.Proto.Skills.Length];
            for (int s = 0; s < info.Skills.Length; ++s)
            {
                info.Skills[s] = new InfoSkill(ProtoMgr.Instance.GetByID <ProtoSkill>(info.Proto.Skills[s]));
            }

            Creature ac = new Creature();
            ac.Create(info);
            m_fc.FGrids[1].AddCreature(ac, pts[p]);
        }

        m_fc.Idle();
    }
コード例 #3
0
    public void Create(FightCtller ctller)
    {
        m_ctller         = ctller;
        gameObject.layer = (int)UnityLayer.UI;

        for (int i = 0; i < m_fgv.Length; ++i)
        {
            m_fgv[i] = Util.NewGameObject("Grid_" + ctller.FGrids[i].Dir.ToString(), gameObject).AddComponent <FightGridView>();
            m_fgv[i].Create(this, m_ctller.FGrids[i]);
        }

        m_field = ResMgr.Instance.CreateGameObject(string.Format("Field/{0}", "F01"), gameObject);
    }
コード例 #4
0
ファイル: FightGrid.cs プロジェクト: drawpixel/Assets
    public void Create(FightCtller ctl, DirType dir)
    {
        m_dir    = dir;
        m_ctller = ctl;

        m_units = new Unit[UnitCount.Y, UnitCount.X];
        for (int y = 0; y < Units.GetLength(0); ++y)
        {
            for (int x = 0; x < Units.GetLength(1); ++x)
            {
                m_units[y, x]          = new Unit(new Int2D(x, y), null);
                m_units[y, x].Position = CalcUnitPosition(m_units[y, x].Index, dir);
            }
        }
    }
コード例 #5
0
ファイル: Launcher.cs プロジェクト: drawpixel/DHunter
    void SetupFightCtller()
    {
        //ResMgr.Instance.CreateGameObject("BG/BG01", gameObject);

        m_fc = new FightCtller();
        m_fc.Create();

        GameObject ctl = Util.NewGameObject("FCtller", RootSprite);
        m_fcv = ctl.AddComponent<FightCtllerView>();
        m_fcv.Create(m_fc);

        string[] keys = null;
        Int2D[] pts = null;

        keys = new string[] { "M01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01" };
        pts = new Int2D[] { new Int2D(0, 0), new Int2D(2, 0), new Int2D(3, 0), new Int2D(4, 0), new Int2D(0, 1), new Int2D(1, 1), new Int2D(2, 1), new Int2D(3, 1), new Int2D(4, 1), new Int2D(0, 2), new Int2D(1, 2), new Int2D(2, 2), new Int2D(3, 2), new Int2D(4, 2)};
        for (int p = 0; p < keys.Length; ++ p)
        {
            string k = keys[p];
            InfoCreature info = new InfoCreature(ProtoMgr.Instance.GetByKey<ProtoCreature>(k));

            Creature ac = new Creature();
            ac.Create(info);
            m_fc.FGrids[0].AddCreature(ac, pts[p]);
        }

        keys = new string[] { "M01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01", "N01" };
        pts = new Int2D[] { new Int2D(0, 0), new Int2D(2, 0), new Int2D(3, 0), new Int2D(4, 0), new Int2D(0, 1), new Int2D(1, 1), new Int2D(2, 1), new Int2D(3, 1), new Int2D(4, 1), new Int2D(0, 2), new Int2D(1, 2), new Int2D(2, 2), new Int2D(3, 2), new Int2D(4, 2) };
        for (int p = 0; p < keys.Length; ++p)
        {
            string k = keys[p];
            InfoCreature info = new InfoCreature(ProtoMgr.Instance.GetByKey<ProtoCreature>(k));
            //info.Guns = new InfoGun[info.Proto.Guns.Length];
            //for (int i = 0; i < info.Guns.Length; ++i)
            //{
            //    info.Guns[i] = new InfoGun(info.Proto.ProtoGuns[i]);
            //}

            Creature ac = new Creature();
            ac.Create(info);
            m_fc.FGrids[1].AddCreature(ac, pts[p]);
        }

        m_fc.Fight();
    }
コード例 #6
0
ファイル: FightGrid.cs プロジェクト: drawpixel/DHunter
    public void Create(FightCtller ctl, DirType dir)
    {
        m_dir = dir;
        m_ctller = ctl;

        m_units = new Unit[UnitCount.Y, UnitCount.X];
        for (int y = 0; y < Units.GetLength(0); ++y)
        {
            for (int x = 0; x < Units.GetLength(1); ++x)
            {
                m_units[y, x] = new Unit(new Int2D(x, y), null);
                m_units[y, x].Position = CalcUnitPosition(m_units[y, x].Index, dir);
            }
        }
    }