Ejemplo n.º 1
0
        // Slides the actor out, and remove the actor after it has gone
        public void Slide_Out(float over_time)
        {
            rect = GetComponent <RectTransform>();

            if (!remove_when_out_of_sight)
            {
                if (this.position == Actor_Positions.LEFT)
                {
                    ActorManager.left_actors.Remove(this);
                    desired_position = ActorManager.actor_manager.offscreen_left.localPosition;
                    if (!ActorManager.exiting_actors.Contains(this))
                    {
                        ActorManager.exiting_actors.Add(this);
                    }
                }
                else if (this.position == Actor_Positions.RIGHT)
                {
                    ActorManager.right_actors.Remove(this);
                    desired_position = ActorManager.actor_manager.offscreen_right.localPosition;
                    if (!ActorManager.exiting_actors.Contains(this))
                    {
                        ActorManager.exiting_actors.Add(this);
                    }
                }
                else if (this.position == Actor_Positions.CENTER)
                {
                    ActorManager.center_actors.Remove(this);
                    desired_position = ActorManager.actor_manager.offscreen_right.localPosition;
                    if (!ActorManager.exiting_actors.Contains(this))
                    {
                        ActorManager.exiting_actors.Add(this);
                    }
                }
                else if (this.position == Actor_Positions.CUSTOM)
                {
                    desired_position = ActorManager.Closest_Side_To_Exit(this);
                    if (!ActorManager.exiting_actors.Contains(this))
                    {
                        ActorManager.exiting_actors.Add(this);
                    }
                }
                desired_position.y = 0;// ActorManager.Get_Actor_Y_Position(this);

                remove_when_out_of_sight = true;
            }
        }