示例#1
0
        protected void DrawAvailableActions()
        {
            if (profile.Player == null)
            {
                return;
            }
            if (profile.Player.SelectedEntity == null)
            {
                return;
            }

            bool ownedByPlayer = profile.Player.SelectedEntity.IsOwnedByPlayer(profile.Player);
            if (ownedByPlayer == false)
            {
                return;
            }

            ResetSlider();
            string[] allActions = profile.Player.SelectedEntity.Actions;
            previousSelection = profile.Player.SelectedEntity;
        }
示例#2
0
        private void ChangeSelection(Selectable otherEntity, Player player)
        {
            if (otherEntity == this)
            {
                return;
            }

            SetSelection(false);
            if (player.SelectedEntity != null)
            {
                player.SelectedEntity.SetSelection(false);
            }

            player.SelectedEntity = otherEntity;
            playingArea = Hud.GetPlayingArea();
            otherEntity.SetSelection(true);
        }
示例#3
0
        protected void SelectEntity(Selectable entityToSelect)
        {
            Player player = profile.Player;
            if (player == null)
            {
                return;
            }

            player.SelectedEntity = entityToSelect;
            entityToSelect.SetSelection(true);
        }
示例#4
0
 //public void SpawnStructure(string structureName, Vector3 buildPoint, Selectable builder, Rect playingArea)
 //{
 //    GameObject structureToSpawn = (GameObject)Instantiate(GameManager.ActiveInstance.GetStructurePrefab(structureName),
 //        buildPoint, new Quaternion());
 //    constructionSite = structureToSpawn.GetComponent<Structure>();
 //    if (constructionSite != null)
 //    {
 //        IsSettingConstructionPoint = true;
 //        constructionSite.SetTransparencyMaterial(NotAllowedMaterial, true);
 //        constructionSite.SetColliders(false);
 //        constructionSite.playingArea = playingArea;
 //    }
 //    else
 //    {
 //        Destroy(structureToSpawn);
 //    }
 //}
 //public void SetConstructionPoint()
 //{
 //    Vector3 constructionPosition = UserInput.GetHitPoint();
 //    constructionPosition.y = 0;
 //    constructionSite.transform.position = constructionPosition;
 //}
 protected void TakeOwnershipOfEntity(Selectable selectable, string entityType)
 {
     GameObject group = transform.Find(entityType).gameObject;
     selectable.transform.parent = group.transform;
 }