Exemplo n.º 1
0
    protected override void Init()
    {
        base.Init();
        m_DirectID = database.GetDataId("direct");
        database.SetData <Vector2>(m_DirectID, new Vector2(1, 0));

        m_timeWaitId = database.GetDataId("timeWait");
        database.SetData <float>(m_timeWaitId, 0);

        CheckPlayer      _checkPlayer      = new CheckPlayer(m_Find);
        CheckAllowAttack _checkAllowAttack = new CheckAllowAttack(m_timeWaitId, timeAttack);

        BTPrecondition2 con = new BTPrecondition2(_checkPlayer, _checkAllowAttack, BTPrecondition2.BTPrecondition2Param.And);

        _root = new BTPrioritySelector();
        BTParallel moveAttack = new BTParallel(BT.BTParallel.ParallelFunction.Or, con);
        float      maxX, maxY;

        maxX = distance.position.x - transform.position.x;
        maxY = 0;
        moveAttack.AddChild(new Move(speed, new Vector2(1, 0), transform.position, maxX, maxY, m_DirectID, null, true));
        moveAttack.AddChild(new Shoot(bulletObject, shooter, new Vector2(0, -1), m_timeWaitId));

        _root.AddChild(moveAttack);
        _root.AddChild(new Move(speed, new Vector2(1, 0), transform.position, maxX, maxY, m_DirectID, null, true));
    }
Exemplo n.º 2
0
    protected override void Init()
    {
        base.Init();
        m_DirectID = database.GetDataId("direct");
        database.SetData <Vector2>(m_DirectID, new Vector2(0, 0));
        CheckPlayer _checkPlayer = new CheckPlayer(m_Find, true);

        _root = new BTPrioritySelector();
        _root.AddChild(new Move(m_speed, new Vector2(0, 0), transform.position, 999, 999, m_DirectID, _checkPlayer));
    }
    // Use this for initialization
    void Start()
    {
        // Instantiate references to player arrival checking scripts
        checkP1 = checkP1Plane.GetComponent <CheckPlayer> ();
        checkP2 = checkP2Plane.GetComponent <CheckPlayer> ();

        // Instantiate references to player healths
        P1Health = P1.GetComponent <PlayerHealth> ();
        P2Health = P2.GetComponent <PlayerHealth> ();
    }
Exemplo n.º 4
0
    protected override void Init()
    {
        base.Init();
        CheckPlayer _checkPlayer = new CheckPlayer(m_Find, true);

        _root = new BTPrioritySelector();
        BTPrioritySelector selector = new BTPrioritySelector();

        selector.AddChild(new Move(m_Speed, new Vector2(-1, 0), transform.position, 10, 0, -1, _checkPlayer));
        selector.AddChild(new PlayAnimation("fly"));
        _root.AddChild(selector);
    }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        // Instantiate references to player arrival checking scripts
        checkP1 = checkP1Plane.GetComponent <CheckPlayer> ();
        checkP2 = checkP2Plane.GetComponent <CheckPlayer> ();

        // Instantiate references to health
        P1Health = P1.GetComponent <PlayerHealth> ();
        P2Health = P2.GetComponent <PlayerHealth> ();

        // access to the victory canvas and menu UI
        youWinScript = youWinCanvas.GetComponent <YouWinMenuControl> ();
    }
Exemplo n.º 6
0
    protected override void Init()
    {
        base.Init();
        m_DirectID = database.GetDataId("direct");
        database.SetData<Vector2>(m_DirectID, new Vector2(0, 0));
        CheckPlayer _checkPlayer = new CheckPlayer(m_Find);
        _root = new BTPrioritySelector();

        BTParallel run = new BTParallel(BTParallel.ParallelFunction.Or,_checkPlayer);
        run.AddChild(new Move(m_Speed, new Vector2(0, 0), transform.position, 999, 999, m_DirectID));
        run.AddChild(new PlayAnimation("run"));
        _root.AddChild(run);
        _root.AddChild(new PlayAnimation("stand"));

    }
Exemplo n.º 7
0
    protected override void Init()
    {
        base.Init();
        m_r2d = GetComponent <Rigidbody2D>();
        m_CheckCollisionId = database.GetDataId("checkCollision");
        database.SetData <bool>(m_CheckCollisionId, false);

        CheckPlayer    _checkPlayer    = new CheckPlayer(m_Find, true);
        CheckCollision _checkCollision = new CheckCollision(m_CheckCollisionId);

        _root = new BTPrioritySelector();
        _root.AddChild(new PlayAnimation("exploision", _checkCollision));
        _root.AddChild(new PlayAnimation("fall", _checkPlayer));
        _root.AddChild(new PlayAnimation("hang"));
    }
