public override List <TreeNode> BuildTree() { var treeNode = new List <TreeNode>(); if (_hook is ACE.DatLoader.Entity.AnimationHooks.AttackHook _attackHook) { var attackCone = new AttackCone(_attackHook.AttackCone); treeNode.AddRange(attackCone.BuildTree()); } treeNode.AddRange(base.BuildTree()); return(treeNode); }
// Start is called before the first frame update void Start() { // Gets the Rigidbody component and stores it in 'rb' rb = GetComponent <Rigidbody>(); rb.freezeRotation = true; // Reference to Animator component animator = GetComponent <Animator>(); Debug.Log(animator.name); attackCone = transform.Find("Attack Cone").GetComponent <AttackCone>(); audioSource = GetComponent <AudioSource>(); currentHealth = maxHealth; }
public static AttackCone Read(DatReader datReader) { AttackCone a = new AttackCone(); a.PartIndex = datReader.ReadUInt32(); a.LeftX = datReader.ReadSingle(); a.LeftY = datReader.ReadSingle(); a.RightX = datReader.ReadSingle(); a.RightY = datReader.ReadSingle(); a.Radius = datReader.ReadSingle(); a.Height = datReader.ReadSingle(); return(a); }
public void CheckAttack(int attackerID, Position attackerPos, float attackerScale, AttackCone attackCone, AttackInfo attackInfo) { foreach (var shadowObj in ShadowObjectList) { var pObj = shadowObj.PhysicsObj; if (pObj.ID == attackerID || pObj.State.HasFlag(PhysicsState.Static)) { continue; } var hitLocation = pObj.check_attack(attackerPos, attackerScale, attackCone, attackInfo.AttackRadius); if (hitLocation != 0) { attackInfo.AddObject(pObj.ID, hitLocation); } } }