コード例 #1
0
 public void Populate(IDictionary <string, string> properties)
 {
     if (properties.ContainsKey(PropertyFacing))
     {
         initialFacing = OrthoDirExtensions.Parse(properties[PropertyFacing]);
         facing        = initialFacing;
     }
     if (properties.ContainsKey(PropertySprite))
     {
         if (GetComponent <MapEvent3D>() != null)
         {
             doll = new GameObject("Doll");
             doll.transform.parent        = gameObject.transform;
             doll.transform.localPosition = new Vector3(0.5f, 0.0f, -0.5f);
             animator             = doll.AddComponent <CharaAnimator>();
             animator.parentEvent = GetComponent <MapEvent>();
         }
         else
         {
             animator = gameObject.AddComponent <CharaAnimator>();
         }
         animator.SetSpriteByKey(properties[PropertySprite]);
         animator.Populate(properties);
     }
     GetComponent <MapEvent>().Passable = false;
 }