// Use this for initialization public override void Initialize(GameObject obj) { sumController = attacker.GetComponent <SummonController>(); sumController.castActive = false; sumController.sumChosen = 0; MonoBehaviour.print("No summon equipped in this slot"); }
public void Launch() { summonControl = attacker.GetComponent <SummonController>(); arrived = false; faceDir = summonControl.direction; hitDespawnDelay = 0.2f; print("TRIGGERABLE ATTACKER " + attacker); //triggerableAttacker = attacker; isStatic = true; // Determines the direction and type of hitbox that should be used based off of the direction passed down pulled from the palyer movements. if (faceDir == 0 || faceDir == 1 || faceDir == 2 || faceDir == 3) { givenHitbox = hitboxCardinal; // Passes the id of the hitbox that will be spawned when triggered. // print("bar hitbox"); hitboxRotation = transform.rotation; // Sets the rotation of the spawning hitbox based off of the parent object. hitboxSpawn = hitboxSpawnCardinal; // Determines which hitbox object that spawns. } else if (faceDir == 4 || faceDir == 5 || faceDir == 6 || faceDir == 7) { givenHitbox = hitboxAngle; // print("angled hitbox"); hitboxRotation = transform.rotation; hitboxSpawn = hitboxSpawnAngle; hitboxRotation *= Quaternion.Euler(0, 45, 0); } else { givenHitbox = hitboxCardinal; } // Has all passed values from summonability; // Need to create a new script that contains all of the values that triggerable has that actually runs things with the process. //throw new System.NotImplementedException(); }
void SummonUnitSpawned(SummonController summonController, UnitEntity ent) { mTypeSummons[(int)ent.stats.type].UpdateSummonQueueAmount(-1); }
protected override void Awake() { base.Awake(); mPlayer = GetComponentInChildren<Player>(); mWeapon = GetComponentInChildren<Weapon>(); mWeaponParam.sourceStat = mPlayer.stats; mWeaponParam.source = transform; attackSensor.unitAddRemoveCallback += OnAttackSensorUnitChange; mSummon = GetComponentInChildren<SummonController>(); mSummon.summonedCallback += SummonUnitSpawned; }
public void Launch() { isMoving = false; arrived = false; returning = false; isLeaving = false; summonControl = attacker.GetComponent <SummonController>(); faceDir = summonControl.direction; hitDespawnDelay = 0.2f; print("TRIGGERABLE ATTACKER " + attacker); posRangeCheck = new Vector3(attacker.transform.position.x + range, attacker.transform.position.y + range, attacker.transform.position.z + range); negativeRangeCheck = new Vector3(attacker.transform.position.x - range, attacker.transform.position.y - range, attacker.transform.position.z - range); // triggerableAttacker = attacker; // Determines the direction and type of hitbox that should be used based off of the direction passed down pulled from the palyer movements. if (faceDir == 0 || faceDir == 1 || faceDir == 2 || faceDir == 3) { givenHitbox = hitboxCardinal; // Passes the id of the hitbox that will be spawned when triggered. // print("bar hitbox"); hitboxRotation = transform.rotation; // Sets the rotation of the spawning hitbox based off of the parent object. hitboxSpawn = hitboxSpawnCardinal; // Determines which hitbox object that spawns. } else if (faceDir == 4 || faceDir == 5 || faceDir == 6 || faceDir == 7) { givenHitbox = hitboxAngle; // print("angled hitbox"); hitboxRotation = transform.rotation; hitboxSpawn = hitboxSpawnAngle; hitboxRotation *= Quaternion.Euler(0, 45, 0); } else { givenHitbox = hitboxCardinal; } // Has all passed values from summonability; // Need to create a new script that contains all of the values that triggerable has that actually runs things with the process. //throw new System.NotImplementedException(); /* * detector = clonedHitbox.GetComponent<HitboxDetection>(); // grabs script that will initialize the object. * detector.attacker = attacker; * detector.damage = damage; */ // Destroy(clonedHitbox, meleeDelay); /* * public Transform startMarker; * public Transform endMarker; * public float speed = 1.0F; * private float startTime; * private float journeyLength; * void Start() { * startTime = Time.time; * journeyLength = Vector3.Distance(startMarker.position, endMarker.position); * } * void Update() { * float distCovered = (Time.time - startTime) * speed; * float fracJourney = distCovered / journeyLength; * transform.position = Vector3.Lerp(startMarker.position, endMarker.position, fracJourney); * } */ }
public virtual void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); controller = GetComponent <SummonController>(); animator = GetComponent <Animator>(); }