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); }
// 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; } }
// Use this for initialization void Start() { atkCal = transform.GetComponent <AttackCalFX>(); turningHead = transform.GetComponent <TurnHead>(); }
// Use this for initialization void Start() { atkCal = transform.GetComponent<AttackCalFX>(); turningHead = transform.GetComponent<TurnHead>(); }