Exemplo n.º 1
0
    public void logic(float dt)
    {
        if (isOut || isDead)
        {
            return;
        }

        movline += getProperty(AttributeData.AttrType.ATTR_SPEED) * dt;

        if (movline > manager.timeLine)
        {
            movline       = manager.timeLine;
            isBattleReady = true;
        }

        if (movIcon != null)
        {
            MoveHead head = movIcon.GetComponent <MoveHead> ();

            head.toMove(movline, manager.timeLine);

            if (isBattleReady)
            {
                head.setHighlight(true);
            }
            else
            {
                head.setHighlight(false);
            }
        }
    }
Exemplo n.º 2
0
 public void OnPlaySlash()
 {
     HideMenu(0);
     myPlayer = GameObject.FindGameObjectWithTag("Player").transform.root.GetComponent <MoveHead>();
     myPlayer.SendReadyRPC();
     OnOpponentFound(false);
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     //player = GameObject.FindWithTag("Player").transform;
     // transform.LookAt(player.position);
     direction = transform.forward;
     myPlayer  = GameObject.FindGameObjectWithTag("Player").transform.root.GetComponent <MoveHead>();
 }
Exemplo n.º 4
0
    //---分割线 以下为私有成员---------------------------------------------------
    /// <summary>
    /// 创建行动条头像
    /// </summary>
    /// <param name="id">头像ID</param>
    /// <param name="camp">阵营</param>
    /// <returns></returns>
    private GameObject createMoveHead(int id, BattleUnit.UnitType camp)
    {
        GameObject icon = GameObject.Instantiate(moveHeadPrefab);

        icon.transform.SetParent(moveHeadBack.transform);

        MoveHead head = icon.GetComponent <MoveHead> ();

        head.init(id, movepoint[0], movepoint[1], camp);

        return(icon);
    }
Exemplo n.º 5
0
    public void clearUnit()
    {
        clickType  = UnitType.CLICK_NONE;
        actionType = UnitType.BATTLE_NONE;

        movline = 0f;

        isBattleReady = false;

        if (movIcon != null)
        {
            MoveHead head = movIcon.GetComponent <MoveHead> ();
            head.resetPosition();
        }
    }
Exemplo n.º 6
0
    public void StartCombo(string comboType)
    {
        myPlayer = GameObject.FindGameObjectWithTag("Player").transform.root.GetComponent <MoveHead>();
        switch (comboType)
        {
        case "SWORD":
            // Build sword combo
            isDual      = false;
            comboLength = 4;
            currentCombo.Clear();
            indices = new int[Combos.SWORD.Length];
            Shuffle(indices);
            for (int ii = 0; ii < comboLength; ii++)
            {
                currentCombo.AddRange(Combos.SWORD[Random.Range(0, Combos.SWORD.Length - 1)]);
            }
            break;

        case "DUALSWORD":
            // Build dual sword combo
            isDual      = true;
            comboLength = 6;
            currentCombo2.Clear();
            indices = new int[Combos.REDRIGHT.Length];
            Shuffle(indices);
            for (int ii = 0; ii < comboLength; ii++)
            {
                currentCombo.AddRange(Combos.REDRIGHT[Random.Range(0, Combos.REDRIGHT.Length - 1)]);
                currentCombo2.AddRange(Combos.BLUELEFT[Random.Range(0, Combos.BLUELEFT.Length - 1)]);
            }
            break;
        }
        comboing      = true;
        comboTimer    = 0f;
        currentTarget = 0;
    }
Exemplo n.º 7
0
 private void Awake()
 {
     moveHead = GetComponent <MoveHead>();
     emitter  = GetComponent <Emitter>();
     enabled  = false;
 }