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 ); }
public GuiPlaceActorAction GuiPlaceActor(string actorId, int x, int y, ActorDirection direction, List <ActionPrecondition> preconditions = null) { var position = new ActorPosition(x, y, direction); return(new GuiPlaceActorAction(actorId, position, preconditions)); }
public Activity ActorMoved(DialogContext dc, string actorId, ActorPosition position) { return(CreateEventActivity(dc, "ActorMoved", new { actorId = actorId, x = position.X, y = position.Y, direction = position.Direction.ToString() })); }
public void PlayerPos(UserToken token, MSGModel message) { ActorPosition ap = message.GetMessage <ActorPosition>(); if (ap.team == 1) { room.BrocastToTeamTwo(Protocol.TYPE_FIGHT, Protocol.AREA_S_BATTLE_POS, 0, ap); } else if (ap.team == 2) { room.BrocastToTeamOne(Protocol.TYPE_FIGHT, Protocol.AREA_S_BATTLE_POS, 0, ap); } }
// 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); } }
void OnEnterActor(string actorName, ActorPosition actorPos) { if (actorLib != null) { // for( int i=0;i<actorLib.actorEntries.Length;i++){ // ActorInfo actorInfo = actorLib.actorEntries[ i ]; // if( actorInfo.actorName == actorName ){ if (m_ActorMap.ContainsKey(actorName)) { ActorInfo actorInfo = m_ActorMap[actorName]; // Debug.Log( "matched Actor Name ," + actorName + " and Enter this actor." ); ActorInfo.ActorState currentActorState = actorInfo.baseActorState; float posX = GetPositionX(actorPos); EnterActor(actorInfo, currentActorState, posX); return; } } // } else { Debug.Log("ActorLibrary not attached. couldn't enter actor : " + actorName); } }
public GuiPlaceActorAction(string actorId, ActorPosition position, List <ActionPrecondition> preconditions) : base(preconditions) { ActorId = actorId; Position = position; }
public double DistanceSquared(ActorPosition p) { return((X - p.X) * (X - p.X) + (Y - p.Y) * (Y - p.Y) + (Z - p.Z) * (Z - p.Z)); }
void OnEnterActor( string actorName , ActorPosition actorPos ) { if( actorLib != null ){ // for( int i=0;i<actorLib.actorEntries.Length;i++){ // ActorInfo actorInfo = actorLib.actorEntries[ i ]; // if( actorInfo.actorName == actorName ){ if( m_ActorMap.ContainsKey( actorName ) ){ ActorInfo actorInfo = m_ActorMap[ actorName ]; // Debug.Log( "matched Actor Name ," + actorName + " and Enter this actor." ); ActorInfo.ActorState currentActorState = actorInfo.baseActorState; float posX = GetPositionX( actorPos ); EnterActor( actorInfo , currentActorState , posX ); return; } } // } else{ Debug.Log( "ActorLibrary not attached. couldn't enter actor : " + actorName ); } }