Example #1
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();
            }
        }
Example #2
0
        public override void Excute()
        {
            //base.Excute();

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

            Debug.LogFormat("Fade Out: {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.FadeIn(time);
            // }
            // else
            // {
            //     Engine.Status.EnableNextCommand = false;

            //    ao.FadeIn(0f);
            //  }
        }