コード例 #1
0
    bool AttackCommand(Transform chess)
    {
        bool attackable = false;

        chess.GetComponent <CharacterSelect>().AttackRangeList.Clear();
        Transform sel = decisions.GetAttackTarget(chess);

        if (sel != null)
        {
            AttackCalFX attackerCal = Camera.main.GetComponent <AttackCalFX>();
            bool        critiq      = attackerCal.CalcriticalHit(chess, AttackType.physical);
            TurnHead    th          = Camera.main.GetComponent <TurnHead>();
            th.SetTurnHeadSequence(chess, sel, true, false, critiq);
            attackable = true;
        }
        else
        {
            attackable = false;
        }

        return(attackable);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        GameObject gc = GameObject.FindWithTag("GameController");

        Assert.IsTrue(gc != null);
        m_gameCont = gc.GetComponent <GameController>();
        Assert.IsTrue(m_gameCont != null);
        // Spawn 1 turn head (always)
        m_turnHeads = new List <GameObject>();
        GameObject th       = Instantiate(m_turnHeadPrefab, transform.position, Quaternion.identity, transform) as GameObject;
        TurnHead   turnhead = th.GetComponent <TurnHead>();

        turnhead.delay = m_delay;
        turnhead.speed = m_arcSpeed;
        m_turnHeads.Add(th);

        if (m_delay > 0.0f)
        {
            transform.localScale = new Vector3(transform.localScale.x / 2.0f, transform.localScale.y / 2.0f, 1.0f);
            GetComponent <SphereCollider>().enabled = false;
        }
    }
コード例 #3
0
ファイル: FightBack.cs プロジェクト: Darkfeast/BattleCard
 // Use this for initialization
 void Start()
 {
     atkCal      = transform.GetComponent <AttackCalFX>();
     turningHead = transform.GetComponent <TurnHead>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     atkCal = transform.GetComponent<AttackCalFX>();
     turningHead = transform.GetComponent<TurnHead>();
 }