void update_particle_system_tf() { if (instantiated == null) { return; } if (GameDad.get_particle_system_scale == null || GameDad.get_particle_system_position == null) { return; } float scale = GameDad.get_particle_system_scale(); Vector3 position = GameDad.get_particle_system_position(); instantiated.transform.localScale = new Vector3(scale, scale, scale); instantiated.transform.localPosition = position; }
public override void update() { if (GameDad.selectedStar != -1) { time += 40 * Time.deltaTime; setactive(true); // test cyl.transform.position = GameDad.selectedStarLocation; float s = 0.004f * (1 + Mathf.Exp(-time / 20f)); if (GameDad.get_particle_system_scale != null) { s *= GameDad.get_particle_system_scale(); } cyl.transform.localScale = new Vector3(s, s, s * 0.1f); //cyl.transform.rotation = Quaternion.Euler(0, time, 0); } else { setactive(false); } }
public void make_starseed(int start, Vector3 startLocation, int end, Vector3 endLocation, float speed, bool isred = false) { GameObject starseed = isred? RezFind("spamseed_icon"): RezFind("starseed_icon"); if (GameDad.get_particle_system_scale != null) { float scale = GameDad.get_particle_system_scale(); starseed.transform.localScale *= scale; speed *= Mathf.Sqrt(scale); } Action whenhit = delegate() { if (!isred) { // a green starseed has hit a star // check if the hooks we need even exist if (GameDad.is_green == null || GameDad.get_green == null) { return; } // if the destination star is bare, then: // 1. call give_chance_to_make_red_star // 2. if this is false, then make it green if (!GameDad.is_green(end)) { bool stop = false; if (GameDad.give_chance_to_make_red_star != null) { stop = GameDad.give_chance_to_make_red_star(start, startLocation, end, endLocation); } if (GameDad.is_green(end)) { stop = true; } if (!stop) { GameDad.add_green(end, null); if (GameDad.update_best != null) { GameDad.update_best(); } } } else if (GameDad.get_green(end).type == greenstar.Type.Red) // test // a green starseed has hit a red star. // send a red starseed back { if (GameDad.send_red_hook != null) { GameDad.send_red_hook(end, start); } } /* * var star = new greenstar(); * star.isred = true; * GameDad.add_green(end, star); */ } else { // a red starseed has hit a star if (GameDad.spamseed_lands_on_star != null) { GameDad.spamseed_lands_on_star(end, endLocation - startLocation); // test if (GameDad.update_best != null) { GameDad.update_best(); } } } }; starseeds[id++] = new starseed_owner(startLocation, endLocation, speed, starseed, whenhit, isred); }