public static void SetUpActorInfo( ActorInfo actor , string actorName , float sizeInPercent , Color nameTextColor , string[] texturePaths ) { actor.actorName = actorName; actor.textColor = nameTextColor; actor.baseActorState = new ActorInfo.ActorState(); actor.baseActorState.sizeInPercent = sizeInPercent; actor.baseActorState.dataArray = new SceneData.SceneNodeData[ texturePaths.Length ]; for( int i =0;i<texturePaths.Length;i++){ actor.baseActorState.dataArray[ i ] = new SceneData.SceneNodeData(); actor.baseActorState.dataArray[ i ].name = actorName + "_" + i.ToString(); actor.baseActorState.dataArray[ i ].parentname = actorName; actor.baseActorState.dataArray[ i ].parentname = actorName; actor.baseActorState.dataArray[ i ].alpha = 1f; actor.baseActorState.dataArray[ i ].posZ = - i; actor.baseActorState.dataArray[ i ].texturePath = texturePaths[ i ]; } }
void EnterActor( ActorInfo info , ActorInfo.ActorState actorState , float posX ) { CreateActorRoot( info , actorState ); GameObject go = GameObject.Find( info.actorName );//actorState.dataArray[ i ].parentname + "/" + actorState ); if( go != null ){ Vector3 pos = go.transform.localPosition; pos.x = posX; go.transform.localPosition = pos; } for(int i=0;i<actorState.dataArray.Length;i++){ actorState.dataArray[ i ].parentname = info.actorName; actorState.dataArray[ i ].sclZ = 1f; SceneCreator.Create( actorState.dataArray[ i ] ); /* go = GameObject.Find( actorState.dataArray[ i ].parentname + "/" + actorState.dataArray[ i ].name ); if( go != null ){ Vector3 pos = go.transform.localPosition; pos.x = posX; go.transform.localPosition = pos; } //*/ } }
void CreateChildLayer( ActorInfo info , ActorInfo.ActorState actorState ) { for(int i=0;i<actorState.dataArray.Length;i++){ actorState.dataArray[ i ].parentname = info.actorName; actorState.dataArray[ i ].sclZ = 1f; SceneCreator.Create( actorState.dataArray[ i ] ); } }
/* IEnumerator Shake( GameObject obj ){ yield return new WaitForSeconds( ); } //*/ void EnterActor( ActorInfo info , ActorInfo.ActorState actorState ) { CreateActorRoot( info , actorState ); CreateChildLayer( info , actorState ); }
GameObject CreateActorRoot( ActorInfo info , ActorInfo.ActorState actorState ) { float scl = actorState.sizeInPercent / 100f; SceneData.SceneNodeData actorNodeData = new SceneData.SceneNodeData(); actorNodeData.name = info.actorName; actorNodeData.parentname = ViNoSceneManager.Instance.theSavedPanel.name; actorNodeData.sclX = scl; actorNodeData.sclY = scl; actorNodeData.sclZ = 1f; actorNodeData.alpha = 1f; actorNodeData.show = true; GameObject actorGO = SceneCreator.Create( actorNodeData ); // m_ActorGOMap[ info.actorName ] = actorGO; return actorGO; }