Exemplo n.º 8
0
    protected override void Init()
    {
        base.Init();
        float time       = 0;
        float timeAttack = m_MaxTimeAttack + 1;

        m_timeWaitId = database.GetDataId("timeWait");
        database.SetData <float>(m_timeWaitId, time);

        m_timeAttackId = database.GetDataId("timeAttack");
        database.SetData <float>(m_timeAttackId, timeAttack);

        _root = new BTPrioritySelector();
        CheckPlayer      _checkPlayer      = new CheckPlayer(m_Find);
        CheckAllowAttack _checkAllowAttack = new CheckAllowAttack(m_timeWaitId, m_TimeAttackCooldown);
        CheckAttacking   _checkAttacking   = new CheckAttacking(m_timeAttackId, m_MaxTimeAttack);

        BTPrecondition2 con1 = new BTPrecondition2(_checkAllowAttack, _checkAttacking, BTPrecondition2.BTPrecondition2Param.Or);
        BTPrecondition2 con2 = new BTPrecondition2(_checkPlayer, con1, BTPrecondition2.BTPrecondition2Param.And);

        _root.AddChild(new PlayAnimation("attack", con2));
        _root.AddChild(new PlayAnimation("stand"));
    }
Exemplo n.º 9
0
        public PlayerToCorrect(CheckPlayer player)
        {
            Player = player;
            InitializeComponent();
            ApplyLanguage(Language.Data);
            BindComboBoxes();

            lblAccountName.Text = player.Player.AccountName;
            switch (player.BecomesType)
            {
            case PlayerType.MEMBER:
                rbMember.Checked      = true;
                cbMember.Enabled      = true;
                cbMember.Visible      = true;
                cbMember.SelectedItem = player.BecomesAccount;
                break;

            case PlayerType.HELPER:
                rbHelper.Checked      = true;
                cbHelper.Enabled      = true;
                cbHelper.Visible      = true;
                cbHelper.SelectedItem = player.BecomesAccount;
                break;

            case PlayerType.INVITEABLE:
                rbHelper.Checked      = true;
                cbHelper.Enabled      = true;
                cbHelper.Visible      = true;
                cbHelper.SelectedItem = player.BecomesAccount;
                break;

            case PlayerType.LFG:
                rbLFG.Checked = true;
                break;
            }
        }
Exemplo n.º 10
0
    protected override void Init()
    {
        base.Init();
        float   time       = 0;
        float   timeAttack = m_MaxTimeAttack + 1;
        Vector2 direct     = new Vector2(0, 1);

        m_DirectID = database.GetDataId("direct");
        database.SetData <Vector2>(m_DirectID, direct);

        m_timeWaitId = database.GetDataId("timeWait");
        database.SetData <float>(m_timeWaitId, time);

        m_timeAttackId = database.GetDataId("timeAttack");
        database.SetData <float>(m_timeAttackId, timeAttack);

        _root = new BTPrioritySelector();
        CheckPlayer      _checkPlayer      = new CheckPlayer(m_Find);
        CheckAllowAttack _checkAllowAttack = new CheckAllowAttack(m_timeWaitId, m_TimeAttackCooldown);
        CheckAttacking   _checkAttacking   = new CheckAttacking(m_timeAttackId, m_MaxTimeAttack);

        BTPrecondition2 con1 = new BTPrecondition2(_checkAllowAttack, _checkAttacking, BTPrecondition2.BTPrecondition2Param.Or);
        BTPrecondition2 con2 = new BTPrecondition2(_checkPlayer, con1, BTPrecondition2.BTPrecondition2Param.And);

        BTParallel moveAttack = new BTParallel(BT.BTParallel.ParallelFunction.Or);

        moveAttack.AddChild(new Move(m_Speed, direct, transform.position, 1000f, 0.2f, m_DirectID));

        BTPrioritySelector fight = new BTPrioritySelector();

        fight.AddChild(new PlayAnimation("attack", con2));
        fight.AddChild(new PlayAnimation("fly"));

        moveAttack.AddChild(fight);
        _root.AddChild(moveAttack);
    }