Beispiel #1
0
        void moveactor(Hashtable param)
        {
//			Debug.Log( "OnMoveActor" );
            string actorName = param["name"] as string;
            string position  = param["position"] as string;

#if true
            GameObject go = GameObject.Find(actorName);
            if (go == null)
            {
//				Debug.LogWarning( "Actor name :" + actorName + " Object not found." );
                return;
            }
#else
            GameObject go = null;
            if (m_ActorGOMap.ContainsKey(actorName))
            {
                go = m_ActorGOMap[actorName];
                if (go == null)
                {
                    Debug.LogWarning("Actor name :" + actorName + " Object not found.");
                    return;
                }
            }
#endif
            Vector3       toPos = go.transform.localPosition;
            ActorPosition pos   = ActorUtility.GetActorPosition(position);
            toPos.x = GetPositionX(pos);
//			Debug.Log( "to :" + pos + " , value:" + toPos.x );
            AnimationNode.MoveTo(go, toPos, 1f);
//			TweenPosition.Begin( go , 1f , toPos );
//			iTween.MoveTo( go , toPos , 1f );
        }
Beispiel #2
0
        void OnWizardCreate()
        {
            EditorUtility.DisplayDialog("Note", "Please check that the BG Texture is placed at under a \"Resources/\" folder.", "ok");

            if (!System.IO.Directory.Exists("Assets/Actors"))
            {
                AssetDatabase.CreateFolder("Assets", "Actors");
            }

            ActorInfo actor = ScriptableObjectUtility.CreateScriptableObject("ActorInfo", "Assets/Actors/" + actorName + ".asset") as ActorInfo;

            ActorUtility.SetUpActorInfo(actor, actorName, sizeInPercent, textColor, textures);
            EditorGUIUtility.PingObject(actor);
        }
Beispiel #3
0
        // Test Define character.
        void defineactor(Hashtable param)
        {
            string actorName = param["name"] as string;
//			string textColorStr = param["textColor"] as string;
            string texturePath   = param["texture"] as string;
            float  sizeInPercent = 100f;

            if (param.ContainsKey("size"))
            {
                sizeInPercent = float.Parse(param["size"] as string);
            }

//			Color textColor = C
            ActorInfo info = ScriptableObject.CreateInstance <ActorInfo>();

            m_ActorMap[actorName] = info;

            string[] texs = new string[1];
            texs[0] = texturePath;              //Resources.Load( texturePath , typeof(Texture2D) ) as Texture2D;
            ActorUtility.SetUpActorInfo(info, actorName, sizeInPercent, Color.cyan, texs);
        }
Beispiel #4
0
        // Actor Event.

        /// <summary>
        /// Raises the enter actor event.
        /// </summary>
        /// <param name='param'>
        /// Parameter.
        /// </param>
        void enteractor(Hashtable param)
        {
            if (actorLib != null)
            {
                bool fadein = false;
                if (param.ContainsKey("fade"))
                {
                    string fade = param["fade"] as string;
                    fadein = (fade == "true") ? true : false;
                }
                // Fade in Start ?.
                ISpriteFactory._FADEIN_AT_CREATE = fadein;

                string actorName = param["name"] as string;
                string position  = param["position"] as string;

                ActorPosition pos = ActorUtility.GetActorPosition(position);

//				Debug.Log( "OnEnterActor :" + actorName );
                OnEnterActor(actorName, pos);
            }
        }