Beispiel #1
0
        public override void Excute()
        {
            //base.Excute();

            //actor name
            string actorName = Params["name"];

            Debug.LogFormat("Exit Actor: {0}", actorName);

            //get actor
            ActorObject ao = ImageManager.Instance.GetCreatedObject <ActorObject>(actorName);

            if (ao == null)
            {
                Debug.LogErrorFormat("Can not find actor to fade:{0}", actorName);
            }
            // ao.OnAnimationFinish = OnFinishAnimation;

            float time = float.Parse(Params["fadetime"]);

            ao.OnAnimationFinish = OnFinishAnimation;
            ao.IsEnterScene      = false;
            // if (time - 0f > float.Epsilon)
            // {
            Engine.Status.EnableNextCommand = false;

            ao.FadeOut(time);
            // }
            //  else
            //  {
            //      ao.FadeOut(0);
            // }
        }
Beispiel #2
0
        public override void Excute()
        {
            Debug.LogFormat("Create Actor: {0}", Params["name"]);
            //set objname
            if (Params["objname"] == "")
            {
                Params["objname"] = Params["name"];
            }

            //set path
            string path = Params["path"];

            path           = Settings.Instance.ACTOR_IMAGE_PATH + path;
            Params["path"] = path;

            //set position

            /*
             * Vector3 pos = GetActorPosition(Params["pos"], Params["z_pos"]);
             * Params["x"] = pos.x.ToString();
             * Params["y"] = pos.y.ToString();
             * Params["z"] = pos.z.ToString();
             */

            ImageInfo info = new ImageInfo(Params);
            //set position
            // info.Position = new Vector2(Screen.width / 2,
            //                           Screen.height / 2);

            ActorObject ao = ImageManager.Instance.CreateObject <ActorObject, ImageInfo>(info);

            //base.Excute();
        }
Beispiel #3
0
        public override void Excute()
        {
            //base.Excute();

            //actor name
            string actorName = Params["name"];

            Debug.LogFormat("Enter Actor: {0}", actorName);

            //get actor
            ActorObject ao = ImageManager.Instance.GetCreatedObject <ActorObject>(actorName);

            if (ao == default(ActorObject))
            {
                return;
            }

            //     if(ao.IsEnterScene)
            //     {
            //          Engine.Status.EnableNextCommand = true;
            //          Engine.NextCommand();
            //          return;
            //     }
            ao.IsEnterScene = true;
            ao.Go.SetActive(true);

            Vector3 pos = ActorTagsUtility.GetActorPosition(Params["pos"], Params["z_pos"]);

            ao.SetPosition2D(new Vector2(pos.x, pos.y));
            ao.SetScale(float.Parse(Params["scale"]));
            //ao.SetPosition3D(pos);
            ao.OnAnimationFinish = OnFinishAnimation;

            float time = float.Parse(Params["fadetime"]);


            if (Params["fade"] == "true")
            {
                Engine.Status.EnableNextCommand = false;
                ao.FadeIn(time);
            }
            else
            {
                ao.FadeIn(0);
                OnFinishAnimation();
            }
        }
Beispiel #4
0
        public override void Excute()
        {
            //base.Excute();

            //actor name
            string actorName = Params["name"];

            Debug.LogFormat("Move Actor: {0}", actorName);

            //get actor
            ActorObject ao = ImageManager.Instance.GetCreatedObject <ActorObject>(actorName);

            if (ao == default(ActorObject))
            {
                return;
            }

            ao.Go.SetActive(true);

            float time = float.Parse(Params["time"]);

            bool isAnim = false;

            if (Params["pos"] != "")
            {
                isAnim = true;
                float x_move = ActorTagsUtility.GetActorPositionX(Params["pos"]);
                float y      = ActorTagsUtility.GetActorPositionY();
                ao.MoveTo(new Vector2(x_move, y), time);
            }
            // Vector3 pos = ActorTagsUtility.GetActorPosition(Params["pos"],Params["z_pos"]);
            if (Params["z_pos"] != "")
            {
                isAnim = true;
                float z_scale = ActorTagsUtility.GetActorPositionZ(Params["z_pos"]);
                ao.ScaleTo(z_scale, time);
            }

            if (isAnim)
            {
                ao.OnAnimationFinish = OnFinishAnimation;
            }

            Engine.Status.EnableNextCommand = false;
        }