/// <summary> /// Make instruction that instantiate new object of behavior near /// parent in random position /// </summary> /// <param name="behavior"></param> /// <returns>Instruction that instantiate new object</returns> public static Instruction InstanceRandomNear(Behavior behavior) { return((sim, cycle) => { Instantiator.InstantiateSim(behavior, sim.transform.position + RandomNearVector3(2.0F)); }); }
/// <summary> /// Make instantiation instruction /// </summary> /// <param name="behavior">instance object behaviour</param> /// <param name="position">position relative to parent</param> /// <returns>Instruction that instantiate new object</returns> public static Instruction InstanceSome(Behavior behavior, Vector2 position) { return((sim, cycle) => { Instantiator.InstantiateSim(behavior, new Vector3(position.x, position.y, 0)); }); }
/// <summary> /// Instantiate Message in parent position /// </summary> /// <param name="message">Message type</param> /// <param name="lifeTime">Time before message self destruction</param> /// <param name="radius">Size of message</param> /// <returns></returns> public static Instruction MsgPost(MessageTag message, float lifeTime, float radius) { return((sim, cycle) => { Instantiator.InstantiateMessage(new Request(sim, message), lifeTime, radius); }); }