Beispiel #1
0
 public bool GetRiver(string riverName, out RiverAvatar river)
 {
     river = null;
     //lol
     for (int i = 0; i < Rivers.Count; i++)
     {
         if (Rivers [i].Name == riverName)
         {
             if (Rivers [i].river == null)
             {
                 CreateRiver(Rivers [i]);
             }
             river = Rivers [i].river;
             break;
         }
     }
     return(river != null);
 }
Beispiel #2
0
        protected void CreateRiver(River river)
        {
            Transform  agRivers          = Transforms.AboveGroundRivers;
            GameObject riverAvatarObject = null;

            if (river.DynamicMode)
            {
                riverAvatarObject = GameObject.Instantiate(GameWorld.Get.RiverPrefabDynamic, Transforms.AboveGroundRivers.position, Quaternion.identity) as GameObject;
            }
            else
            {
                riverAvatarObject = GameObject.Instantiate(GameWorld.Get.RiverPrefabStatic, Transforms.AboveGroundRivers.position, Quaternion.identity) as GameObject;
            }
            riverAvatarObject.transform.parent = Transforms.AboveGroundRivers;
            RiverAvatar riverAvatar = riverAvatarObject.GetComponent <RiverAvatar> ();

            river.river             = riverAvatar;
            riverAvatar.ParentChunk = this;
            riverAvatar.Props       = river;
            riverAvatar.RefreshProps();
        }