// Update is called once per frame void Update() { if (status == ring_status.full) { if (fireball_in_ring.Count < p.exp.lv) { status = ring_status.hatch; hatch = com.fires.new_fireball_in_ring_default(); hatch.scale = 0; view.add_into_ring(hatch.gameObject); fireball_in_ring.AddLast(hatch); view.update_postion(); dot = com.ts.add_dot(p.am.Attr.FireRingHatchDuration, 0.1f, () => { hatch.scale = dot.reach_total / dot.target; }, () => { hatch.scale = 1; status = ring_status.full; hatch = null; dot = null; } ); } } }
private void Shoot(bool kick_ball) { /* RaycastHit hit; * Debug.Log(chld.transform.name); * //Debug.Log(inpDirection.ToString()); * if (Physics.Raycast(chld.position, * new Vector3((facingRight?1:-1),0,0), * out hit,fireRange)) * { * //Debug.DrawLine(chld.position, hit.point,Color.red, 3f); * if (hit.collider.tag == "Enemy") * { * Debug.Log("fsdgdgdf"); * * /*Target target = hit.transform.GetComponent<Target>(); * if (target != null) * { * target.TakeDamage(5); * }*/ //} //Quaternion rot = chld.localRotation; //rot.z = (facingRight ? 0f : 180f); GameObject eff2 = Instantiate(fireb, chld.position, chld.rotation) as GameObject; fireball ball = eff2.GetComponent <fireball>(); ball.kick_ball = kick_ball; }
public fireball new_fireball_in_ring_default() { fireball fb = fireball.new_fireball(go_fireball_normal_hit, 1.4f, 99999, 20f, com.p.transform.position, Quaternion.Euler(Vector3.zero), 0, go_fireball_boom); fireballs.Add(fb.uuid, fb); return(fb); }
//Add more fireballs private void AddFireball(int count) { for (int i = 0; i < count; i++) { fireball fireball = Instantiate(fireballPrefab); fireball.gameObject.SetActive(false); fireballs.Enqueue(fireball); } }
public static fireball new_fireball(GameObject go_to_instantiate, float default_size, float alive_time_after_loose, float speed, Vector3 default_postion, Quaternion rotation_after_losse, float hurt, GameObject boom, GameObject target) { fireball fb = new_fireball(go_to_instantiate, default_size, alive_time_after_loose, speed, default_postion, rotation_after_losse, hurt, boom); fb.target = target; fb.losse(); return(fb); }
public fireball Remove() { if (fireball_in_ring.Count == 0 || (status == ring_status.hatch && fireball_in_ring.Count == 1)) { return(null); } fireball fb = fireball_in_ring.First.Value; fireball_in_ring.RemoveFirst(); return(fb); }
public void big_fire_ring() { //judge mana fireball fb = com.p.fr.Remove(); if (fb != null) { fb.destory(); Instantiate(big_fire_ring_go, com.p.transform.position, Quaternion.Euler(Vector3.zero)); } }
void FireFireballs() { newFireball = (Transform)Instantiate(fireballPreFab).transform; newFireball.position = transform.position; //set the initial position of the fireball fireball nf = newFireball.GetComponent <fireball>(); nf.target = currentTarget; nf.damage = fb_damage; nf.speed = fb_speed; nf.knock_back = fb_knock_back; if (nf.speed == 0) { CancelInvoke(); } }
public fireball new_fireball_default(Transform parent, Quaternion world_rotation, float hurt) { fireball fb = fireball.new_fireball( go_p_hot_rock, 1, 10, 10, parent.position, world_rotation, hurt, go_p_fire_hit_01, null, 0.5f); fb.go.transform.parent = parent; fireballs.Add(fb.uuid, fb); return(fb); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0) && fList.Count > 0) { GameObject fire = fList[0]; fList.RemoveAt(0); Vector2 cursorInWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); Vector2 direction = cursorInWorldPos - (Vector2)fire.transform.position; direction.Normalize(); Rigidbody2D rb = fire.GetComponent <Rigidbody2D>(); rb.simulated = true; rb.velocity = direction * spd; fireball f = fire.GetComponent <fireball>(); f.transform.parent = null; f.isShooting = true; f.thrown(); currentNum--; } }
public static fireball new_fireball(GameObject go_to_instantiate, float default_size, float alive_time_after_losse, float speed, Vector3 default_postion, Quaternion rotation_after_losse, float hurt, GameObject boom) { GameObject go = (GameObject)Instantiate(go_to_instantiate, default_postion, new Quaternion()); fireball fb = go.AddComponent <fireball> (); fb.rotation_after_losse = rotation_after_losse; fb.uuid = System.Guid.NewGuid(); fb.alive_time_after_losse = alive_time_after_losse; fb.size = default_size; fb.status = fire_status.stay; fb.go = go; fb.speed = speed; fb.Hurt = hurt; fb.boom = boom; fb.go.GetComponent <ParticleSystem> ().simulationSpace = ParticleSystemSimulationSpace.Local; go.GetComponent <CapsuleCollider> ().enabled = false; return(fb); }
//Return object to pool. public void ReturnToPool(fireball fireball) { fireball.gameObject.SetActive(false); fireballs.Enqueue(fireball); }
public void SetTarget(Hex v, Hex start, int y) { act = ACT.IDLE; if (type == "fire") { act = ACT.IDLE; if (curmagic_id == 1) { fireball[] fireb = new fireball[8]; for (int i = 0; i < 8; ++i) { fireb[i] = ((GameObject)Instantiate(magics[0])).GetComponent <fireball>(); fireb[i].targetHex = v; Vector3 v2 = v.transform.position; v2 = new Vector3(v2.x, 2, v2.z); Vector3 Start = start.transform.position; if (i == 2) { Start.z -= 6; } if (i == 3) { Start.z += 6; } if (i == 4) { Start.z += 3; } if (i == 5) { Start.z -= 3; } if (i == 6) { Start.x += 3; } if (i == 7) { Start.x += 3; } if (i == 1) { Start.x -= 6; } if (i == 0) { Start.x += 6; } Start.y = 10; fireb[i].target = v2; fireb[i].transform.position = Start; fireb[i].fire = true; } } else { fireball fireb = new fireball(); fireb = ((GameObject)Instantiate(magics[0])).GetComponent <fireball>(); fireb.targetHex = v; Vector3 v2 = v.transform.position; v2 = new Vector3(v2.x, 2, v2.z); Vector3 Start = start.transform.position; Start.y = 9; fireb.target = v2; fireb.transform.position = Start; fireb.fire = true; } } else if (type == "wall") { // wall wal = ((GameObject)Instantiate(magics[2])).GetComponent<wall>(); } else if (type == "wind") { EffectManager.GetInst().ShowEffect_Summon(v.gameObject, 10, 2); MapManager.GetInst().ResetMapColor(); MapManager.GetInst().MarkAttackRange(v, 3, false); v.At_Marked = true; CameraManager.GetInst().ResetCameraTarget(); CostManager.GetInst().CostDecrease(CostManager.GetInst().Curcostnum); } else if (type == "water") { if (curmagic_id == 2) { fireball[] fireb = new fireball[4]; for (int i = 0; i < 4; ++i) { fireb[i] = ((GameObject)Instantiate(magics[1])).GetComponent <fireball>(); fireb[i].targetHex = v; Vector3 v2 = v.transform.position; v2 = new Vector3(v2.x, 0, v2.z); Vector3 Start = start.transform.position; if (i == 2) { Start.z -= 8; } if (i == 3) { Start.z += 8; } if (i == 1) { Start.x -= 8; } if (i == 0) { Start.x += 8; } Start.y = y; fireb[i].target = v2; fireb[i].transform.position = Start; fireb[i].fire = true; } } else { fireball fireb = new fireball(); fireb = ((GameObject)Instantiate(magics[3])).GetComponent <fireball>(); fireb.targetHex = v; Vector3 v2 = v.transform.position; v2 = new Vector3(v2.x, 0, v2.z); Vector3 Start = start.transform.position; Start.y = 10f; fireb.target = v2; fireb.transform.position = Start; fireb.fire = true; } } }
public void remove_fire_ball(fireball fb) { fireballs.Remove(fb.uuid); }
public void add_fireball(fireball fb) { fireballs.Add(fb.uuid, fb); }